Examples for generating a Debian Live CDs and others.
This page is really intended to be for command line examples of live-helper. This page assumes you have live-helper installed. Many of the basic examples are also in the man pages. As always, please look at the man page to understand more about the listed examples and other options offered.
See also DebianLive/BuildingImages for alternate ways to build images which can be combined with the examples shown below to give you finer control over the build process as needed.
0. Prepare your working directory and become root
Start by creating a working directory where live-helper will create the image file and also the config, cache, chroot and binary directories. Remember to execute lh_build in this working directory as root. If you prefer, use sudo instead of su (e.g. lh_config && sudo lh_build) for all of the following examples.
mkdir debian-live cd debian-live su
1. Basic lh_build examples
The lh_config helper accepts a number of command-line switches to generate a configuration for different kinds of images.
To build a basic image with default settings, run this:
lh_config && lh_build
To generate the a kde desktop image:
lh_config -p kde-desktop && lh_build
To generate a gnome desktop image:
lh_config -p gnome-desktop && lh_build
To generate an xfce desktop image:
lh_config -p xfce-desktop && lh_build
To make live CDs of specific architectures:
lh_config -a i386 && lh_build lh_config -a amd64 && lh_build
To make live CDs of different distributions (default is etch):
lh_config -d lenny && lh_build lh_config -d sid && lh_build
2. More complex lh_config examples
Gnome with audacity:
lh_config -a i386 --categories "main contrib non-free" -p gnome --packages audacity && lh_build
Make a netboot for network booting servers:
lh_config -a i386 -d etch -t net && lh_build
Make a live CD with custom files injected into the image:
- First, create the configuration directory:
lh_config
- Second, copy or symlink all the files from /some/path/to/my_includes/usr/bin to /target/directory/config/chroot_local-includes/some/path/to/my_includes. These files will be automatically copied into the live system.
- Finally, build:
lh_build
Make a live CD with unofficial debian packages installed into the image:
- If you have local debian packages (*.deb) which are not part of a repository, after running lh_config, copy them into config/chroot_local-packages and they will be automatically installed into the live system when you run lh_build.
- If you want to install packages from an unofficial/third-party Debian repository, add the source.list entry into config/chroot_sources/sources.list.bootstrap and config/chroot_sources/sources.list.binary, and specify the packages either with a local package list in config/chroot_local-packageslists or with the --packages parameter. For more information, read the examples in /usr/share/live-helper/examples/sources/.
Make one live CD with some hooks
- If you have all the hacks in one script just copy it to the chroot_local-hooks directory:
lh_config cp script config/chroot_local-hooks lh_build
If you want to chroot and do the hacks, either set LH_INTERACTIVE to enabled, or run:
lh_config lh_bootstrap lh_chroot lh_chroot_hosts install lh_chroot_resolv install lh_chroot_proc install chroot chroot #do the hacks here lh_chroot_hosts remove lh_chroot_resolv remove lh_chroot_proc remove lh_binary
- If you have one good CD but you need to change something:
lh_clean --binary # change what you need in the chroot directory or follow the last note about making some hacks lh_binary
This assumes your bootstrap stage is still intact from previous calls to lh_bootstrap (or lh_build)
