View source for Userspace root image

From Openmoko

Jump to: navigation, search

You do not have permission to edit this page, for the following reasons:

  • The action you have requested is limited to users in the group: Administrators.
  • You must confirm your email address before editing pages. Please set and validate your email address through your user preferences.

You can view and copy the source of this page:

Template used on this page:

Return to Userspace root image.

Personal tools

Creating a root filesystem from scratch

To create a root file system image for storage in NAND flash, we use the mkfs.jffs2 program contained int the Debian package mtd-tools.

mkfs.jffs2 --pad=0x700000 -o rootfs.jffs2 -e 0x4000 -n -d/tmp/jffsroot/

is a typical command. It creates a FS image for our erase block size of 16k, padded to 0x700000 bytes in length from the files contained in the /tmp/jffsroot directory and stores the FS image in rootfs.jffs2.

This image can then be installed on the target device via the u-boot bootloader, e.g.

QT2410 # tftpboot 0x32000000 rootfs.jffs2
QT2410 # nand erase 0x634000 0x39cc000
QT2410 # nand write 0x32000000 0x634000 0x700000

And then booted (in this example with a kernel downloaded via tftp/ethernet) by

QT2410 # setenv  bootargs root=/dev/mtdblock4 rootfstype=jffs2 console=ttySAC0,115200 loglevel=8
QT2410 # tftpboot 0x32000000 kernel.img
QT2410 # bootm 0x32000000