|
| InitRD Config Requirements & Howto Examples |
|
| Creating a RootFS |
|
| InitRD |
- initrd.gz is NOT required to boot if the kernel has everything it needs
- if you do use initrd.gz, make sure /initrd exists on the final root disk
- initrd.gz is required for modules/drivers that are NOT built into the kernel
- use initrd to preload the nic drivers not in the kernel
- use initrd to preload the scsi disk drivers not in the kernel
- use initrd to preload the raid drivers not in the kernel
- use initrd to preload the cdrom drivers, SVGA drivers, IDE drivers
- use the initrd as a rescue disk, since it does NOT care about "/" yet
- initrd.gz are used/referenced from:
- initrd.gz are created many different ways
- you have to add your own modules into the initrd tree to support the kernel you're booting
|
| Creating RamDisks and Viewing initrd |
|
| man initrd |
- InitRD Bootup Operation
- /dev/initrd is read-only device
1. lilo/grub: loads initrd.gz into /dev/initrd
2. kernel: gzip -d initrd.gz > /dev/ram0 and free /dev/initrd
3. kernel: mount -o rw /dev/ram0 / ^ initial root filesystem
4. huh ?? - how does it know
5. if /linuxrc exists, it is executed uid=0
- /linuxrc can be any executable including bash
6. when /linuxrc finishes or is missing, the normal rootFS is mounted
- /linuxrc should unmount everything before exiting
- normal rootFS is from /etc/fstab ??
7. if [ finalrootFS has /initrd ]
- kernel will mv /dev/ram0 /initrd
- all processes ( eg /proc ) can remain running
    else
- attempt to unmount /dev/ram0
- whacky things can happen ( see NOTES in man page )
- /proc is not updated
- /dev/ram0 will be stuck in memory if any process is using /dev/ram0
8. normal /sbin/init
- for changing rootFS in /linuxrc
- mount /proc
- # for booting into /dev/hda1
- echo 0x301 > /proc/sys/kernel/real-root-dev
- # for NFS booting
- define /proc/sys/kernel/nfs-root-name
- define /proc/sys/kernel/nfs-root-addrs
- echo 0xFF > /proc/sys/kernel/real-root-dev
|