segunda-feira, 31 de janeiro de 2011

Create a custom MADDE target for MeeGo

Prerequisites:

  • Create SDK Meego image
You should get a base MeeGo sysroot KickStart file to make your changes above it. The MeeGo SDK KickStart files are available at http://meego.gitorious.org/meego-os-base/image-configurations/trees/MeeGo1.1/SDK. We chose the core-armv7l-madde-sysroot.ks file (ARM architecture) as our start point. You can change the KickStart file as described at http://oss.signove.com/. The modified '''sysroot''' MeeGo image can be created with the following command:

$mic-image-creator --run-mode=0 --cache=mycachedir --format=fs --arch=armv7l --config=core-armv7l-madde-sysroot.ks --package=tar.bz2
  • Add the image to MADDE
The script ma-create-target-from-image.sh should be used to add the modified target to MADDE, it is available at ma-create-target-from-image.sh. We have to modify the original script since it is not supported by MeeGo anymore. It follows the command line to create the MADDE target using the script:

$sudo ./ma-create-target-from-image.sh /full/path/image/meego-core-armv7l-madde-sysroot-1.1.20101213.0940-fs.tar.bz2

NOTE1: do not use relative path to MADDE image file, always use absolute path
NOTE2: the script only works with tar.bz2 files

You can check if the target was successfully installed using ''mad-adim list'' command:

$ mad-admin list

Targets:
fremantle-1030                                       (installable)
maemo412-1                                           (installable)
meego-core-armv7l-1.1                                (installable)
meego-core-armv7l-trunk                              (installable)
meego-core-ia32-1.1                                  (installable)
meego-core-ia32-trunk                                (installable)
meego-handset-ia32-1.1                               (installable)
meego-handset-ia32-trunk                             (installable)
meego-netbook-ia32-1.1                               (installed)
meego-netbook-ia32-trunk                             (installable)
meego-core-armv7l-madde-sysroot-1.1.20101213.0940-fs (installed)

How to customize the MeeGo UX

MeeGo uses a generic X session launch utility called Uxlaunch (http://www.meego.gitorious.org/meego-os-base/uxlaunch). It is designed to quickly start X and a user desktop. There are two ways to set which script or application the Uxlaunch should boot:

    1. Editing KickStart (.ks) file. The .ks file is used to create a MeeGo image.

NOTE: You can get more information about creating MeeGo images at http://oss.signove.com/index.php/Custom_Meego_Platform
    You can customize your MeeGo UX by setting the desktop session to your own script or application through the KickStart file. The desktop --session property is used by Uxlaunch to start the desktop session during MeeGo startup. Each MeeGo UX (Netbook, Handset and IVI) uses a different startup script or application, for example:

    #core-armv7l-n900.ks --> mcompositor ( used by MeeGo handset )
    desktop --autologinuser=meego  --defaultdesktop=DUI --session="/usr/bin/mcompositor"

    #core-ia32-generic.ks --> No window manager, only starts xterm, the standard terminal emulator for the X Window System
    desktop --autologinuser=meego  --session="/usr/bin/xterm"

    #ivi-ia32-noemgd-1.1.ks --> starts the matchbox window manager and the Qt GUI application through startivi script ( used by MeeGo IVI )
    desktop --autologinuser=meego  --defaultdesktop=X-IVI --session=/usr/bin/startivi

    It follows the content of startivi script used by IVI:

    #!/bin/sh

    ## check to see if a instance is already running
    CHECK=`/bin/ps auxwww | /bin/grep -v grep | /bin/grep "/usr/bin/ivihome$"`

    if [ -z "$CHECK" ] ; then
        xsetroot -solid black -cursor_name watch

        matchbox-window-manager -use_desktop_mode plain -use_titlebar no &

        ividesktop &
        panel=`which ivihome`
        case "x$panel" in
            x|xno*)
                ;;
            *)
                $panel
                ret=$?
                while test $ret -ne 0; do
                    $panel
                    ret=$?
                done
                ;;
        esac

        xsetroot -bg white -fg red  -solid black -cursor_name watch
    else
        echo "startivi is already started, run 'pkill startivi' to restart"
    fi

         2. Editing /etc/sysconfig/uxlaunch file after image was created

      The /etc/sysconfig/uxlaunch file has a session property that defines which script or application it should start. You can edit the file to start your own script or application.

      session=/usr/bin/mcompositor


      On our customized MeeGo image, we create our own script ('''twm-session''') to initialize the twm window manager and start our GUI application. For that, we changed the desktop --session property at KickStart file to start our twm-session script:

      #customized ks to "core-ia32-generic.ks"
      desktop --autologinuser=meego  --session=/usr/local/bin/twm-session


      It follows our twm-session script:

      #!/bin/bash
      /usr/bin/xsetroot -grey
      #starts twm window manager
      /usr/bin/twm &
      #starts our QT application
      /usr/local/bin/signove-desktop


      NOTE: the twm-session script was installed during the image creation through signove-desktop RPM package.

      You can choose the Window Manager according to your needs. If your platform should support translucent applications, you will need a Compositing Window Manager like mcompositor and mutter. If your platform should NOT support translucent applications and need more efficiency, you could use a Stacking Window Manager like matchbox. You can read more about Window Managers at:

      You can check the links bellow to create translucent applications using QT:

      For more details about changing desktops on MeeGo: