Install Kubuntu Mobile on the N900
Tech Preview of Kubuntu Mobile
Some time ago I wrote a post about a project we were working on called Ubuntu Liquid. Well since then a lot has happened.The Bossa Conference came to Manaus with a great plasma mobile talk, the project changed its name to Kubuntu Mobile, the awesome KDE and Kubuntu communities became involved and we managed to finally get a Technology Preview release out of the door for Ubuntu Maverick!.
I remember promising some instructions on how to install the release onto a device. There are already some canonical instructions available on the Kubuntu wiki to get started so I will updated this with the things I discovered as I was playing around with this install.
The N900 has a Texas Instruments OMAP3 microprocessor with an ARM Cortex-A8 core. Unlike all of the Nokia models which preceded it - 770, N800 and N810 - the N900 has full phone functionality (quad-band GSM and 3G UMTS/HSDPA). It is quite interesting therefore to get Ubuntu running on it. Be aware though that Kubuntu Mobile is *not* yet ready to replace Maemo on an N900. Unless of course you really know what you are doing or even better you really know what you are doing and want to help out - either upstream or with the actual distro itself. Our current target is to have Kubuntu Mobile fully working on the N900 in time for the 11.04 Natty release.
- An N900 with Maemo5 pr1.3 installed
- A MicroSD 8GB, at least, class 6 or better - a lesser class will run but then Kubuntu Mobile runs very slowly.
ian@lawrence:/media/80GB$ mkdir Liquid;cd Liquid ian@lawrence:/media/80GB/Liquid$ wget -c http://cdimage.ubuntu.com/kubuntu-mobile/ports/daily-preinstalled/current/maverick-preinstalled-mobile-armel+omap.img.gzThe above link is not working, it seems the image is not building on cdimage - whilst we debug what is happening please try this one
Partition the MicroSD card. I used gparted (apt-get install gparted). The three partitions on the card are
- An ext3 partition (using the most part of the MicroSD)
- A linux swap partition
- A small VFAT partition
ian@lawrence:/media/80GB/Liquid$ gunzip maverick-preinstalled-mobile-armel+omap.img.gz ian@lawrence:/media/80GB/Liquid$ sudo dd bs=4096 if=maverick-preinstalled-mobile-armel+omap.raw of=/dev/sdd1then check that everything is ok.
root@lawrence:/media/80GB/Liquid# sudo fsck.ext3 -cy /dev/sdd1 e2fsck 1.41.12 (17-May-2010) Checking for bad blocks (read-only test): 14.18% done, 0:15 elapsedI did this check twice (just to make sure). Now mount the MicroSD card (just unplug it).Install qemu-arm-static if it is not already on your machine and then copy it from the system /usr/bin to the partition /usr/bin
ian@lawrence:/media/80GB/Liquid$ sudo apt-get install qemu-arm-static ian@lawrence:/media/80GB/Liquid$ sudo cp /usr/bin/qemu-arm-static /media/a6c5c4e9-555c-4565-ba1d-ceea8d5a953f/usr/bin/Make sure that any data buffered in memory is written out
ian@lawrence:/media/80GB/Liquid$ syncDownload the latest meego image
ian@lawrence:/media/80GB/Liquid$ wget -c http://repo.meego.com/MeeGo/builds/trunk/220.127.116.11.20101221.1/handset/images/meego-handset-armv7l-n900/meego-handset-armv7l-n900-18.104.22.168.20101221.1-mmcblk0p.raw.bz2unzip the raw image
ian@lawrence:/media/80GB/Liquid$ bzip2 -d meego-handset-armv7l-n900-22.214.171.124.20101221.1-mmcblk0p.raw.bz2next run fdisk (notice the three partitions in this image)
ian@lawrence:/media/80GB/Liquid$ sudo fdisk -l -u meego-handset-armv7l-n900-126.96.36.199.20101221.1-mmcblk0p.raw meego-handset-armv7l-n900-188.8.131.52.20101221.1-mmcblk0p.raw1 1 3515625 1757812+ 83 Linux Partition 1 has different physical/logical endings: phys=(1023, 3, 32) logical=(27465, 3, 10) meego-handset-armv7l-n900-184.108.40.206.20101221.1-mmcblk0p.raw2 3516416 3891199 187392 83 Linux Partition 2 has different physical/logical beginnings (non-Linux?): phys=(1023, 3, 32) logical=(27472, 0, 1) Partition 2 has different physical/logical endings: phys=(1023, 3, 32) logical=(30399, 3, 32) meego-handset-armv7l-n900-220.127.116.11.20101221.1-mmcblk0p.raw3 3891200 4016127 62464 83 Linux Partition 3 has different physical/logical beginnings (non-Linux?): phys=(1023, 3, 32) logical=(30400, 0, 1) Partition 3 has different physical/logical endings: phys=(1023, 3, 32) logical=(31375, 3, 32)now mount the image
ian@lawrence:/media/80GB/Liquid$ sudo mount -o loop,offset=512 -t auto meego-handset-armv7l-n900-18.104.22.168.20101221.1-mmcblk0p.raw /mnt/copy the kernel modules and firmware to the first partition of the MicroSD card
ian@lawrence:/media/80GB/Liquid$ sudo cp -a /mnt/lib/modules/22.214.171.124-13.10-n900/ /media/a6c5c4e9-555c-4565-ba1d-ceea8d5a953f/lib/modules/ -a ian@lawrence:/media/80GB/Liquid$ sudo cp /mnt/lib/firmware/* /media/a6c5c4e9-555c-4565-ba1d-ceea8d5a953f/lib/firmware/now we need to mount the third partition of the .raw meego image (which contains the bootable kernel - vmlinuz) and copy that to the vfat partition of the MicroSD card. To do this we need to work out where the third partition starts. The end of the second partition is
meego-handset-armv7l-n900-126.96.36.199.20101221.1-mmcblk0p.raw2 3516416 3891199 187392 83 Linuxso we need to multiply 3891199 by 512 to find the offset
3891199*512=1992294400make a temporary mount point then
ian@lawrence:/media/80GB/Liquid$ sudo mkdir /media/teste1 ian@lawrence:/media/80GB/Liquid$ sudo mount -o loop,offset=1992294400 -t auto meego-handset-armv7l-n900-188.8.131.52.20101221.1-mmcblk0p.raw /media/teste1/ ian@lawrence:/media/80GB/Liquid$ cp /media/teste1/* /media/B68E-53ABrun sync
ian@lawrence:/media/80GB/Liquid$ syncand then unmount
ian@lawrence:/media/80GB/Liquid$ sudo umount /mnt ian@lawrence:/media/80GB/Liquid$ sudo umount /media/teste1Enter the chroot on the partition
ian@lawrence:/media/80GB/Liquid$ sudo chroot /media/a6c5c4e9-555c-4565-ba1d-ceea8d5a953f/ root@lawrence:/#Make sure that the chroot can get a network
root@lawrence:/# echo "nameserver 184.108.40.206" >> /etc/resolv.confexit the chroot
root@lawrence:/home# exitCheck out some meego configurations from the git repositories. These are needed for the essential-kubuntu-mobile.sh script below
ian@lawrence:/media/80GB/Liquid$ mkdir meego;cd meego ian@lawrence:/media/80GB/Liquid/meego$ git clone git://gitorious.org/meego-device-adaptation/n900_nokia-n900-configs.git ian@lawrence:/media/80GB/Liquid/meego$ git clone git://gitorious.org/meego-device-adaptation/n900_udev-rules-nokia-n900.git ian@lawrence:/media/80GB/Liquid/meego$ cd ..We have a script to make the next part of the Kubuntu Mobile install easier - I put it on my server for convenience
ian@lawrence:/media/80GB/Liquid$ wget -c http://ianlawrence.info/downloads/liquid/essential-kubuntu-mobile.shand make it executable
ian@lawrence:/media/80GB/Liquid$ chmod +x essential-kubuntu-mobile.shchange the variables in the script
MPATH="/media/a6c5c4e9-555c-4565-ba1d-ceea8d5a953f" GITPATH="/media/80GB/Liquid/meego/"to the correct ones for your install. Also change the user name ian
chroot $MPATH adduser ianfor something you will remember.Next run the script.
ian@lawrence:/media/80GB/Liquid$ sudo ./essential-kubuntu-mobile.shand answer the questions for the new user. That is everything completed on the MicroSD card and we can now try to boot it!.
First check that the software on the N900 is the correct version (pr1.3) on the device going to Settings -> About product. The version number should read 20.2010.36-2.002. Next check that Extras-devel is enabled in the Application Manager.
- Navigate to the application menu (tap the title bar)
- Select ‘Application catalogs’
- Enter a catalog name of ‘Maemo extras-devel’
- Enter a web address of http://repository.maemo.org/extras-devel
- Enter a distribution of ‘fremantle’
- Enter components of ‘free non-free’
- Select ‘Save’
~ $ sudo gainrootwhich gives a root shell on the device. Then install uboot-pr13 using apt
/home/user # apt-get install uboot-pr13uboot-pr13 installs u-boot to the kernel area, along with PR1.3 kernel and it means we can dual boot a device. Verify it's installed by restarting your N900. A penguin should show up at startup and U-boot will be mentioned, let it time out and boot into Maemo. Now take the MicroSD card we prepared and put it into the N900 and reboot. It takes a long time to boot but the end result is worth it
not because it really works too well yet but because of what it might be one day.
If you want to help #kubuntu-mobile on irc.freenode.net.