Saturday, November 06, 2010

Running Meego Handset in an N900 chroot with Easy Debian: Part 2

In this post, I show you how to start the Meego Handset 1.1 "desktop" in a Maemo chroot, using Easy Debian and the image file you made using instructions in the last post.







DISCLAIMERS:

This is a very shaky process. It is in no way ready for use in any way other than "Oh that's cool!"

The animations on the desktop are very slow, and none of the applications seem to work except Fennec thanks to Robin Burchell, the applications all work now. Please update your scripts!

The Prerequisites:
  • You have a working install of Easy Debian on your N900, and you can start the LXDE desktop in a window.
  • You have made the image from the last post, and you have put it in your /home/user/MyDocs folder.

Quickstart:

I have written four little scripts that semi-automate the process of starting the Meego UI. You can download the zip file containing the four (updated!) scripts here at qole.org. You must put these scripts in the /home/user/meego directory, or edit the scripts to look in another directory.

Put the scripts in the MyDocs folder of your N900 (that's where they'll download if you just choose the root "N900" folder when downloading from the N900), and then, at the Maemo terminal prompt on your N900:

~ $ tar xzvf MyDocs/meegoscripts.tgz

Then:

~ $ cd meego
~/meego $ ./debmee

Hopefully, that's all you have to do to get the Meego 1.1 desktop to start up on your N900. Read on for more details of what's going on "under the hood."

The Explanation:

The main script, debmee, runs the other scripts for you.

debbie /home/user/meego/meegoxeph
/home/user/meego/chrootmeego /home/user/meego/startmeegoui
The first line runs the meegoxeph script in Easy Debian to create a nested X server (Xephyr) for Meego to run in, and the second line runs the chrootmeego script to open the Meego image in a chroot, and the startmeegoui script to start the various pieces of the Meego UI in the Easy Debian X server.

The meegoxeph script is just a stripped-down version of the script that opens LXDE in Easy Debian. I've discussed the process elsewhere, and I'm not going to look very closely at it in this post. However, feel free to ask me questions about it, if you want.

The chrootmeego script is a simple script to open a Meego chroot and run whatever is passed to it in the chroot.
if [ ! -d "/.meego" ] ; then
  sudo mkdir /.meego
fi
IMG="`ls -1 /home/user/MyDocs/meego*.img* | head -1`"
sudo qchroot $IMG /.meego "$@"
The first three lines check to see if you have a /.meego directory, and if you don't, create one. The third line, starting with IMG=, looks for an image file that starts with "meego" in your MyDocs directory, and the third line chroots into that image file and runs the parameters. The parameter that it runs in this case is...


The core of the process: the startmeegoui script.

This script is the most interesting script. It starts all the pieces needed to get the Meego 1.1 desktop running.

export DISPLAY=:1
/usr/bin/mthemedaemon 1>/dev/null 2>&1 &
/usr/bin/sysuid -software -remote-theme 1>/dev/null 2>&1 &
/usr/bin/meego-im-uiserver -software -remote-theme 2>/dev/null &
/usr/bin/mdecorator -software -remote-theme 2>/dev/null &
/usr/bin/duihome --desktop -software -remote-theme 2>/dev/null &

The first line just sets the display to the Xephyr nested X server.

