Appendix B. Available hooks

Table of Contents

B.1. run-parts type hooks
B.1.1. System boot
B.1.2. General purpose run-parts hooks
B.1.3. Special purpose run-parts hooks
B.1.4. Partitioning — deprecated components
B.2. Other hooks
B.2.1. Hooks available for customization
B.2.2. Hooks reserved for internal use

This appendix given an overview of hooks available for debian-installer modules and extensions. See also Section 2.4, “Hooks provide additional flexibility”.

This overview may not be fully complete.

B.1. run-parts type hooks

This type of hook consists of a directory in which any component can drop a script that's to be executed at a specific point of the installation procedure. The component responsible for the hook will simply execute any scripts that are present at that time. Scripts are executed in sequence and since the order of execution is often important, they are usually prefixed with a sequence number.

Note that currently in most cases the component executing run-parts scripts do not fail or show an error if a called script returns an error.

B.1.1. System boot

Scripts that are executed as part of the boot process of Debian Installer. Various scripts in these directories are architecture-specific. See also Section 2.2, “The boot process”.

/lib/debian-installer-startup.d/* [rootskel]

Early boot scripts. Special feature is that scripts get called if they are executable, and get sourced if they are not.

/etc/rcS.d/S[0-9][0-9]* [rootskel]

Additional early boot scripts; executed or sourced just after the scripts in /lib/debian-installer-startup.d.

/lib/debian-installer.d/* [rootskel]

Initialization and startup of the D-I user interface. These scripts always get sourced.

These scripts will be run again if the main installer process dies for some reason.

B.1.2. General purpose run-parts hooks

This section lists general purpose run-parts directories where other components commonly drop scripts in order to have actions executed at that stage of the installation. They are listed roughly in the order in which they are executed during a standard installation.

/usr/lib/base-installer.d/* [base-installer]

The files in this directory are executed after the system has been bootstrapped (generally by debootstrap), but before the system is used in any way. It is intended to be used for very basic configuration of the target system. APT has not yet been configured at this point.

/usr/lib/post-base-installer.d/* [base-installer]

The files in this directory are executed after basic configuration of APT and just before kernel selection and installation.

/usr/lib/pre-pkgsel.d/* [pkgsel]

The files in this directory are executed before tasksel is called in the /target environment. Example usage: install custom tasks (tasksel-data) from a source added during apt-setup.

Directly accessing the installation CD and thus installing udebs is not possible in these scripts (but should also not be needed).

/usr/lib/finish-install.d/* [finish-install]

The files in this directory are executed at the end of the installation.

B.1.3. Special purpose run-parts hooks

This section lists run-parts directories that are less likely to be used by other components or for customization, although it is still possible to do so.

/lib/main-menu.d/* [main-menu]
/lib/rescue.d/* [rescue]
/usr/lib/apt-setup/generators/* [apt-setup]

Contains scripts responsible for generating entries in the /etc/apt/sources.list on the target system.

B.1.4. Partitioning — deprecated components

The hooks listed in this section are from udebs that are only still being used for the mips architecture. All other architectures use partman instead.

/var/lib/partconf/fstab.d/* [partconf?]

partconf and mkfstab read all files in this directory and append the lines (with or without modification) to the generated /target/etc/fstab.

/var/lib/partconf/block.d/* [partconf?]

partconf executes for each partition every script in this directory, so some udebs can place scripts here, and then block the output of some partitions; very useful for raid/lvm support. (planned to be included by Thorsten Sauter)

/usr/share/partitioner/${ARCH}.sh, /usr/share/partitioner/ [partitioner?]

partitioner first tries to call the shell script for the current architecture, and if this script doesn't exist it runs with the selection harddisk as argument. The script can then do whatever is needed to partition a harddisk on this arch (e.g. running fdisk (text) or cfdisk (slang)).

B.2. Other hooks

The hooks in this section do not contain scripts, but are single files or a directory containing files that are read by a certain component or utility. Some of these hooks can be used for customization, but others should only be modified by using the correct utilities.

B.2.1. Hooks available for customization

/cdrom/.disk/udeb_include, /cdrom/.disk/udeb_exclude [anna]

List of packages (udebs) to install into or exclude from the d-i ramdisk.

/cdrom/.disk/base_include, /cdrom/.disk/base_exclude [base-installer]

The contents of these files are taken as lists of packages to install into or exclude from the target area.

B.2.2. Hooks reserved for internal use

/var/lib/anna-install/queue, /var/lib/apt-install/queue [di-utils]

Used by anna-install and apt-install respectively to queue udebs or packages for later installation.

/run/udev/firmware-missing [udev,hw-detect]

Used to register for which kernel modules udev was unable to load firmware.