Tech/OSS/Preseed

From lathama
< Tech‎ | OSS
Jump to navigation Jump to search

The Debian Installer has many features and one of them is to pre-configure or preseed the install. This is a file that has key/value pairs around the questions that would/could be asked during startup.


File Format

Just a simple text based file with the question(key) and answer(value) laid out. Example line might look like

 d-i debian-installer/locale            string en_US


Looking at your install answers

There are three parts basiclly and you build a preseed from your current install in these steps.

  1. echo "#_preseed_V1" > preseed.txt
  2. debconf-get-selections --installer > preseed.txt
  3. debconf-get-selections >> preseed.txt
Example on this laptop
root@lappy:~# apt install debconf-utils
...snip...
root@lappy:~# echo "#_preseed_V1" > preseed.txt
root@lappy:~# debconf-get-selections --installer > preseed.txt
root@lappy:~# debconf-get-selections >> preseed.txt
root@lappy:~# ls -lha preseed.txt 
-rw-r--r-- 1 root root 121K Jun 16 08:26 preseed.txt
root@lappy:~# cat preseed.txt | wc -l
1717
root@lappy:~# 

Examples

Using Preseed

You can load a preseed file over file, floppy, http, https, and tftp today and maybe other tech in the future. If you use USB Debian installer you can make a second partition on the drive that will be mounted as /media

Media
Make a second partition on the install USB stick and add your preseed.cfg or preseed.txt or fluffykitty.meow file.
At the install screen
PXE
DHCP
Manual URL entry
At the installer boot screen you can manually add the url like https://www.debian.org/releases/stable/example-preseed.txt