The rest of the lines are taken from the list of started apps found in /etc/xdg/autostart in an early version (August 2010) of Meego Handset. See this post and this one especially. This is the same script I used back in August to start the desktop, and I think it is outdated now. (There are some commented-out lines in the script that I'm not going to discuss in this post, but if you wish to experiment with them, you may).

The list of apps in /etc/xdg/autostart is much larger now, so I think the next step would be to try starting more of them (applauncherd in particular looks promising) and to see if we still need to use software rendering (the -software parameter I'm using on many of the lines).

Another note: the 1>/dev/null 2>&1 stuff that you see on the end of most of the lines of that script just silences the huge amounts of error messages the apps produce. This seems to speed up the whole desktop.

Interesting Problems and Side Effects:
One of the interesting new side effects of this is that the GPS icon starts flashing in Maemo. I guess Meego is trying to acquire a fix for some reason.
Another problem is that no app will start except Fennec. Fixed! See above! Make sure you download the updated scripts!

Killing Meego:
You can shut down Meego (and then the Easy Debian host window) by typing the following at a Maemo terminal prompt:
~ $ sudo closechroot /.meego
~ $ sudo closechroot


Bonus:

If you've read to the bottom of the post, I'll give you a treat. Here's a link to my image file that I made using the instructions from the last post.

Labels: , , , , , , ,

14 Comments:

At Sat Nov 06, 02:13:00 PM PDT, Blogger rebhana said...

Quickly tested it, and it works!

But the device got VERY unresponsive, until I saw that the thumbnailer daemon was running at full steam. After

killall hildon-thumbnailerd

it was much more fun. Fennec started, but I couldn't access the internet. Also, after closing Meego, GPS was still active.

 
At Sat Nov 06, 02:46:00 PM PDT, Blogger Robin Burchell said...

Assuming you're using Xephyr to run the MeeGo UI (it sure looks like it), can you perhaps try setting M_USE_SOFTWARE_RENDERING=1 in your MeeGo environment? That should force software (rather than GL) rendering, which might prove to be faster. It *might* also fix problems you're having with apps. IIRC, Fennec forces software rendering for one reason or another, but nothing else does.

To test the hypothesis on a single application, run it with the '-software' command line arg.

Worth experimenting with at least.

 
At Sat Nov 06, 02:54:00 PM PDT, Blogger rebhana said...

Tried it a second time, without the thumbnailer daemon kicking in.

I was inadvertently able to start another application: by clicking somewhere on the lower left of the screen, xterm started.

Anyway, it's really cool to boot into Meego like this without having to exit Maemo! Is it conceivable to have Meego use the internet connectivity of Easy Debian?

 
At Sat Nov 06, 03:08:00 PM PDT, Blogger Qole Pejorian said...

rebhana: before starting the Meego UI, try gaining root in Maemo, use the /home/user/chrootmeego script to open the Meego script, and then exit out and run:

CHROOT="/.meego" synchroot

See if that gives Internet connectivity. It might not, since this is a Redhat directory structure, not a Debian directory structure.

 
At Sat Nov 06, 03:15:00 PM PDT, Blogger Qole Pejorian said...

Robin: That variable worked! I added that variable to the startmeegoui script and now I can start all of the built-in apps! Well done!

 
At Sat Nov 06, 03:47:00 PM PDT, Blogger rebhana said...

In Meego there is no /etc/resolv.conf, but copying over that from Maemo is sufficient to have internet connectivity in Meego, too! Wow!

 
At Sat Nov 06, 03:51:00 PM PDT, Blogger Qole Pejorian said...

Phone still doesn't work. First it complains about ofonod not being started, but when I start ofonod, the phone app just doesn't start at all.

 
At Sun Nov 07, 01:23:00 AM PST, Blogger rebhana said...

I'm impressed by your stunt, but I hope I'll never have to switch to Meego (no task manager; rpm's instead of deb's; stylus gone,...). For me the future rather seems to lie in a full upgrade of Easy Debian to the next Debian distribution, squeeze! I just hope the USB port doesn't fall off as it did for you.

 
At Sun Nov 07, 03:19:00 AM PST, Blogger Ernesto de Bernardis said...

Yes, I'm not happy of Meego too, as long as it's like it's showing now. Long life to our N900 with Maemo5 and then... I dunno.

 
At Mon Nov 08, 03:24:00 PM PST, Blogger Nico said...

I have tried and does not work for me...
I am getting "Mount Failure!"

/home/user/MyDocs/meego_1_1.img.ext3.lzma failed to mount on loop1

mount: mounting /dev/loop1 on /.meego failed: Invalid argument

 
At Mon Nov 08, 03:34:00 PM PST, Blogger Nico said...

here is what I am getting in xterm:


~/meego $ ./debmee
Starting Debian /home/user/meego/meegoxeph
Chroot dir specified: /.debian
No image file or partition specified.
ls: /home/user/MyDocs/debian*.img*: No such file or directory
/.debian has a qmount already!
/media/mmc1/debian-m5-v3d.img.ext2 already mounted on /.debian...
Everything set up, running chroot...
error opening security policy file /etc/X11/xserver/SecurityPolicy
()
(0x04000002)
Mounting...
using image file: /home/user/MyDocs/meego_1_1.img.ext3.lzma
fs type is lzma
Don't know lzma: Using ext2 file system
Using ext2 file system
mounting /home/user/MyDocs/meego_1_1.img.ext3.lzma on loop
Could not init font path element /usr/share/fonts/X11/cyrillic, removing from list!
Could not init font path element /usr/share/fonts/X11/100dpi/:unscaled, removing from list!
Could not init font path element /usr/share/fonts/X11/75dpi/:unscaled, removing from list!
Could not init font path element /usr/share/fonts/X11/100dpi, removing from list!
Could not init font path element /usr/share/fonts/X11/75dpi, removing from list!
unrecognised device identifier!
unrecognised device identifier!
Cancelling chroot...
~/meego $

 
At Mon Nov 08, 03:41:00 PM PST, Blogger Qole Pejorian said...

Nico, you're trying to use the zipped image. You need to unzip the image first.

lzma -d meego_1_1.img.ext3.lzma

 
At Mon Nov 08, 04:00:00 PM PST, Blogger Nico said...

Qole, thanks...quite imbarassing for me but if I don't know much I can only make mistakes so tank you for your help!
It is working now, is quite slow but I believe is a great idea, like easy debian!!

I hope you will keep up the good work, I will donate for sure!

Thanks again

Nico

 
At Wed Nov 17, 05:02:00 AM PST, OpenID carmen said...

plain old Sid suits me fine. installed it on the 27g FAT partition after mkfs.ext3 and boot right in or chroot from 256mb maemo install left on there

 

Post a Comment

Links to this post:

Create a Link

<< Home