DebianArmel on IT

  1. How does it work?
  2. Formatting the memory card to the ext2 file format and enabling its use on the Internet Tablet
  3. Getting and unpacking the rootfs
  4. Chrooting into the rootfs
  5. Upgrading the chroot
  6. Installing VNC server and Maemo vncviewer
  7. Final notes

Inspired by this maemo-developers mailing list post: http://lists.maemo.org/pipermail//maemo-developers/2007-February/008480.html

You can read more about Debian armel port here: http://wiki.debian.org/ArmEabiPort. Debian SID (which stands for Still-in-Development) packages for the armel architecture can be searched on the official Debian packages website as of now: http://www.debian.org/distrib/packages#search_packages.

How does it work?

Debian armel is a Debian Linux distribution port for the ARM EABI CPU architecture, the same the Maemo packages are compiled for.

As of now this distribution can work as a standalone operating system of the Internet Tablet, booting from the memory card. You can find more information and links to downloadable rootfs images modified to boot on Internet Tablets in these Internet Tablet Talk forum threads: http://www.internettablettalk.com/forums/showthread.php?t=13925 (for n770) and http://www.internettablettalk.com/forums/showthread.php?t=15577 (for n8xx), as well as on this wiki page: http://www.internettablettalk.com/wiki/index.php?title=Debian .

Booting right into the Debian rootfs still has some shortcomings though: there is no sound, there are problems with the power management and there is still no way to run hildonized and regular gtk/qt applications alongside each other.

The method described here allows to access the Debian rootfs on the memory card from within Maemo, profiting from its full support for the Internet Tablet hardware and allowing for quick testing of the software from the Debian armel repositories.

We're going to start with getting a Debian armel rootfs from the Internet. A rootfs is a compressed backup of a working Debian armel installation that's going to be unpacked onto the memory card. Then we're going to http://en.wikipedia.org/wiki/Chroot into this system and upgrade it to the most recent version. At this point it's already possible to install and use console applications from the Debian armel repository. To be able to use X (graphical) applications we'll need to install a VNC server within this system, install some kind of a window manager and run a VNC session which we're going to connect to locally with the vncviewer for Maemo.

Note that this still means having an entire separate Linux distribution installed on the memory card. Depending on how many applications you have installed within it it can take up from 300 MB to several gigabytes of space (a setup with several lightweight window managers and applications still shouldn't take more than 1 GB, if you only have a 512 MB memory card you need to pay attention not to run out of space though).

Formatting the memory card to the ext2 file format and enabling its use on the Internet Tablet

Linux can't be installed on a device using the FAT file system which is what Maemo uses for the memory cards by default. For that reason we need to switch to using ext2 on the memory card it's going to be installed on. The HOWTO for this can be found here: HowTo mmc ext2. Note that if you don't want to change your Maemo system to be able to use only ext2-formatted memory cards you can mount the card manually every time you put it into the slot with the command specified in the aforementioned HOWTO instead of changing your /usr/sbin/mmc-mount file permanently.

Getting and unpacking the rootfs

The rootfs that's been tested by me can be found here http://lists.debian.org/debian-arm/2007/01/msg00034.html along with a md5 sum. After downloading it and preferably performing a md5 sum check unpack it to your ext2 formatted memory card. On Linux this is done with the tar xvjf command.

Note that though it's most likely possible to unpack a tar.bz2 archive even this big on the Internet Tablet itself it requires a non-standard tar (or changing the archive format to tar.gz first) and will take several hours.

Alternatively, you can use one of the aforementioned rootfs images modified to boot on Internet Tablets. In this case take into consideration that you probably shouldn't follow this guide to the letter.

Chrooting into the rootfs

It might be a good idea to run dropbear or openssh server on your Internet Tablet at this point and ssh to it from a desktop computer for easier text input because there's going to be quite a lot of it.

Now that we have the rootfs unpacked we have essentially installed another operating system on the Internet Tablet and we can make it run using the Maemo kernel and chroot. In order to do this, become root and use:

chroot /media/mmc1/armel-root-fs

The memory card needs to be mounted first, either by the automounter or by hand. Also, your MMC number may vary on n800 depending on the slot the card is in.

The prompt should change to:

sh-3.1#

once you've chrooted succesfully. Every time you chroot it's useful to perform:

mount -t devpts none /dev/pts

mount /proc /proc -t proc

These commands need to be issued every time you chroot for the first time after an Internet Tablet reboot. Note that failing to mount /dev/pts results in an inability to run any terminal emulators in the X session transferred to the Maemo vncviewer.

Also, to make the internet connection work from within the chroot you need to copy /etc/resolv.conf and /etc/hosts from the Maemo system. It's a good moment to mount the Maemo system from within the chrooted environment, otherwise you can just copy these files to corresponding locations on the memory card using another terminal.

Upgrading the chroot

To be able to install anything successfully on our newly-installed Debian we need to upgrade it first, especially since the supplied rootfs isn't very recent. For that reason also, its /etc/apt/sources.list file is no longer valid. Its contents need to be changed to a working repository address. For the moment I suggest:

deb http://ftp.de.debian.org/debian sid main

Alternatively you can use any debian mirror distributing armel.

Be careful not to change your Maemo's system sources.list instead of the one on the memory card! This would result in a serious damage to your base system.

Now, activate an internet connection in Maemo if it hasn't been active so far. Preferably, test if it works in the chroot with ping command (it's available in the rootfs).

