You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Daniel Reurich 8c73a4552d oops forgot to add the purpy splash! 5 years ago
boot oops forgot to add the purpy splash! 5 years ago
config Update for jessie Beta release 5 years ago
localudebs add gitignores, converted from svn 10 years ago
needed-characters Add list of neeed characters for Tajik 7 years ago
pkg-lists Add devuan-keyring-udeb to the pkg-lists/base 5 years ago
util util/gen-hd-image: set proper permissions for the generated partition image 6 years ago
.gitignore Revert "Ignore localudebs" 6 years ago
Makefile more rebranding fixes 5 years ago
README Remove desktop selection from syslinux; now available in tasksel. 6 years ago
TODO Remove unused pkg-list files and configuration for i386 floppys. 9 years ago
d-i-unpack-helper daily build changes so I can use d-i-unpack-helper 13 years ago
daily-build alternate way to determine build tree git version 10 years ago
translation-status Update translation-status for the release. 6 years ago


The files in this directory are used to build the Debian installer.
Basically it consists of downloading udebs, unpacking them, applying some
magic (library reduction etc.) and building an image.

Warning: The build system for the installer is often tightly bound to the
version of Debian for which it is targeted. If you are using stable, use
"apt-get source debian-installer" to get a version of the installer that
will build on your system. If you are using testing or unstable, check out
a copy of the installer using the command
"git clone git://"

- Install the build-dependencies on the host system
(run dpkg-checkbuilddeps in the parent installer/ directory).
- Create your own sources.list.udeb.local, otherwise the build host's
sources.list is taken as a template for sources.list.udeb.
- Run "make" to get a list of available targets.
- Build an image using one of the build_ targets (build_netboot,
all_build, etc). You may want to set the USE_UDEBS_FROM variable,
documented below.
- Look in dest/ for the completed images.

Note that this does not create full debian ISO images; that is left to the
debian-cd package. As a shortcut, you can create a mini-ISO image, with
only the netboot initrd on it. make build_netboot will create a
dest/netboot/mini.iso, using isolinux. Any size initrd can be placed on
this ISO, which may be useful for testing.

A more detailed overview of how the installer is built:

* 'sources.list.udeb' is used to configure apt to download udebs from a
mirror. It is autogenerated based on '/etc/apt/sources.list', by the
Makefile's 'sources.list.udeb' target. Or you can provide your own
locally modified 'sources.list.udeb.local'. You can also provide a
'preferences.udeb.local' to select specific versions of the packages
(see apt_preferences(5) for its syntax).
* The Makefile is configured via the make fragments in the config
directory. These are organized in a subarch/medium/flavour hierarchy and
get included by the main Makefile.
* config/local can be added to override anything set in other fragments
which are local to your system which you want to avoid accidentially
* 'pkg-lists' has subdirectories for the different image types that list
udebs that are put on each image. The pkg-lists/*/common files list
udebs common to all architectures, and the files named by architecture
(<arch>.cfg) list udebs specific to an architecture. It is also possible
to include udebs only on a specific subarchitecture by creating a
directory for the architecture and putting config files for the
subarchitecture there (<arch>/<subarch>.cfg). All of these files can
have #include lines to include files from pkg-lists. Also,
${kernel:Version} in these files is replaced with the kernel version,
as set in the KERNELVERSION variable (plus the KERNEL_FLAVOUR variable).
* Anything listed in pkg-lists/local and pkg-lists/*/local is included in
the image that is built. This is to provide an easy way to add extra
udebs to a test image.
* All dependencies of packages in pkg-lists are automatically included
in an image by default. If you know that some of the dependencies are
wrong, or do not apply to an image, you can remove dependencies from the
pkg-lists by listing them and putting a space and minus sign after them.
* If you need to include a package for one major version of a kernel, but
not for another, put the kernel major version(s) that should have the
package in brackets at the end of the line.
For example: discover1 [2.2 2.4]
* Similarly, if you need to include a package for only one type of kernel,
put the name of the kernel(s) that should have the package in brackets at
the end of the line.
For example: gnumach-udeb [hurd]
* If you'd like to include a given package only if it's available, and not
fail otherwise, put a question mark at the end of the line.
For example: pcmcia-modules-${kernel:Version} ?
It's recommended to use this option seldom and with care as it can make the
build less robust if packages can be dropped from it without warning.
* Apt is used to download the required udebs. This does *not* include
libraries; libraries used by udebs must be installed on the build system,
and so are build-depended on.
* If you have some udebs that are not available on your mirror yet,
you can drop them in 'localudebs/' and they will be used.
* dpkg is used to unpack the udebs into the build directory.
* A customized set of reduced libraries is generated to correspond to the
udebs that were installed.
* Some boot images have associated "driver" disks. These disks just get
udebs put on them.
* The final images are put in the dest/ directory.


