How to Build and Install Custom N900 Kernel on Ubuntu Desktop 8.04
Setup ARM Build Environment
- mkdir emdebian_fs
- sudo debootstrap sid ./emdebian_fs http://ftp.fr.debian.org/debian
- sudo chroot ./emdebian_fs /bin/bash
- aptitude install emdebian-archive-keyring
- vi /etc/apt/sources.list and add “deb http://www.emdebian.org/debian/ lenny main”
- aptitude update && aptitude dist-upgrade && aptitude install emdebian-tools
- aptitude install binutils-arm-linux-gnueabi cpp-4.3-arm-linux-gnueabi gcc-4.3-arm-linux-gnueabi gcc-4.3-arm-linux-gnueabi-base gcc-4.3-base-armel-cross libc6-armel-cross libc6-dev-armel-cross libgcc1-armel-cross linux-libc-dev-armel-cross
Build N900 Kernel
- wget http://repository.maemo.org/pool/fremantle/free/k/kernel/kernel_2.6.28-20094803.3+0m5.diff.gz
- wget http://repository.maemo.org/pool/fremantle/free/k/kernel/kernel_2.6.28-20094803.3+0m5.dsc
- wget http://repository.maemo.org/pool/fremantle/free/k/kernel/kernel_2.6.28.orig.tar.gz
- dpkg-source -x kernel_2.6.28-20094803.3+0m5.dsc
- wget -q http://natisbad.org/N900/n900-2.6.28.10-20094803.patch
- wget -q http://natisbad.org/N900/n900-2.6.28.10-20094803.patch.sign
- cd kernel-2.6.28
- patch -p1 -i ../n900-2.6.28.10-20094803.patch
- CROSS_COMPILE=arm-linux-gnueabi- make rx51_defconfig
- aptitude install libncurses5-dev
- CROSS_COMPILE=arm-linux-gnueabi- make menuconfig (configure MobileIP/NEMO settings)
- CROSS_COMPILE=arm-linux-gnueabi- make
Install the Kernel
- mkdir ../modules
- find . -name ‘*.ko’ -exec cp ‘{}’ ../modules/ \;
- ssh root@n900 mkdir /lib/modules/2.6.28.10-omap1
- scp ../modules/*.ko root@n900:/lib/modules/2.6.28.10-omap1
- ssh root@n900 depmod 2.6.28.10-omap1
- sudo flasher-3.5 -k arch/arm/boot/zImage -f -R
Gaining root on N900
- Install “gainroot.sh” fro application store
- To install ssh server, see References
Setting Maemo device to flashing mode
Before flashing a Maemo device with a FIASCO image, it is recommended to
firstly set the Maemo device into flashing mode. When you attempt to flash the
device, it tries to enable flashing mode on the fly, in which case setting the
device to flashing mode explicitly is not required, but there have been reports
that with some clients this does not work.
For Nokia N900 with a Fremantle image, flashing mode can be enabled by following these steps:
1. Switch off the Maemo device
2. Press and hold down the ‘u’ key
3. Connect a USB cable between the Maemo device and host PC while holding down the ‘u’ key
4. When the USB cable is connected, it powers the Maemo device and sets it to flashing mode
5. When the USB icon appears in the upper right-hand corner, the Maemo device is in flashing mode
6. Release the ‘u’ key
If performed correctly, the USB image is visible in the upper right-hand corner of the screen.
The Maemo device waits indefinitely for Flasher-3.5 input when it is in flashing mode. If flashing is tried without first setting the Maemo device to flashing mode, image flashing may fail because the Maemo device may not be able to change to the flashing mode automatically.
References
http://natisbad.org/N900/n900-custom-kernel.html
http://www.emdebian.org/packages/keys.html
N900 Kernel sources: http://repository.maemo.org/pool/fremantle/free/k/kernel/
http://www.nautilus6.org/doc/nepl-howto/nepl-howto.html
http://scratching.psybermonkey.net/2010/06/n900-how-to-ssh-into-n900-using-openssh.html
http://wiki.maemo.org/Documentation/Maemo_5_Developer_Guide/Development_Environment/Maemo_Flasher-3.5