Alexander E. Patrakov patrakov at ums.usu.ru
Wed Apr 20 22:21:02 PDT 2005


on the livecd, in the previous releases, some files and directories were moved 
to /etc (i.e. a writable location) and symlinks were made in their original 
places. However in fact one never truly knows the full list of configuration 
files outside /etc that someone may want to edit. Therefore I propose to take 
an alternative approach: use unionfs (available as a kernel patch) to pretend 
that the CD can be written to. Shell pseudocode for initramfs:

make /dev/cdrom
mount -t isofs -o ro /dev/cdrom /.cdrom
mount -t squashfs -o loop /.cdrom/squashed-rootfs.img /.squashfs
mount -t tmpfs -o mode=755 tmpfs /.tmpfs
mount -t unionfs -o dirs=/.tmpfs=rw:/.cdrom=ro:/.squashfs=ro unionfs /.unionfs
cd /.unionfs
mount --move . /
exec chroot . sbin/init "$@" <dev/console >dev/console 2>dev/console

No need to unpack /etc and /root anymore, they can be made just a part of the 
cdrom itself or of the squashed root image.

This also allows to keep source tarballs on the CD outside the squashed image. 
Thus, the CD will also be usable e.g. from Slackware as just a container for 
LFS sources.

Alexander E. Patrakov

More information about the livecd mailing list