Specifications
/dev/hda b 640 0 0 3 1 1 1 16
/dev/kmem c 640 0 0 1 2 - - -
/dev/mem c 640 0 0 1 1 - - -
/dev/mtd c 640 0 0 90 0 0 2 16
/dev/mtdblock b 640 0 0 31 0 0 1 16
/dev/mtdr c 640 0 0 90 1 0 2 16
/dev/nftla b 640 0 0 93 0 - - -
/dev/nftla b 640 0 0 93 1 1 1 8
/dev/nftlb b 640 0 0 93 16 - - -
/dev/nftlb b 640 0 0 93 17 1 1 8
/dev/null c 640 0 0 1 3 - - -
/dev/ptyp c 640 0 0 2 0 0 1 10
/dev/ptypa c 640 0 0 2 10 - - -
/dev/ptypb c 640 0 0 2 11 - - -
/dev/ptypc c 640 0 0 2 12 - - -
/dev/ptypd c 640 0 0 2 13 - - -
/dev/ptype c 640 0 0 2 14 - - -
/dev/ptypf c 640 0 0 2 15 - - -
/dev/ram b 640 0 0 1 0 0 1 2
/dev/ram b 640 0 0 1 1 - - -
/dev/rtc c 640 0 0 10 135 - - -
/dev/tty c 640 0 0 4 0 0 1 4
/dev/tty c 640 0 0 5 0 - - -
/dev/ttyS c 640 0 0 4 64 0 1 8
/dev/ttyp c 640 0 0 3 0 0 1 10
/dev/ttypa c 640 0 0 3 10 - - -
/dev/ttypb c 640 0 0 3 11 - - -
/dev/ttypc c 640 0 0 3 12 - - -
/dev/ttypd c 640 0 0 3 13 - - -
/dev/ttype c 640 0 0 3 14 - - -
/dev/ttypf c 640 0 0 3 15 - - -
/dev/zero c 640 0 0 1 5 - - -
A description of the format of this table is part of the manual page for the genext2fs tool,
genext2fs(8).
We can now create an ext2 file system image using the genext2fs tool:
$ ROOTFS_DIR=rootfs # directory with root file system content
$ ROOTFS_SIZE=3700 # size of file system image
$ ROOTFS_FREE=100 # free space wanted
$ ROOTFS_INODES=380 # number of inodes
$ ROOTFS_DEVICES=rootfs_devices.tab # device description file
$ ROOTFS_IMAGE=ramdisk.img # generated file system image
$ genext2fs -U \
-d ${ROOTFS_DIR} \
-D ${ROOTFS_DEVICES} \
-b ${ROOTFS_SIZE} \
-r ${ROOTFS_FREE} \
-i ${ROOTFS_INODES} \
${ROOTFS_IMAGE}
3.
Compress the file system image:
$ gzip -v9 ramdisk.img
rootfs.img: 55.6% -- replaced with ramdisk.img.gz
4.
Create an U-Boot image file from it:
$ mkimage -T ramdisk -C gzip -n 'Test Ramdisk Image' \
> -d ramdisk.img.gz uRamdisk
Image Name: Test Ramdisk Image
Created: Sun Jun 12 16:58:06 2005
Image Type: PowerPC Linux RAMDisk Image (gzip compressed)
Data Size: 1618547 Bytes = 1580.61 kB = 1.54 MB
Load Address: 0x00000000
Entry Point: 0x00000000
5.
9.5.1. Root File System on a Ramdisk 113