The MeeGo SDK with Xephyr provides a development environment on Linux workstations for Netbook and Handheld applications.
Contents |
$ lspci | grep VGA
预期输出: 00:02.0 VGA compatible controller: Intel Corporation ...
如果你的系统不含Intel图形芯片组, 请参考 MeeGo可用的SDK开发选项.
$ tar xvjf <compressed image file>
meego-sdk-chroot脚本负责设置chroot环境的挂载点,并正确地启动chroot. 该脚本在退出时会卸载在启动时挂载的所有内容并清除启动时加载的所有进程. 如下命令可以下载此脚本:
$ wget http://download3.meego.com/meego-sdk-chroot
为meego-sdk-chroot脚本增加可执行权限:
$ chmod +x ./meego-sdk-chroot
$ xhost +SI:localuser:<user name>
允许用户"bob"访问X显示区的例子:
$ xhost +SI:localuser:bob
(如果你的主机重启了,那么在运行Xephyr或Qt Creator前,需要再一次运行xhost命令)
建立一个目录用于挂载MeeGo映像:
$ mkdir <image destination directory>
将Meego映像挂载到新建的目录上:
$ sudo mount -o loop,offset=512 <image file> <image destination directory>
切换系统的终端根目录(chroot)到MeeGo系统的根目录上:
$ sudo ./meego-sdk-chroot <image destination directory>
例子:
$ sudo mkdir /opt/meego-handset $ sudo mount -o loop,offset=512 ./meego-handset-ia32-1.0.80.9.20100706.1-sdk-pre0721.raw /opt/meego-handset $ sudo ./meego-sdk-chroot /opt/meego-handset
在执行meego-sdk-chroot后,你看到的终端输出会是如下的一些内容:
mount --bind /proc /home/ell/meego-sdk-0524/proc mount --bind /sys /home/ell/meego-sdk-0524/sys mount --bind /dev /home/ell/meego-sdk-0524/dev mount --bind /dev/pts /home/ell/meego-sdk-0524/dev/pts mount --bind /tmp /home/ell/meego-sdk-0524/tmp mount --bind /var/lib/dbus /home/ell/meego-sdk-0524/var/lib/dbus mount --bind /var/run/dbus /home/ell/meego-sdk-0524/var/run/dbus cp /etc/resolv.conf /home/ell/meego-sdk-0524/etc/resolv.conf root@meego-handset-sdk:/#
此时你已进入MeeGo 终端. 它仿如运行在真正的MeeGo操作系统里,路径,程序,库,环境这些都和你在MeeGo上网本或手机中看到的一模一样.
提示: meego-sdk-chroot会用到chroot命令.请确保你的PATH路径中包含了chroot命令:
$ alias chroot='/usr/sbin/chroot'
因为Xephyr是在chroot终端中运行的,因此无法获得主机DISPLAY环境变量的值. 在MeeGo chroot终端中运行startmeego脚本前,使用以下命令设置DISPLAY的值.
# export DISPLAY=:0
从MeeGo chroot终端命令下执行:
# startmeego &
这会启动Xephyr服务器并且调用其它脚本启动MeeGo UI.
umount /home/ell/meego-sdk-0524/proc umount /home/ell/meego-sdk-0524/sys umount /home/ell/meego-sdk-0524/dev/pts umount /home/ell/meego-sdk-0524/dev umount /home/ell/meego-sdk-0524/tmp umount /home/ell/meego-sdk-0524/var/lib/dbus umount /home/ell/meego-sdk-0524/var/run/dbus
If you are having issues running Xephyr, use the debug script to see what's happening:
startmeego-debug
This shows the console output from the script, which may give you some clues if it's not working correctly.
Your MeeGo application can be built and run from the MeeGo chroot terminal. By default, your application UI will display in a new window on your desktop. To configure your application to show up inside the MeeGo UI in Xephyr, start your application as follows in the MeeGo chroot terminal:
# DISPLAY=:2 <your application>
You can install additional software into the MeeGo chroot environment. From the MeeGo chroot terminal:
# zypper install <package>
You can also upgrade the whole MeeGo image using:
# zypper dist-upgrade