HowToCreateYourOwnRootfs

  1. How to create your own rootfs for the Nokia devices
    1. Booting From Main Flash Memory
    2. Booting from MMC
      1. Partitioning your MMC card
      2. Mounting your rootfs.jffs2 image
      3. Copying your rootfs to MMC card
      4. Installing a dual boot menu

How to create your own rootfs for the Nokia devices

This tutorial doesn't tell you how to create your own linux distribution, but how to create a rootfs bootable image given a rootfs directory. This directory must contain a linux distribution with all tools and applications, except kernel. If you don't have a directory like this yet, consider to read modifying root image or download and use Mamona's rootfs image: http://dev.openbossa.org/mamona/0.1/n800/rootfs.jffs2

There are two ways of booting this rootfs in your N800/N810:

  • From Main Flash Memory
  • From MMC

Booting From Main Flash Memory

Requirements:

If you have a rootfs directory the first thing that you need to do is to generate your rootfs.jffs2 image using the following command:

export ROOTFS=$HOME/myRootImage # or wherever your rootfs is located
sudo mkfs.jffs2 -r $ROOTFS -o rootfs.jffs2 -e 128KiB -l -n

Now flash it:

$FLASHDIR/flasher -r rootfs.jffs2 -f

If you need a different kernel for this rootfs consider to flash it using:

$FLASHDIR/flasher -k zImage -f

Booting from MMC

It is possible to have a dual boot in your N800/N810 and boot this rootfs from MMC without overwriting your Nokia IT0S2007.

Partitioning your MMC card

Create 2 partitions and mount the second one on /media/mmc2 as described on How to easily partition your MMC card

Note that N800 requires loading mbcache.ko before ext2.ko.

Mounting your rootfs.jffs2 image

If you are using a prebuilt jffs2 image and don't have the rootfs directory yet you need to mount it.

cd /tmp
mkdir rootfs
sudo mknod rootfs.loop b 7 0
sudo mknod rootfs.mtd b 31 0
sudo losetup rootfs.loop rootfs.jffs2
sudo modprobe mtd
sudo modprobe mtd_blkdevs
sudo modprobe mtdblock
sudo modprobe block2mtd block2mtd=rootfs.loop,131072
sudo modprobe jffs2
sudo mount -t jffs2 rootfs.mtd rootfs
export ROOTFS=/tmp/rootfs

Copying your rootfs to MMC card

Compact your rootfs directory:

cd $ROOTFS
sudo tar cf ../rootfs.tar.gz *

Copy this rootfs.tar.gz to your device. Use http, scp, ftp or whatever you want.

Into the device, extract the rootfs content to /media/mmc2 that should be mounted after follow the How to easily partition your MMC card correctly.

tar xvf rootfs.tar.gz

Installing a dual boot menu

Follow "How to install a dual boot menu?" section on How to easily boot from MMC card