# debian-cd

## An attempt at documentation!

debian-cd is a small but quite complex package. On the surface, its job is simple - make CD images from a Debian archive. The details are rather more involved...

## Overview - what goes on a CD?

There are several important items that make up a Debian CD. Depending on the type of CD, not all of them are needed.

- Volume information (required)
- Debian packages and/or source files (optional)
- Metadata to reference those (optional)
- Debian-Installer (optional)
- Scripts/binaries to make the CD bootable (optional)

The only things that must be on a Debian CD for it to recognised as such are the volume info, the files that give some information about the CD itself. Everything else is strictly optional, but without anything else on the CD it won't be very useful!

A normal installation CD will contain all five of the above sections, but other combinations can be useful too. A bootable business card CD will contain volume info, d-i and bootable files, but no actual packages or sources - the installer will download the bits it needs. An update CD will contain volume info, packages and package metadata - it's expected to be used just as a source of new packages for an existing system.

For more information on the layout of the CD, see CD contents.

## Overview (again) - how does debian-cd work?

debian-cd is made up of a large central Makefile and lots of small(ish) helper scripts written in sh and perl. It depends on various other packages to do lots of the hard work, for example apt to calculate package dependencies and debootstrap to provide the list of packages needed for a base installation.

A typical debian-cd run will involve:

- Setup in the configuration file CONF.sh - which architecture(s), where to find files (local Debian mirror), temporary working location and output location are most important, but there are other config options.
- Running a build wrapper script (build.sh or build_all.sh); the wrapper script will call various rules in the Makefile
- Parse Packages files from the mirror to work out what packages are available
- Make temporary trees, one for each output image
- Set up volume information in each tree
- Copy in boot files and d-i bits onto each CD where they are wanted
- Copy documentation files onto CDs as required
- Copy packages files onto each CD; generate Packages metadata files along the way
- Generate checksums of the files on each CD
- Run mkisofs to turn the temporary trees into ISO images and/or jigdo files

This is a rough guide only - see later for more details on each of the steps!

(c) Steve McIntyre <steve@einval.com>, December 2006. GPL v2
Next - Getting debian-cd