2007-05-24

Mandriva Live CD

I figure I may as well put something here.

One of my current projects is a "live CD" based on Mandriva Linux, with scripts that automatically install Mandriva Linux on the machine where it's running, and/or configure certain aspects of the system after the OS is installed. This is for a client who will be deploying potentially hundreds of these systems. The fun part is that the kernel on the Mandriva "2007 Spring" install DVD doesn't support the PATA controller on the motherboard of the systems they're using, so I've had to build a newer 2.6.20 kernel from scratch, which includes the "pata_marvell" module, as well as some patches to implement POSIX AIO in the Linux kernel.

I have the "live CD" part working, after tearing apart an existing Mandriva Live distribution called MCNLive and the mklivecd script upon which it's based. I had to do quite a bit of patching to make it work on the x86_64 platform, because what most systems use "/lib", it uses "/lib64"- which means that the libc.so.6 and ld-linux.so.2 files have to be replaced with their 64-bit equivalents, and where the "linuxrc" script creates a symlink for "/lib", it also needs to create one for "/lib64".

Now it's just a case of writing the scripts to find, partition, and format the drives, uncompress an image from the boot CD into the new empty partition(s), then run "grub-install" to set up the boot loader on the target system. I also want to separate out the changes that MCNLive made in order to make it boot from a USB stick (it does boot the kernel, but the "linuxrc" script only searches CD-ROM drives to find the compressed filesystem image) and to make it copy the compressed image into RAM so the CD-ROM drive can be used within the running live environment, as well as my own changes (to MCNLive before looking at "mklivecd" itself) to support the idea of specifying the name of the compressed filesystem image on the kernel command line (so the same kernel/initrd can be used to boot multiple live systems, by making multiple "squishfs" images.)

Once it's finished, I plan to write a web page which details the whole thing, including something which is currently not there- a real walk-through, starting from "I just installed Mandriva on the hard disk, now what?" If you've seen any of my pages relating to qmail, you'll know the kind of page I have in mind.

Funfunfun...

No comments: