Building Bootable CDsROCK Linux 1.7 has completely rewritten install disks. The new install-disks are their own target in the build configuration (called bootdisks). So if you want to build a "normal" Linux distribution with bootable CDs and install-disks, you need to create and build two configurations:
-
Build the "main" distribution:
./scripts/Config -cfg system
./scripts/Build-Target -cfg system
-
Build the install system:
./scripts/Config -cfg installer
./scripts/Build-Target -cfg installer |
|
|
- Create an ISO-Image with both sub-systems:
./scripts/Create-ISO myiso system installer
This will create myiso_*.iso files which can be burned onto a CD as they are. The first CD is bootable and also contains the disk-images for booting from floppy disks. This is the bootdisks target. The "real" system can be any other target - as long as this other target doesn't try to create it's own eltorito (boot from CD) image (which would result in an error message when running ./scripts/Create-ISO.
How does it look like for the userAfter booting the kernel, the system mounts the 1st stage filesystem - a small linuxrc system for loading kernel modules and loading the 2nd stage filesystem into memory:
The linuxrc main menu
Loading modules (it's possible to pass module parameters)
Loading the 2nd stage filesystem
The 2nd stage filesystem is less than 20 MB and contains everything which could be usefull for installing ROCK Linux or repairing a system (more than 400 programms - a feature complete small linux distribution in RAM).
How does it work technicallyThe kernel loads an initrd (ext2) filesystem image into memory while booting and uses it as a root filesystem. This initrd image contains various networking and scsi kernel modules as well as the programs gzip, tar, insmod and a linuxrc program binary. They are all built statically using dietlibc - so no glibc is needed on the initrd filesystem.
The linuxrc binary is running the menus shown in the screenshots above. The user may load kernel modules directly from the initrd or from any additional floppy-disks or CDs as well as load the 2nd stage filesystem.
The 2nd stage filesystem is stored as a tar.gz file on the CD. The linuxrc binary is mounting a tmpfs (memory filesystem) on /mnt_root and extracts the 2nd stage filesystem there. Than it creates a /mnt_root/oldroot directory and executes the system call:
- pivot_root("/mnt_root", "/mnt_root/old_root")
This makes the filesystem mounted on /mnt_root the new root filesystem. The original root filesystem will be re-mounted on /mnt_root/old_root (which is just /old_root afterwards).
Then the /linuxrc program from the new root filesystem (the 2nd stage filesystem) is executed. It mounts /dev and /proc and umounts /old_root. Now we are running a small linux distribution entirely in a tmpfs which is (unlike a ram disk) growing and shrinking on demand.
The solution for systems with low memoryFor most systems it's no problem to have 20 MB of memory used up by the 2nd stage filesystem. Todays PCs do have at least 64 MB of memory, 256 MB up to 1 GB are very common values - so there is still by far enough memory available for doing the actual installation.
But if you still have a system with 32 MB (or even less) memory, loading a 20 MB 2nd stage filesystem is not an option. Also, the .tar.gz of this 20 MB 2nd stage filesystem is still more than 7 MB big - too big for a floppy disk. That's why we also have a small 2nd stage filesystem, for older systems or systems without a CD-ROM drive.
|