Ok this page is untested. I've just quickly written it up from my notes.
It's all very well to have got this far, but it's a pain to have the router dependant on the host machine. At some stage we want to make it stand alone. That is what this section is about, writing the kernel and filesystem to the flash.
Up to this point, nothing we've done so far has made permanent changes to the router. That's all about to end, this is the point of no return :) (Well actually you can restore the netgear firmware - it's just that I don't describe it.
Build a jffs2 filesystem: (on the host)
$ cd $PROJ_ROOT $ su Password: # mkfs.jffs2 -e 0x20000 -d rootfs -o rootfs.img
Copy the file system image and the kernel into the rootfs so that you can get to it from the router.
# cp rootfs.img rootfs/tmp # cp boot/vmlinux.gz rootfs/tmp
Now on the router do the following:
# cd /tmp # eraseall /dev/mtd3 # cat rootfs.img > /dev/mtd3 # eraseall /dev/mtd2 # dd if=kernel of=/dev/mtd2
Now test it out:
# mkdir /mnt/jffs2 # mount -t jffs2 /dev/mtdblock3 /mnt/jffs2 # ls /mnt/jffs2 bin dev etc include lib linuxrc mnt opt proc root sbin tmp usr var
Next: Dropbear