http://www.denx.de/wiki/PPCEmbedded/RootFilesystem13. Root FilesystemThe kernel needs a root filesystem to mount at startup. There are many options, and the best one will generally depend on whether your system needs to be able to store persistent data (which must survive power cycling) in the field. See http://lists.linuxppc.org/listarcs/linuxppc-embedded/200003/msg00067.html Your best bet is likely to be the root filesystem from
HardHatLinux.
Extract all the RPMs matching 13.1. NFS Mounted
During development, the embedded system can NFS-mount its root
filesystem from
your file sever to provide a complete diskless Linux system. The file
server
need not be the same architecture as the embedded client. Answer "Y" to
the
kernel configuration questions regarding NFS client and root filesystem
via
NFS, and "make zImage". The embedded system will attempt to mount its
root
filesystem from the server as /tftpboot (rw,no_root_squash) If your system has a hard disk, you can start by using NFS then build a root file system on the disk and boot from that. If your system has no network, you may want to start developing on a board that does. 13.2. Initial Ramdisk: initrd
To make a diskless system standalone, you need an initial ramdisk image
containing an ext2 filesystem to put in You need to select both root=/dev/raminstead of root=/dev/nfs
The kernel does various things if root=/dev/ramthis is then mounted as the root filesystem. If your ramdisk is larger than 4 MB, you will need to add ramdisk=xxxxto the kernel command line at boot time, or modify drivers/block/rd.c.
Beware that the CPU6 workarounds in the MontaVista? 2.2.x kernel clobber the kernel command line, and cause the initial ramdisk mount to fail. See the thread at http://lists.linuxppc.org/listarcs/linuxppc-embedded/200004/msg00103.html A number of ways to create an initial ramdisk image are described below. For more information on building a root filesystem, see the Bootdisk HOWTO at http://www.linux.org/docs/ldp/howto/Bootdisk-HOWTO/buildroot.html 13.2.1. Examples
An example A simple ramdisk for use with ppcboot is available at the Denxftpsite. 13.2.2. Using a ramdisk
You can also create your own on your development machine in a
filesystem on
LILO users can do this by adding the following line to the first
section of
ramdisk=65536
There is no real harm in asking for an excessive size, as 13.2.3. Using the loop device
Another approach is to use the loop device on your Linux development
host to
mount the ramdisk image as a local filesystem, and then copy the files
you
require into it. To allow users to mount the mount /mnt/loopdd the following entry to your /etc/fstab:
/path/to/ramdisk.image /mnt/loop auto user,noauto,rw,loop 0 0 Note that the minix file system code in Linux is not endian-independant, so you can't build a minix file system image on an x86 machine and expect to read it on a PowerPC machine. ext2 does not suffer from this problem. For more info, see the Loopback-Root-FS HOWTO at http://linuxdoc.org/HOWTO/mini/Loopback-Root-FS.html 13.3. ROMFS Flash FilesystemSearch for ROMFS. 13.4. cramfs
The 2.4 kernel series has a compressed read-only filesystem (cramfs)
aimed at
embedded systems, which can be back-ported to 2.2 kernels. If you're
cross-
developing, you need to modify It turns out that cramfs is not supported for a root fs or initrd. Basically, the kernel checks a hardcoded list of supported filesystems and if the MAGIC number doesn't match it bails. 13.5. ramfs
ramfs from the 2.4 kernel is a simple filesystem ideal for use in a
ramdisk. It
can be used in combination with a cramfs read-only root filesystem, to
mount
writable filesystems on 13.6. Journaling Flash FileSystem?(JFFS)JFFS allows persistent storage, optimised for flash memories rather than block devices like hard disks. It is aimed at providing a crash/powerdown-safe filesystem for disk-less embedded devices and is a better option than the cramfs/ramfs combination if your application requires persistent storage. You use it with the MTD subsystem. |