ping -c2 google.com

Note that what we're going to be doing here is performing a system upgrade bigger than the ones Maemo gets so it's better not to do this if your internet connection has some serious limitations.

In the chroot issue:

apt-get update

and then:

apt-get upgrade

After a successful upgrade you're free to install whatever you want from the Debian armel repository either by using apt-get on the commandline or the pseudographic frontend called aptitude which is avalaible in the rootfs.

Installing VNC server and Maemo vncviewer

If you're willing to run some applications that are not console-based you'd need to apply this method.

First install vncviewer (http://vncviewer.garage.maemo.org/) on the Maemo system.

Then get back to the chroot and install vncserver within it with:

apt-get install vncserver

Now you need some kind of a window manager or a desktop environment to run, otherwise it wouldn't make much sense. Lightweight solutions are best for a start, especially on a N770. For instance icewm, blackbox, fvwm-crystal and e16 work well. Xfce4 works fine too, but it's a bigger download.

Having installed a window manager edit (or create) /home/user/.xsession file to include:

#exec icewm-session

#exec blackbox
#exec e16
#exec startxfce4
#exec fvwm-crystal
#exec wmaker

Uncomment the entry you need or add a relevant one instead.

Then run the vncserver. It's best to get accustomed with the settings it offers but:

vncserver :1 -depth 16 -geometry 800x480

is fine in most cases. Note that you can make the screen bigger than 800x480. 800x600 is a good choice for Xfce because otherwise some dialogs miss lower parts and can't be closed. Having a screen bigger than it physically is you'll be able to scroll it in the vncviewer with the hardware keys.

If you no longer need a session end it with:

vncserver -kill :1

Note that exiting Maemo vncviewer doesn't end the session, neither does logging out in the window manager.

Now, run vncviewer in Maemo. Type localhost:1 in the connection dialog it displays on startup and then the password you've set up earlier. The chosen window manager / desktop environment should start. Remember about mounting /dev/pts in case you're running any terminal emulators within the chroot. It's a good idea to install xvkbd or another on-screen keyboard for easier text input too (even though vncviewer is able to invoke the standard Maemo onscreen keyboard in its all-screen variation by default). Left- and right-clicking in the vncviewer is achieved with the zoom-out/zoom-in buttons of the device.

To be able to connect to your localhost vncserver without an active internet connection it's useful to set up a dummy Internet interface in Maemo following this brief HOWTO: DummyIAP.

Final notes

Even though this setup works fairly well in most cases, it's not perfect. You may experience apt-get or even chroot crashes on the way. On N770 apt-get sometimes (not very often) fails to unpack really big packages. Take into consideration what kind of hardware your particular Internet Tablet is. These devices (especially n770) are not necessarily meant to run bloated software. The resources are still further limited by the fact that Maemo is still running alongside the instance of Debian.

See: http://www.flickr.com/photos/22545234@N07/sets/72157603649694490/

Tagged
icewm
fvwm
fluxbox
wmaker
blackbox
xfce
sid
armel
debian