(→Start the MeeGo UI with Xephyr) |
|||
| Line 1: | Line 1: | ||
| + | '''These instructions are deprecated. Please use [[SDK/Docs/1.1/MeeGo SDK with Xephyr|this page]] instead.''' | ||
| + | |||
The MeeGo SDK with Xephyr provides a development environment on Linux workstations for Netbook and Handheld applications. | The MeeGo SDK with Xephyr provides a development environment on Linux workstations for Netbook and Handheld applications. | ||
These instructions are deprecated. Please use this page instead.
The MeeGo SDK with Xephyr provides a development environment on Linux workstations for Netbook and Handheld applications.
Contents |
$ tar xvjf <compressed image file>
The meego-sdk-chroot script sets up mountpoints for the chroot environment, then starts the chroot proper. The script also attempts to unmount everything when it exits and clear up any processes started in the chroot. Get it with:
$ wget http://download3.meego.com/meego-sdk-chroot
Make the chroot script executable:
$ chmod +x ./meego-sdk-chroot
$ xhost +SI:localuser:<user name>
Example for user named "bob":
$ xhost +SI:localuser:bob
(You need to do this once before running Xephyr or Qt Creator after each reboot)
Create a directory for the MeeGo image contents:
$ mkdir <image destination directory>
Mount the image into the directory:
$ sudo mount -o loop,offset=512 <image file> <image destination directory>
Change the root of the terminal to the MeeGo OS root:
$ sudo ./meego-sdk-chroot <image destination directory>
Example:
$ 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
The output from running meego-sdk-chroot should look like this:
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:/#
This is now a MeeGo chroot terminal. It behaves just like a terminal running in the MeeGo OS: paths, programs, libraries, and environment are all the same as those on a MeeGo OS netbook or handset.
Caution: If you later decide to delete the directory that you created, you should unmount the image first. Otherwise the contents of the image will be destroyed.
$ sudo umount <image destination directory>
Note: meego-sdk-chroot uses the chroot command. Be sure it is in your path or create an alias:
$ alias chroot='/usr/sbin/chroot'
$ lspci | grep VGA
Desired output: 00:02.0 VGA compatible controller: Intel Corporation ...
If your system does not have Intel graphics, you can not start Xephyr with the MeeGo image. However, you can still use the chroot to launch your applications which will run on the desktop. Go to "Application Development" below.
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
The handset SDK has the MeeGo simulator launcher pre-installed, but for some reason the handset sdk doesn't seem to have it installed; so in the handset SDK you first want to do the folowing from inside the MeeGo chroot terminal:
# zypper install meego-simulator-launcher-handset
From inside the MeeGo chroot terminal:
# startmeego &
This starts the Xephyr server and runs a script to start the MeeGo UI.
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
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.
The MeeGo chroot terminal can be used to build, run, and debug your application. You can do this with or without Xephyr.
Running without Xephyr: If you run your application from the command-line, it will run normally on your workstation. Although it is not running inside the MeeGo OS UI, it is still using the MeeGo libraries. You can put temporary code in your application to manually set its window size to that of a netbook (1024x800) or handheld (800x480 or 480x800) device.
Running with Xephyr: If you have Xephyr running already, before you start your application from the command-line you need to set the $DISPLAY variable to :2 tell your application to display in the Xephyr window. Otherwise it will use the default DISPLAY value of :0 and show up on your workstation.
# export DISPLAY=:2 # <start your application>
Building your application in the MeeGo chroot terminal is the same as doing so on a MeeGo system. You can use gcc, emacs, or any other Linux development tools you are comfortable with. (See Qt Creator use below).
Source code is often managed by a version control system and checked in/out on your host workstation. To have your source directory available within the MeeGo chroot, you can "mount --bind" your source directory to a subdirectory in the MeeGo chroot. From a terminal on your host workstation, outside the MeeGo chroot:
$ sudo mount --bind <full path to source directory on host workstation> <full path to MeeGo chroot directory>/<subdirectory in MeeGo>
For example, using the directories in the example above where the chroot folder is located at /opt/meego-handset, do the following:
$ sudo mkdir /opt/meego-handset/root/src <-- Create a folder inside MeeGo to mount the source to $ sudo mount --bind /home/bob/src/ /opt/meego-handset/root/src/
Caution: Be sure to unmount this directory when finished and before "rm -rf /opt/meego-handset" at some later date or your source directory will be destroyed.
Qt Creator is part of MeeGo. You can launch Qt Creator from the MeeGo chroot. The following will open Qt Creator IDE on your workstation (not in Xephyr)
# export DISPLAY=:0 # qtcreator
From Qt Creator you can now load your project, build, run, and debug it as you would normally.
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