The debian-installer build system

The build system is designed to allow the addition of configurations
with minimal effort. It achieves this by evaluating some magic
variables from the configuration snippet and feeding some generic
rules you hopefully never need to know about. The configuration
snippets live in the config/ directory and are organized in a
hierarchical tree structure, the directory names therein have also a
specific meaning. It follows a config/$ARCH/$SUBARCH/$MEDIUM/$FLAVOUR
scheme, where $ARCH is mandatorily the debian architecture name. For
the other three, the requirement is you need to use at least one.

$SUBARCH is supposed to be the subarchitecture. For e.g. m68k this
would be something like "amiga" or "atari", i386 doesn't use it.

$MEDIUM is the boot medium, like "cdrom", "floppy", "netboot".

$FLAVOUR distinguishes between other differences, like 2.4 vs. 2.6
kernels, or several floppy images.

Note: You don't have to follow this usage strictly, the variable naming
is merely a hint. It could also have been named as $LEVEL1/$LEVEL2/LEVEL3.

Note2: The resulting file tree in the dest/ directory has a similiar
$SUBARCH/$MEDIUM/$FLAVOUR layout. It can be slightly adapted with the
EXTRANAME and SOME_DEST variables.

An example tree layout looks like this:

|-- i386
| |-- cdrom
| | |-- el-torito-2.6.cfg
| | |-- el-torito.cfg
| | |-- isolinux-2.6.cfg
| | `-- isolinux.cfg
| |-- cdrom.cfg
| |-- floppy
| | |-- boot.cfg
| | |-- cd-drivers.cfg
| | `-- root.cfg
| |-- floppy.cfg
| |-- hd-media
| | `-- 2.6.cfg
| |-- hd-media.cfg
| |-- monolithic
| | `-- 2.6.cfg
| |-- monolithic.cfg
| |-- netboot
| | `-- 2.6.cfg
| `-- netboot.cfg
`-- i386.cfg

In the first level, you have an $ARCH directory, and an $ARCH.cfg
configuration snippet, which needs to define what to use from the tree
below, and can also define commonly used variables for all
configurations of this architecture. An example $ARCH.cfg would look
like this:

SUBARCH_SUPPORTED = r4k-ip22 r5k-ip22 sb1-bcm91250a miniiso

KERNELNAME = $(foreach ver,$(KERNELVERSION),vmlinux-$(ver))



The SUBARCH_SUPPORTED line defines what to look up in the next
directory level. In this case, these are the configuration snippets
r4k-ip22.cfg, r5k-ip22.cfg, sb1-bcm91250a.cfg and miniiso.cfg. Each of
those snippets can define a MEDIUM_SUPPORTED variable, which
opens the next subdirectory level. Those subdirectories have to have
the name of their subarchitecture, for the example above e.g. r4k-ip22
or sb1-bcm91250a.

The various KERNEL* variables are common for all configurations of this
architecture, so they were moved upwards from the leaf configuration
snippets. The same can be done for make rules.

- You can re-/undefine variables defined in a higher level, but you
can't do that for rules. Make will complain about it.
- Use always recursively expanded variables (that is '=', not ':=').
Make works though the tree by recursively calling itself. If you
use simply expanded variables, the variables of higher levels (like
*_SUPPORTED) won't get re-evaluated, and things will break.

Interesting Variables in configuration snippets

First, mandatory variables:

As already explained, they define what configurations the build
system should look for. They cause the definition of SUBARCH,
MEDIUM and FLAVOUR for every snippet they invoke that way.
At least one of them must be defined.

The high part of the kernel version, like "2.6". Unluckily, this is
what the kernel people call MAJOR.MINOR.

The version of the kernel .udeb package, like "2.4.26-r4k-ip22"

The full name of the kernel image. If you build an EXTRA target (e.g.
for a driver floppy), this variable has to be empty.

This variable points to the subdirectory in pkg-lists/ which should
be used for this config. E.g. $TYPE=cdrom means that
pkg-lists/cdrom/local, pkg-lists/cdrom/common and
pkg-lists/cdrom/<arch> are used. Defaults to $(MEDIUM)/.


Define this variable in the leaf configuration snippet to one or more
of the following generic targets, and any local target you want to

Create an gzipped initrd.gz.

Create the kernel image.

Create an optionally gzipped bootable image. This creates kernel,
initrd and boot screens, and depends on the arch_boot rule, where the
image creation is handled.

Create an optionally gzipped root image. This creates an initrd and
depends on the arch_root rule, where the image creation is handled.

This creates a file system image with driver .udebs in it.

This creates a mini ISO image, by creating the boot screens and
depending on arch_miniiso rule, where the image creation is handled.

This provides the boot screens in a gzipped tarball.

This copies files to the destination directory of your configuration.

These variables correspond to the generic targets and hold their
description which is added to the MANIFEST file in the dest/

Those are intermediate targets. Everything is built for them, the
generic targets copy the stuff they are interested in over to the
dest/ and add the MANIFEST entry. They are useful as dependencies for
things which needs to be built but shouldn't show up in the
destination directory. You should never need to redefine them.

Other useful variables for configuration snippets:

The first part of the kernel version, e.g. 3.14-2. Used as the
default base/suffix for KERNELVERSION (i.e. $(LINUX_KERNEL_ABI)-amd64).

The flavour of the kernel .udeb package. This has nothing to do with
FLAVOUR. It has always a value of "di" these days.

These are like SUBARCH_SUPPORTED (etc.), except that they are not built by
default with 'make all_build' but are only used when selected manually,
either by passing an explicit target to make or by defining RECURSE_EXTRA
to a non-empty value.

This allows to vary the name of the dest/ target a bit. Example:
EXTRANAME = $(MEDIUM)/ leads to: floppy/netboot.img
EXTRANAME = $(MEDIUM)- leads to: floppy-netboot.img
Nice to avoid subdirectories with only a single file in it.

The destination directory of your configuration.
Caveat: Always use $(DEST), not ./dest/foo/... The latter will only
work for one specific location, and fails if you relocate the
configuration snippet in the tree. DEST changes its definition for
every leaf configuration appropriately.

Like DEST, but with the last path element removed. Mostly useful in
combination with EXTRANAME.

The intermediate directory, where everything is built.
Caveat: Always build stuff in TEMP, and then install to DEST from
there. Doing this differently tends to turn into a mess.
Caveat2: Always use $(TEMP), not ./tmp/foo/... The latter will only
work for one specific leaf configuration. TEMP changes its definition
for every leaf configuration appropriately.

Purge unwanted languages. Mostly useful for space constrained media.

If set the languages in $(GI_LANGS) will NOT be dropped. Should only be
set in targets building graphical installer images.

List of languages only supported with the graphical cdebconf frontend.

If set, the kernel's is expected to have an unique
filename for each kernel of this architecture.

The size of a floppy image, in kilobytes.
The size of a an image, in kilobytes. Only needed and supported for
some types of images.

Disk label to use when formating disk images. Allowed content varies
by disk type.

The type of media produced, currently used to make qemu boot the image
properly. Suggested values: "CD-ROM", "netboot image", "floppy", etc.

The codename of the debian release to be installed by default.
Included in /etc/default-release in most initrds.

The version identification (number + codename) of the Debian release.

Normally the codename of the release to use for the build. Defaults to
unstable for daily builds. Set from debian/rules when building through
Included in /etc/udebs-source in most initrds.

Set to 1 in debian/rules to have the gen-sources.list.udeb script include
udebs from $USE_UDEBS_FROM-proposed-updates (for official builds of e.g.
stable updates). For manual builds use for example:
make USE_PROPOSED_UPDATES=1 all_build
If no valid source for proposed updates is found, the build will fail.

Can be used to suppress the inclusion of the files /etc/default-release and
/etc/udebs-source in some targets (like boot floppies).

Volume ID and label for DOS filesystems.

SYSLINUX_CFG (x86 only)
Determines how the syslinux configuration is created. Options are:
- prompt: non-graphical syslinux configuration allowing installation of
only a default desktop environment
- standard: as prompt, but graphical menu (using vesamenu)
- template: the available files are merely copied; the actual configuration
is created by debian-cd

Set to y to produce a beep when the boot menu is ready to accept commands
(e.g. extra kernel parameters, etc.)
This improves accessibility of the image for blind people.

Create gzipped images. This works only for the BOOT, ROOT and EXTRA

This variable points to the directories where additional driver
.udebs reside. This causes these .udebs to be considered in the font
and library reduction steps, so the characters and library symbols needed
for them are kept.

Additional targets which are run before the ones in TARGET. This is
e.g. useful to build the additional driver images first, and then
use their intermediate tree for EXTRADRIVERS.

This variable points to additional udebs that should be considered by the
library reduction step. cdebconf plugins should be listed here so the
symbols they will need are available on the initrd (since cdebconf runs
using the initrd libc, its plugins do too)

The variable indicates that the image is just a driver image for some
other image. The value points to the directory in pkg-lists for the image
that it's a driver for.

If this variable is set, it should point to a usable UPX compressor.
This is then used to create UPX compressed kernels.

Additional syslinux options.

The syslinux splash screen file.

The filesystem to use for initrds, needs to be built into the kernel.
ext2, initramfs, or jffs2.

If using jffs2 for the INITRD_FS, you will need to set this variable to
a command to use to create the image.
For example: MKFS_JFFS2 = mkfs.jffs2 -f -p -b -e 0x20000

Add you configuration's name if it can be written to a raw device.
Mostly useful for floppies.

List of files listing udebs that were used to build the image.

Location of file with translation statistics. This file is intended to
be included only for official releases and thus this variable is set in
The file is only included if it exists. A warning will be displayed if
the file is older than 2 weeks than the time of the build.
If needed, inclusion of the file can be prevented by setting the variable
to empty for specific targets (e.g. most floppy images) in config or
globally in config/common.

Variables useful for testing:

The device name to use for writing a image to a raw device.

The name of the qemu emulator binary.

Add additional .udebs to the target image.

Add additional files to the target image.

Add SSL certificates to the target image. For this to be useful, you will
also need to supply d-i with GNU wget.

The mirror to get .deb and .udeb packages from. Defaults to the same
as the host machine uses.

Archive components from which to fetch .udeb packages. Defaults to

An initrd preseed file to put in the initrd.

Rules invoked from the various targets:

The bootable image TEMP_BOOT is created in this rule, usually from
other files.

The root image TEMP_ROOT is created in this rule, usually from
TEMP_INITRD, and probably some other files.

The boot screens in TEMP_BOOT_SCREENS are created here.

The mini ISO image TEMP_MINIISO is built here, from whatever the
particular (sub-)architecture needs for it.