Meego Wiki
Views

SDK/Docs/1.0/配置 MeeGo Xephyr 环境

From MeeGo wiki
< SDK | Docs | 1.0
Revision as of 09:08, 30 August 2010 by Jpzhu (Talk | contribs)
Jump to: navigation, search

The MeeGo SDK with Xephyr provides a development environment on Linux workstations for Netbook and Handheld applications.

Contents

配置MeeGo SDK的Xephyr运行环境

  1. 查验主机是否包含Intel图形芯片组
  2. $ lspci | grep VGA
    

    预期输出: 00:02.0 VGA compatible controller: Intel Corporation ...

    如果你的系统不含Intel图形芯片组, 请参考 MeeGo可用的SDK开发选项.

  3. 按照Getting Started 文中的描述下载你目标平台对应的MeeGo SDK.
  4. 解压下载的映像文件到工作目录
  5. $ tar xvjf <compressed image file> 
    
  6. 安装meego-sdk-chroot脚本
  7. meego-sdk-chroot脚本负责设置chroot环境的挂载点,并正确地启动chroot. 该脚本在退出时会卸载在启动时挂载的所有内容并清除启动时加载的所有进程. 如下命令可以下载此脚本:

    $ wget http://download3.meego.com/meego-sdk-chroot
    

    为meego-sdk-chroot脚本增加可执行权限:

    $ chmod +x ./meego-sdk-chroot
    
  8. 配置主机上的X允许Xephyr可以访问其显示区(allow Xephyr to access the display)
  9. $ xhost +SI:localuser:<user name>
    

    允许用户"bob"访问X显示区的例子:

    $ xhost +SI:localuser:bob
    

    (如果你的主机重启了,那么在运行Xephyr或Qt Creator前,需要再一次运行xhost命令)

  10. 挂载并切换根目录(chroot)到MeeGo映像
  11. 建立一个目录用于挂载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'
    

Start the MeeGo UI with Xephyr

  1. Set the DISPLAY environment variable
  2. Xephyr does not see DISPLAY env variable from host system since Xephyr is running from the MeeGo chroot terminal. In the MeeGo chroot terminal, set the DISPLAY variable before running the startmeego script below.

    # export DISPLAY=:0
    
  3. Launch Xephyr
  4. From inside the MeeGo chroot terminal:

    # startmeego &
    

    This starts the Xephyr server and runs a script to start the MeeGo UI.

    MeeGo Handset UI in Xephyr
    MeeGo Netbook UI in Xephyr
  5. Exit the Simulator
  6. You can stop Xephyr by closing the Xephyr window (click X in the upper corner). You can exit the MeeGo chroot terminal with:

    # exit
    

    This closes down any processes started inside the chroot and unmounts directories used by the chroot environment. The output should look something like this:

    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
    

Debugging the Simulator

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.

Application Development

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>

Installing other software

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

Known issues

  • Panels which rely on DBus (like the battery, networking) don't report devices properly.

英文原文



Personal tools