Building a Custom Debian CD Set

An Easier Alternative

One possible "alternative" to this procedure is to use ["Simple-CDD"]. If it does everything you need for your custom CD, then there is no reason (except curiosity) to go through the rest of this article.


Introduction

This page describes how to create a partial debian mirror and the steps used to create a custom debian install cd using that mirror. This document shows how to use packages gathered from a prototype system's apt cache as well as a download script that starts with a list of packages and fetches the appropriate versions. The instructions here assume i386 but should work for any architecture simply by replacing i386 in the instructions with the architecture of your choice.

Quick Overview, Using Apt, Binary Only

Create a partial mirror of the Debian archive for Apt (optional)

Create the actual CD set

Note that you must have a mirror of the debian archive which is usable by ["?AptGet"] and which has the ["DebianInstaller"] binaries


Detailed Instructions

1. Getting Your Packages, Option 1

Pro: Will automatically resolve and download dependencies?BR Con: Only works for packages and dependencies not already installed

Get Your Base System (Optional)

The following will get a you system with no other packages installed, which can make figuring out what packages to include in your pool directory easier. (If you use apt-get to download the packages you want on you CD you will find that the dependencies for the packages will only also be downloaded if they are not already installed. If you are using another method figure out the list of packages to download then you don't need to worry about this).

Getting Additional Packages, Option 1

Getting Additional Packages, Option 2

Optional Order

Instead of copying the network install cd first, copy your Apt cache to your desired pool directory first (as above), then use the above script to copy from the network install pool directory to your pool directory.

Notes on the use of AptMove

You will need to change apt-move.conf to point to your mirror. See ["AptMove"] for details (or man apt-move).

1.2 Getting Your Packages, Option 2

Pro: Works for all packages?BR Con: You have to figure out the dependencies yourself

1.3 Getting Your Packages, Option 3

Pro: Works for all packages?BR Con: You have to learn ["Germinate"] and download a script

2. Get DebianInstaller Binaries

Option 1

Should only be used when using a stable distribution's network install cd and stable packages, for sarge or later because the udebs must match the installer for a successful install. If you insist on using it with testing or unstable, make sure you're using the right versions of the udebs, especially kernel, for the installer. You have been warned.

  1. Download installer-i386 from a ["Debian"] mirror (e.g. ftp://ftp.debian.org/debian/dists/sarge/main/current)

  2. You should have the correct udebs in your tree if you have downloaded the installer-i386 from the same distribution as your network install cd

Option 2

  1. Build DebianInstaller (which also downloads udebs). See ["DebianInstaller/Build"].

  2. Copy udebs to your pool directory from debian-installer/installer/build/apt.udeb, using something like the

following script: Improved 2004-12-23

     #!/bin/bash

3. Get overrides.<dist>.*

  1. Download /debian/indices/overrides.<dists>.'''.gz for your distro (e.g. for sarge, /debian/indices/overrides.sarge.'''.gz) into the directory indices which is in the same root directory as your pool (mirror) directory (e.g. /debian/pool, so /debian/indices).

  2. Gunzip the overrides, keeping the compressed files.

If you want to includes packages from non-US you ought to create another indices directory (e.g. indices-non-US), and get the overrides from a non-US mirror (from /debian-non-US/indices-non-US).

4. Generate Packages.gz, Sources.gz and Release files for your 'distribution'

5. Create List Of Files To Include On CD

    #!/bin/sh
    function print_usage {
            echo gen-task-dfdsarge pool-directory
    }
    if [ -z "$1" ] ; then
            print_usage
            exit
    fi
    POOLDIR=$1
    TMPFILE=`/bin/tempfile`
    if [ `expr substr $POOLDIR 1 1` != \/ ]; then
            POOLDIR=`pwd`/$POOLDIR
    fi
    IFS=$'\n'
    for package in `find $POOLDIR -type f`; do
            pkgfilename=`basename $package`
            pkgname=`echo $pkgfilename||cut -f1 -d_`
            echo $pkgname>>$TMPFILE
    done
            cat $TMPFILE || sort -u

6. Install and Configure debian-cd

The Remainder of the debian-cd Procedure

This assumes you have both binaries and sources. If you want binary only read the README for debian-cd.

NOTE Frans Pop has developed a relatively easy to use wrapper script for use with debian-cd that works with the current version of debian-cd. It is [http://alioth.debian.org/~fjp/debian-cd/ available from alioth]. A README file explains how to use it.

WARNING The following is very out-of-date and will not work with recent versions of debian-cd (3.0.X onwards). I hope to find time to fix it, but can't promise anything... -- SteveMcIntyre