tag:blogger.com,1999:blog-18657729342597743082023-11-15T09:47:49.685-08:00André RodriguesSharing development experiencesAndre Rodrigueshttp://www.blogger.com/profile/15237220668622488545noreply@blogger.comBlogger2125tag:blogger.com,1999:blog-1865772934259774308.post-59486463340804578542011-01-31T12:43:00.000-08:002011-02-01T03:44:21.051-08:00Create a custom MADDE target for MeeGo<div style="text-align: justify;"><b>Prerequisites:</b></div><div style="text-align: justify;"><br />
</div><div style="text-align: justify;">MeeGo 1.1 SDK installed and configured: <a href="http://wiki.meego.com/Getting_started_with_the_MeeGo_SDK_for_Linux">http://wiki.meego.com/Getting_started_with_the_MeeGo_SDK_for_Linux</a></div><ul style="text-align: justify;"><li><b>Create SDK Meego image</b></li>
</ul><div style="text-align: justify;">You should get a base MeeGo <i>sysroot</i> KickStart file to make your changes above it. The MeeGo SDK KickStart files are available at <a href="http://meego.gitorious.org/meego-os-base/image-configurations/trees/MeeGo1.1/SDK">http://meego.gitorious.org/meego-os-base/image-configurations/trees/MeeGo1.1/SDK</a>. We chose the <i>core-armv7l-madde-sysroot.ks</i> file (ARM architecture) as our start point. You can change the KickStart file as described at <a href="http://oss.signove.com/index.php/Custom_Meego_Platform#1._Create_a_custom_MeeGo_image">http://oss.signove.com/</a>. The modified '''sysroot''' MeeGo image can be created with the following command:</div><div style="text-align: justify;"><br />
</div><div style="text-align: justify;"><span style="font-family: "Courier New",Courier,monospace;">$mic-image-creator --run-mode=0 --cache=mycachedir --format=fs --arch=armv7l --config=core-armv7l-madde-sysroot.ks --package=tar.bz2</span></div><ul style="text-align: justify;"><li><b>Add the image to MADDE</b></li>
</ul><div style="text-align: justify;">The script <b><i>ma-create-target-from-image.sh</i></b> should be used to add the modified target to MADDE, it is available at <a href="https://docs.google.com/leaf?id=0BzYTJKRts6JfMTRhOTRkZGUtMzMzNi00NzhmLTgzMTQtNDVhNjE2YTk3OGRl&sort=name&layout=list&num=50">ma-create-target-from-image.sh</a>. 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:</div><div style="text-align: justify;"><br />
</div><div style="text-align: justify;"><span style="font-family: "Courier New",Courier,monospace;">$sudo ./ma-create-target-from-image.sh /full/path/image/meego-core-armv7l-madde-sysroot-1.1.20101213.0940-fs.tar.bz2</span></div><div style="text-align: justify;"><br />
</div><div style="text-align: justify;"><b>NOTE1:</b> do not use relative path to MADDE image file, always use absolute path</div><div style="text-align: justify;"><b>NOTE2:</b> the script only works with tar.bz2 files</div><div style="text-align: justify;"><br />
</div><div style="text-align: justify;">You can check if the target was successfully installed using ''mad-adim list'' command:</div><div style="text-align: justify;"><br />
</div><div style="text-align: justify;"><span style="font-family: "Courier New",Courier,monospace;">$ mad-admin list</span></div><div style="text-align: justify;"><br style="font-family: "Courier New",Courier,monospace;" /></div><div style="text-align: justify;"><span style="font-family: "Courier New",Courier,monospace;">Targets:</span></div><div style="text-align: justify;"><span style="font-family: "Courier New",Courier,monospace;">fremantle-1030 (installable)</span></div><div style="text-align: justify;"><span style="font-family: "Courier New",Courier,monospace;">maemo412-1 (installable)</span></div><div style="text-align: justify;"><span style="font-family: "Courier New",Courier,monospace;">meego-core-armv7l-1.1 (installable)</span></div><div style="text-align: justify;"><span style="font-family: "Courier New",Courier,monospace;">meego-core-armv7l-trunk (installable)</span></div><div style="text-align: justify;"><span style="font-family: "Courier New",Courier,monospace;">meego-core-ia32-1.1 (installable)</span></div><div style="text-align: justify;"><span style="font-family: "Courier New",Courier,monospace;">meego-core-ia32-trunk (installable)</span></div><div style="text-align: justify;"><span style="font-family: "Courier New",Courier,monospace;">meego-handset-ia32-1.1 (installable)</span></div><div style="text-align: justify;"><span style="font-family: "Courier New",Courier,monospace;">meego-handset-ia32-trunk (installable)</span></div><div style="text-align: justify;"><span style="font-family: "Courier New",Courier,monospace;">meego-netbook-ia32-1.1 (installed)</span></div><div style="text-align: justify;"><span style="font-family: "Courier New",Courier,monospace;">meego-netbook-ia32-trunk (installable)</span></div><div style="text-align: justify;"><span style="font-family: "Courier New",Courier,monospace;">meego-core-armv7l-madde-sysroot-1.1.20101213.0940-fs (installed)</span></div>Andre Rodrigueshttp://www.blogger.com/profile/15237220668622488545noreply@blogger.com0tag:blogger.com,1999:blog-1865772934259774308.post-69886233778646552942011-01-31T11:44:00.000-08:002011-01-31T13:18:45.470-08:00How to customize the MeeGo UX<div style="text-align: justify;">MeeGo uses a generic X session launch utility called Uxlaunch (<a href="http://www.meego.gitorious.org/meego-os-base/uxlaunch">http://www.meego.gitorious.org/meego-os-base/uxlaunch</a>). 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:</div><div style="text-align: justify;"><br />
</div><div style="text-align: justify;"> <b>1.</b> Editing KickStart (.ks) file. The .ks file is used to create a MeeGo image.</div><div style="text-align: justify;"><br />
</div><div style="text-align: justify;"><b>NOTE:</b> You can get more information about creating MeeGo images at <a href="http://oss.signove.com/index.php/Custom_Meego_Platform">http://oss.signove.com/index.php/Custom_Meego_Platform</a></div><ul style="text-align: justify;"></ul><div style="text-align: justify;">You can customize your MeeGo UX by setting the desktop session to your own script or application through the KickStart file. The desktop <b><i>--session</i></b> 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:</div><div style="text-align: justify;"><br />
</div><div style="text-align: justify;"><span style="font-family: "Courier New",Courier,monospace;">#core-armv7l-n900.ks --> mcompositor ( used by MeeGo handset</span> )</div><div style="text-align: justify;"><b><span style="font-family: "Courier New",Courier,monospace;">desktop --autologinuser=meego --defaultdesktop=DUI --session="/usr/bin/mcompositor"</span></b></div><div style="text-align: justify;"><br />
</div><div style="text-align: justify;"><span style="font-family: "Courier New",Courier,monospace;">#core-ia32-generic.ks --> No window manager, only starts xterm, the standard terminal emulator for the X </span><span style="font-family: "Courier New",Courier,monospace;">Window System</span></div><div style="text-align: justify;"><b><span style="font-family: "Courier New",Courier,monospace;">desktop --autologinuser=meego --session="/usr/bin/xterm"</span></b></div><div style="text-align: justify;"><br />
</div><div style="text-align: justify;"><span style="font-family: "Courier New",Courier,monospace;">#ivi-ia32-noemgd-1.1.ks --> starts the matchbox window manager and the Qt GUI application through startivi script </span><span style="font-family: "Courier New",Courier,monospace;">( used by MeeGo IVI</span> )</div><div style="text-align: justify;"><b><span style="font-family: "Courier New",Courier,monospace;">desktop --autologinuser=meego --defaultdesktop=X-IVI --session=/usr/bin/startivi</span></b></div><div style="text-align: justify;"><br />
</div><div style="text-align: justify;">It follows the content of <i>startivi</i> script used by IVI:</div><div style="text-align: justify;"><br />
</div><div style="text-align: justify;"><span style="font-family: "Courier New",Courier,monospace;">#!/bin/sh</span></div><div style="text-align: justify;"><br />
</div><div style="text-align: justify;"><span style="font-family: "Courier New",Courier,monospace;">## check to see if a instance is already running</span></div><div style="text-align: justify;"><span style="font-family: "Courier New",Courier,monospace;">CHECK=`/bin/ps auxwww | /bin/grep -v grep | /bin/grep "/usr/bin/ivihome$"`</span></div><div style="text-align: justify;"><br />
</div><div style="text-align: justify;"><span style="font-family: "Courier New",Courier,monospace;">if [ -z "$CHECK" ] ; then</span></div><div style="text-align: justify;"><span style="font-family: "Courier New",Courier,monospace;"> xsetroot -solid black -cursor_name watch</span></div><div style="text-align: justify;"><br />
</div><div style="text-align: justify;"><span style="font-family: "Courier New",Courier,monospace;"> <b>matchbox-window-manager -use_desktop_mode plain -use_titlebar no &</b></span></div><div style="text-align: justify;"><br />
</div><div style="text-align: justify;"><span style="font-family: "Courier New",Courier,monospace;"> <b>ividesktop &</b></span></div><div style="text-align: justify;"><span style="font-family: "Courier New",Courier,monospace;"> <b>panel=`which ivihome`</b></span></div><div style="text-align: justify;"><span style="font-family: "Courier New",Courier,monospace;"> case "x$panel" in</span></div><div style="text-align: justify;"><span style="font-family: "Courier New",Courier,monospace;"> x|xno*)</span></div><div style="text-align: justify;"><span style="font-family: "Courier New",Courier,monospace;"> ;;</span></div><div style="text-align: justify;"><span style="font-family: "Courier New",Courier,monospace;"> *)</span></div><div style="text-align: justify;"><span style="font-family: "Courier New",Courier,monospace;"> $panel</span></div><div style="text-align: justify;"><span style="font-family: "Courier New",Courier,monospace;"> ret=$?</span></div><div style="text-align: justify;"><span style="font-family: "Courier New",Courier,monospace;"> while test $ret -ne 0; do</span></div><div style="text-align: justify;"><span style="font-family: "Courier New",Courier,monospace;"> $panel</span></div><div style="text-align: justify;"><span style="font-family: "Courier New",Courier,monospace;"> ret=$?</span></div><div style="text-align: justify;"><span style="font-family: "Courier New",Courier,monospace;"> done</span></div><div style="text-align: justify;"><span style="font-family: "Courier New",Courier,monospace;"> ;;</span></div><div style="text-align: justify;"><span style="font-family: "Courier New",Courier,monospace;"> esac</span></div><div style="text-align: justify;"><br />
</div><div style="text-align: justify;"><span style="font-family: "Courier New",Courier,monospace;"> xsetroot -bg white -fg red -solid black -cursor_name watch</span></div><div style="text-align: justify;"><span style="font-family: "Courier New",Courier,monospace;">else</span></div><div style="text-align: justify;"><span style="font-family: "Courier New",Courier,monospace;"> echo "startivi is already started, run 'pkill startivi' to restart"</span></div><div style="text-align: justify;"><span style="font-family: "Courier New",Courier,monospace;">fi</span></div><div style="text-align: justify;"><br />
</div><div style="text-align: justify;"> <b>2.</b> Editing <i>/etc/sysconfig/uxlaunch</i> file after image was created</div><ul style="text-align: justify;"></ul><div style="text-align: justify;"><br />
</div><div style="text-align: justify;">The <i>/etc/sysconfig/uxlaunch</i> file has a session property that defines which script or application it should start. You can edit the <b><i></i></b>file to start your own script or application.</div><div style="text-align: justify;"><br />
</div><div style="text-align: justify;"><span style="font-family: "Courier New",Courier,monospace;">session=/usr/bin/mcompositor</span></div><div style="text-align: justify;"><br />
</div><div style="text-align: justify;"><br />
</div><div style="text-align: justify;">On our customized MeeGo image, we create our own script ('''twm-session''') to initialize the <i>twm</i> window manager and start our GUI application. For that, we changed the desktop --session property at KickStart file to start our <i>twm-session</i> script:</div><div style="text-align: justify;"><br />
</div><div style="text-align: justify;"><span style="font-family: "Courier New",Courier,monospace;">#customized ks to "core-ia32-generic.ks"</span></div><div style="text-align: justify;"><b><span style="font-family: "Courier New",Courier,monospace;">desktop --autologinuser=meego --session=/usr/local/bin/twm-session</span></b></div><div style="text-align: justify;"><br />
</div><div style="text-align: justify;"><br />
</div><div style="text-align: justify;">It follows our <i>twm-session</i> script:</div><div style="text-align: justify;"><br />
</div><div style="text-align: justify;"><span style="font-family: "Courier New",Courier,monospace;">#!/bin/bash</span></div><div style="text-align: justify;"><span style="font-family: "Courier New",Courier,monospace;">/usr/bin/xsetroot -grey</span></div><div style="text-align: justify;"><span style="font-family: "Courier New",Courier,monospace;">#starts twm window manager</span></div><div style="text-align: justify;"><b><span style="font-family: "Courier New",Courier,monospace;">/usr/bin/twm &</span></b></div><div style="text-align: justify;"><span style="font-family: "Courier New",Courier,monospace;">#starts our QT application</span></div><div style="text-align: justify;"><b><span style="font-family: "Courier New",Courier,monospace;">/usr/local/bin/signove-desktop</span></b></div><div style="text-align: justify;"><br />
</div><div style="text-align: justify;"><br />
</div><div style="text-align: justify;"><b>NOTE:</b> the <i>twm-session</i> script was installed during the image creation through <i>signove-desktop</i> RPM package. </div><div style="text-align: justify;"><br />
</div><div style="text-align: justify;">You can choose the Window Manager according to your needs. If your platform should<b> support translucent applications</b>, you will need a <b>Compositing Window Manager</b> like mcompositor and mutter. If your platform should <b>NOT support translucent</b> applications and <b>need more efficiency</b>, you could use a <b>Stacking Window Manager</b> like matchbox. You can read more about Window Managers at:</div><ul style="text-align: justify;"><li><a href="http://en.wikipedia.org/wiki/X_window_manager">http://en.wikipedia.org/wiki/X_window_manager</a></li>
<li><a href="http://en.wikipedia.org/wiki/Comparison_of_X_window_managers">http://en.wikipedia.org/wiki/Comparison_of_X_window_managers</a></li>
<li><a href="http://en.wikipedia.org/wiki/Stacking_window_manager">http://en.wikipedia.org/wiki/Stacking_window_manager</a></li>
<li><a href="http://en.wikipedia.org/wiki/Compositing_window_manager">http://en.wikipedia.org/wiki/Compositing_window_manager</a></li>
</ul><div style="text-align: justify;"><br />
</div><div style="text-align: justify;">You can check the links bellow to create translucent applications using QT:</div><ul style="text-align: justify;"><li><a href="http://doc.qt.nokia.com/4.7/qwidget.html#creating-translucent-windows">http://doc.qt.nokia.com/4.7/qwidget.html#creating-translucent-windows</a></li>
<li><a href="http://wiki.meego.com/QML/Creating_a_transparent_window">http://wiki.meego.com/QML/Creating_a_transparent_window</a></li>
</ul><div style="text-align: justify;"><br />
</div><div style="text-align: justify;">For more details about changing desktops on MeeGo:</div><ul style="text-align: justify;"><li style="text-align: justify;"> <a href="http://oss.signove.com/index.php/Custom_Meego_Platform">http://oss.signove.com/index.php/Custom_Meego_Platform</a> </li>
<li style="text-align: justify;"><a href="http://wiki.meego.com/MeeGo_Desktop/Changing_Desktops">http://wiki.meego.com/MeeGo_Desktop/Changing_Desktops</a></li>
</ul>Andre Rodrigueshttp://www.blogger.com/profile/15237220668622488545noreply@blogger.com0