Latest OpenWrt development SVN trunk supports booting on the Nokia n810 handheld internet tablet. It is possible to install OpenWrt on the device without removing Maemo. So it is supported to boot the original Maemo operating system via kexec from OpenWrt. For this to work, the device's kernel-MTD-partition is overwritten with the OpenWrt kernel. However, the original initfs and rootfs partitions are left intact. The OpenWrt rootfs is installed to MMC/SD card. The OpenWrt rootfs does contain (if configured so) the original Maemo kernel image (as file). It's a simple matter of kexec-ing that kernel image to boot into the original Maemo operating system. This is done with the "bootmaemo" command.
So you do not lose any functionality by installing OpenWrt.
Compiling OpenWrt for n810
First download latest OpenWrt trunk. Do this with the following commands:
svn co svn://svn.openwrt.org/openwrt/trunk/ openwrt-trunk cd openwrt-trunk
You are now inside the OpenWrt buildsystem. We install the "feeds" now. Create a feeds.conf file with the following content:
src-svn packages svn://svn.openwrt.org/openwrt/packages src-svn phone svn://svn.openwrt.org/openwrt/feeds/phone src-svn xorg svn://svn.openwrt.org/openwrt/feeds/xorg src-svn desktop svn://svn.openwrt.org/openwrt/feeds/desktop src-svn lxde svn://svn.openwrt.org/openwrt/feeds/lxde
Download and install the feeds with these commands:
./scripts/feeds update -a ./scripts/feeds install -a
Start the source tree configuration with the follwoing command:
make menuconfig
Mandatory configure options are:
- As Target System select TI OMAP-24xx
- As Target Profile select Nokia n810 (GUI)
- Under Package features submenu select Drawing Backend (libX11)
For kexec-ing (booting) into Maemo Diablo, the config option Utilities / maemo-kexec has to be selected. You must have Maemo 2008.43-7 installed on the n810 rootfs. This is the latest available release for the n810.
Exit menuconfig by hitting the Exit button (probably several times, depending on which submenu you are in). When asked to save the configuration, select Yes.
To compile the distribution, simply run:
make V=99
Installing OpenWrt on the n810 [MMC card]
To install the OpenWrt kernel on the n810 and the OpenWrt rootfs on an MMC card, follow these steps.
To install the kernel, the 0xFFFF utility is required (Yep, funny name). Turn the n810 device off now. Inside the openwrt-trunk directory, execute the following command to flash the OpenWrt kernel to the device:
0xFFFF -p kernel%./bin/omap24xx/openwrt-omap24xx-zImage -R
Turn the n810 device on now. 0xFFFF will flash the kernel and immediately reboot the n810 into the new kernel after it finished. The OpenWrt kernel will start booting. However, it will fail to find a rootfs, because we didn't write it to an MMC card, yet.
To write the rootfs to an MMC card, take a mini-MMC card (one that fits into the n810 card slot) and create a primary DOS partition on it (use cfdisk, perhaps), if there is not already one. Now create an ext4 fs on the partition:
mke2fs -t ext4 /dev/sdX1 tune2fs -c0 -i0 /dev/sdX1
Where sdX1 is the device node of your SD card reader (first partition on the SD card).
Mount the filesystem and extract the OpenWrt rootfs tarball into it. Run the following commands as root:
mkdir mountpoint mount /dev/sdX1 ./mountpoint tar -xzf ./bin/omap24xx/openwrt-omap24xx-rootfs.tar.gz -C ./mountpoint umount ./mountpoint
Now insert the MMC card into the n810 and fire it up. It should boot into OpenWrt with graphical user interface. :)
Usage
Special tools, which should already be installed if you used the profiles as suggested, are the pwrtray-backend and pwrtray applications. The backend should start automatically through init scripts already. It controls the power management of the device (backlight, touchscreen, battery, etc...). The pwrtray application is a frontend to that which lets you configure LCD behavior and monitor battery state. It is a tray application which (once explicitly started) shows up in the X panel's tray area. You may want to add that application to the X or window manager startup scripts to start automatically.