How Debian-CD Generates Debian Installation Media
This article provides an overview of debian-cd, the
official suite of tools used by the Debian Project to produce bootable
installation media. It details what the toolset consists of, how it
organizes Debian package archives, how it integrates the installer and
bootloaders, and the step-by-step process used to generate release-ready
hybrid ISO images for multiple hardware architectures.
What Is debian-cd?
debian-cd is a specialized collection of shell scripts,
Perl utilities, and Makefiles maintained by the Debian CD team. Its
primary function is to transform the massive collection of Debian
software packages into organized, bootable optical disc images—including
netinst CDs, full DVD sets, and Blu-ray images.
Because a complete Debian repository contains tens of thousands of
packages spanning multiple gigabytes, debian-cd provides
the sorting, layout, and mastering logic needed to partition these
archives across sequentially numbered discs according to popularity and
critical system needs.
Key Components and Inputs
To build media, debian-cd requires several primary
inputs:
- Debian Archive Mirror: A local or remote mirror
containing binary
.debpackages, source packages, and Debian archive metadata (Packages.gz,Sources.gz,Releasefiles). - Debian Installer (
debian-installer): The kernel, initial ramdisks (initrds), and installation components (udebs) that power the setup environment. - Task Definitions: Configuration files that define which packages belong on which disc. Core system utilities and popular desktop environments are assigned higher priorities, ensuring that Disc 1 can perform a functional installation offline.
- Bootloaders: Architecture-specific boot software, such as ISOLINUX/Syslinux for legacy x86 BIOS, GRUB for UEFI architectures, and other platform-specific loaders.
The Image Generation Process
Generating installation media involves a multi-stage pipeline:
1. Configuration and Environment Setup
The administrator defines the target architecture (e.g.,
amd64, arm64), the distribution release (e.g.,
stable, testing), and the medium type
(netinst, DVD, Blu-ray). Environment variables control output
directories, mirror paths, and disc labels.
2. Task Selection and Package Ordering
debian-cd analyzes task lists and dependency graphs.
Essential system packages, standard utilities, and default desktop
environments are placed on Disc 1. If generating a multi-volume set
(such as the complete DVD collection), secondary dependencies and less
common packages are distributed across subsequent discs in order of
priority.
3. Tree Population and Repository Structure
The tool builds a directory structure for each image that mimics a
standalone Debian archive. It creates a local pool/
directory containing the chosen .deb packages and generates
valid Packages and Release indices specific to
that disc. This ensures that the installed system can use the disc as a
standard APT repository.
4. Installer and Bootloader Integration
debian-cd integrates the debian-installer
files into the disc structure. It configures the bootloader
configuration files, boot menus, and themes. For modern systems, it
configures hybrid boot layouts capable of booting from both traditional
optical media and USB flash drives, supporting both legacy BIOS and UEFI
modes.
5. ISO Mastering
Once the directory tree is staged, debian-cd invokes
mastering utilities—primarily xorriso. This creates the
final ISO 9660 filesystem, embedding the partition tables and boot
records required to produce an "isohybrid" image.
6. Integrity and Checksum Generation
After the ISO images are generated, debian-cd calculates
cryptographic hashes (such as SHA256 and SHA512) for every file. These
checksum lists are subsequently signed with official Debian project
keys, allowing end users to verify the authenticity and integrity of
their downloads.