Debian Preseed Process
Similar to Kickstart in Red Hat land, the debian-installer (referred to as d-i from here on out) uses an automated installer answer mechanism called preseed. Some links about the d-i preseed process can be found here:
- Official Debian d-i Preseed Documentation
- Steve McIntyre’s Script for Pulling Preseed Values for all Debian Packages
The colloquial way to pass the preseed answers to the d-i is to pass a kernel boot parameter with a URL for the d-i to download the preseed file. This can be done via these two kernel parameters being added in GRUB (checksum optional):
preseed/url=http://host/path/to/preseed.cfgpreseed/url/checksum=<preseed.cfg_file_checksum>
Unfortunately, the d-i documentation seems to be rather bare when it comes to customization of the preseed file. Basically any dpkg on the system has it’s own namespace that can be used in the preseed process (which is Steve McIntyre’s link above). This page is divided into sections with extra information I collected when creating my own preseed file that were pieced together from multiple sources.
Disk Partitioning
The preseed file has a disk partitioning scheme that follows Backus-Naur form, which is probably something folks haven’t encountered since their CompSci classes unless they really love compilers or programming language design. This may be overkill, but it does allow for some pretty cool “fuzzy” configurations for advanced partitioning schemes. This allows the d-i to create a partition map relative to the size of the disk.
Say if you want a simple GPT partition map that looks like this, for a UEFI capable system (no LVM, no LUKS, just basic partitions):
/dev/sda [gpt]
|-- /dev/sda1 [200MB] esp /boot/efi
|-- /dev/sda2 [1024MB] swap
|-- /dev/sda3 [REMAINDER] ext4 /
The d-i requires these parameters in the preseed to be set:
d-i partman-auto/method string regular
d-i partman-auto/expert_recipe string \
simple-partition-scheme :: \
200 300 200 free \
$iflabel{ gpt } \
$reusemethod{ } \
method{ efi } \
format{ } \
bootable { } \
. \
1024 200 1024 linux-swap \
method{ swap } \
format{ } \
. \
8192 100 -1 ext4 \
method{ format } \
format{ } \
use_filesystem{ } \
filesystem{ ext4 } \
mountpoint{ / } \
.
Kernel Boot Parameters
For this to be a truly “touchless” installation process, the d-i wants to know about the locale and keyboard settings before setting up the network and grabbing the preseed file. d-i will prompt for this regardless of it being set in the preseed, unless you create a custom Debian installation CD with these parameters configured on the GRUB command line.
To get the d-i to a point where it will grab the preseed without prompting for user input, these minimal parameters must be specified as a boot option:
debian-installer/locale=en_US.UTF-8
keyboard-configuration/xkb-keymap=us
netcfg/get_hostname=<hostname>
netcfg/get_domain=<domain>