JohnBabich/Sandbox/LiveCDHowTo

 = Fedora Live CD Tools = Source: The README by David Zeuthen  Last updated: Dec 22 2006 (v0.1)
 * 1) !html
 * 1) !html

This project concerns tools to generate live CDs on Fedora-based systems including derived distributions such as RHEL, Cent ), standard ext3 file system (for extended attributes), and so on.

Another design goal is that the live CD should be "installable", i.e., an user should be able to install the bits from the live CD onto his hard disk without this process requiring network access or additional media.

Finally, other design goals are that
 * the tool set itself should be separate from configuration
 * the same unmodified tool should be usable for building various live CD flavors with vastly different configurations, e.g. a GNOME live CD, a KDE live CD, a live CD with music programs, and so on.

CREATING A LIVE CD
To create a live CD, the  tool is used. Superuser privileges are needed. The tool is more or less self-documenting: use the  option to see options.

1. HOW THE LIVE CD CREATOR WORKS
In a nutshell, the  program


 * Sets up a file for the ext3 file system that will contain all the data comprising the live CD


 * Loopback mounts that file into the file system so there is an installation root


 * Bind mounts certain kernel file systems (/dev, /dev/pts, /proc, /sys, /selinux) inside the installation root


 * Installs, using, the requested packages into the installation using the given repositories


 * Looks at live CD configuration files dropped in the directory /etc/livecd/ inside the installation root


 * Optionally installs more packages as specified by the live CD configuration files in /etc/livecd/ inside the installation root


 * Optionally runs scripts as specified by the live CD configuration files in /etc/livecd/ inside the installation root


 * Relabels the entire installation root (for SELinux)


 * Creates a live CD specific initramfs that matches the installed kernel


 * Unmounts the kernel file systems mounted inside the installation root


 * Unmounts the installation root


 * Creates a squashfs file system containing only the ext3 file (compression)


 * Configures the boot loader


 * Creates an iso9660 bootable CD

2. EXAMPLE: A BAREBONES LIVE CD
The command

livecd-creator \ --repo=c6,http://download.fedora.redhat.com/pub/fedora/linux/core/6/i386/os \ --package=bash --package=kernel --package=grub

will create a live CD that will boot to a login prompt.

3. LIVE CD CONFIGURATION FILES
These are files that packages to be included on the live CD can install in /etc/livecd. They need to be bash scripts and are used to both specify additional packages to install as well as what system configuration (such as enabling NetworkManager by default) to do at build time. The live CD configurations in /etc/livecd/ are processed in alphabetical order (using the C local).

The rationale behind moving the package manifest plus system configuration into live CD configuration files is that maintainers of a certain live CD flavor (say "Acme Music Live CD") can keep all the relevant bits in an RPM (say "acme-livecd-music") and use the existing SCM mechanism to manage it.

For the Fedora project, there are current three different live CD RPMs that contain live CD configuration files; they are

See the RPMs for details on what configuration they perform.

4. EXAMPLE: SPINNING THE FEDORA DESKTOP LIVE CD
Assuming that


 * /home/davidz/Fedora/os contains a  repository for the FC6 release
 * /home/davidz/Fedora/i386 contains a  repository for the FC6 updates
 * /home/davidz/Hacking/livecd_rpms contains a  repository for the    fedora-livecd-* RPMs

then the following command

livecd-creator \ --repo=c6,file:///home/davidz/Fedora/os \ --repo=c6_upd,file:///home/davidz/Fedora/i386 \ --repo=lcd6,file:///home/davidz/Hacking/livecd_rpms \ --repo=e6,http://download.fedora.redhat.com/pub/fedora/linux/extras/6/i386 \ --package=fedora-livecd-desktop \ --fslabel=Fedora-6-Zod-LiveCD-1-foo

will create a live CD called "Fedora-6-Zod-LiveCD-1-foo". The name given by  is used


 * as a file system label on the ext3 and iso960 file systems (as such it's visible on the desktop as the CD name)
 * in the GRUB boot loader

If you don't have the repositories available locally and don't mind waiting for the download of packages, the command is

livecd-creator \ --repo=c6,http://download.fedora.redhat.com/pub/fedora/linux/core/6/i386/os/ \ --repo=c6_upd,http://download.fedora.redhat.com/pub/fedora/linux/core/updates/6/i386/ \ --repo=lcd6,http://people.redhat.com/davidz/livecd/i386/ \ --repo=e6,http://download.fedora.redhat.com/pub/fedora/linux/extras/6/i386/ \ --package=fedora-livecd-desktop \ --fslabel=Fedora-6-Zod-LiveCD-1-foo2

and this should work on any Fedora Core 6 system.

LIVE CD INSTALLS
Currently, there is only a textual live CD installer. Be aware that to use it first you have to disable SELinux's enforcing mode. From a root terminal (open a terminal and type 'su -') on the live CD do

setenforce 0 service livecd-install-daemon start

Then disable automounting; go into System > Preferences > Removable Drives and Media and unclick all check boxes under the tab Storage, heading Removable Storage. Now open a terminal and run (not as root)

and answer the questions. At any time you can hit [Ctrl+C]  to cancel the installation. See the TODO file for planned work to make this easier.