From Fedora Project Wiki
#!html
<font size="+1">

Fedora Live CD Tools

#!html
</font>

Source: The README by David Zeuthen <davidz AT redhat.com> Last updated: Dec 22 2006 (v0.1)

This project concerns tools to generate live CDs on Fedora-based systems including derived distributions such as RHEL, CentOS and others. See the project Wiki at FedoraLiveCD for more details. Discussion of this project takes place at the Fedora Live CD mailing list .

LIVE CD DESIGN GOALS

The live CD is designed in such a way that, when running from a live CD, the system should appear as much as possible as a standard system with all that entails; e.g., read-write rootfs (achieved using dm-snapshot), 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.

Fedora Live CD currently does not support installation to hard disk.
The ability to install Fedora Linux from a Live CD is under development and should soon be available for testing and implementation.

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 livecd-creator tool is used. Superuser privileges are needed. The tool is more or less self-documenting: use the --help option to see options.

1. HOW THE LIVE CD CREATOR WORKS

In a nutshell, the livecd-creator 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 yum, 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.

Barebones Live CD does not support login capability.
Since no configuration is done, the user will not be able to login to the system as the root password is not set.

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

fedora-livecd the base livecd system
fedora-livecd-gnome a stock GNOME desktop; suitable for basing other more targeted live CDs on such as flavors for Eclipse, Music and so forth
fedora-livecd-desktop complete desktop with applications and input/output support for all supported locales in Fedora

See the RPMs for details on what configuration they perform.

RPMs for making Live CDs are now available.
RPMs are currently available from this link , but will be proposed for inclusion in Fedora Linux.

4. EXAMPLE: SPINNING THE FEDORA DESKTOP LIVE CD

Assuming that

  • /home/davidz/Fedora/os contains a yum repository for the FC6 release
  • /home/davidz/Fedora/i386 contains a yum repository for the FC6 updates
  • /home/davidz/Hacking/livecd_rpms contains a yum 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 --fs-label 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)

livecd-installer-tui

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.

REFERENCES

Original README by David Zeuthen

Linux.com Article on Fedora Live CD