Ubuntu Customization Kit

Documentation for building script

Introduction

Live CD building script (./scripts/remaster-live-cd.sh) is used to build live CD image automatically.
It provides means to customize live CD image in many ways:

Invocation

Building script should be invoked in such way:
./scripts/remaster-live-cd.sh path-to-iso-file.iso customization-dir/

Parameters:

Customization directory

Customization directory can contain the following files:

Script customize

If this script is present, SquashFS root filesystem is unpacked, script is run and filesystem image repacked after customization.
Note: Packing (compressing) SquashFS filesystem is long and CPU-intensive task. Do not include this script in customization directory if you are not modifying contents of root filesystem.

This script is run in chrooted environment in directory of live CD root filesystem.
Due to this fact, there is no access to files outside of live CD root filesystem.
However, the whole contents of customization directory is copied to chroot environment, so it is accessible.

In this script, it is possible to use any commands, like in normal Ubuntu system.
In particular:
Note: After script is run, temporary directories contents (in particular /tmp) is purged before building CD.

For examples of usage of script see customize-dir-examples/ subdirectories.

Script customize_initrd

If this script is present, initrd (initial ramdisk) image is unpacked, script is run and initrd image is repacked after customization.

Initrd contains kernel modules and scripts used right after boot of Linux kernel to locate and mount root filesystem.
You can exchange these modules/scripts with your customized versions or you can add some modules, for example to support some exotic hardware during boot.

This script is run in context of your system.
Location of initrd image directory is passed in INITRD_REMASTER_DIR environment variable.
In Bash scripts you can use $INITRD_REMASTER_DIR to access it.

For examples of usage of script see customize-dir-examples/ subdirectories.

Script customize_iso

If this script is present, it is run before repacking ISO image in order to customize contents of image.
You can add or remove files on CD, for example add some documentation, tools needed to boot CD, etc.

This script is run in context of your system.
Location of initrd image directory is passed in ISO_REMASTER_DIR environment variable.
In Bash scripts you can use $ISO_REMASTER_DIR to access it.

For examples of usage of script see customize-dir-examples/ subdirectories.


Updated for UCK v1.1, June 22nd 2006.