Appendix B. Automating the installation using preseeding B.4.13. Preseeding other packages B.5. Advanced options B.5.1. Running custom commands during the installation B.5.2. Using preseeding to change default values A very powerful and flexible option offered by the preconfiguration tools is the ability to run com- mands or scripts at certain points in the installation. When the filesystem of the target system is mounted, it is available in /target . If an installation CD is used, when it is mounted it is available in /cdrom . It is possible to use preseeding to change the default answer for a question, but still have the question asked. To do this the seen flag must be reset to “false” after setting the value for a question. d-i foo/bar string value d-i foo/bar seen false 103 # d-i preseeding is inherently not secure. Nothing in the installer checks # for attempts at buffer overflows or other exploits of the values of a # preconfiguration file like this one. Only use preconfiguration files from # trusted locations! To drive that home, and because it’s generally useful, # here’s a way to run any shell command you’d like inside the installer, # automatically. # Depending on what software you choose to install, or if things go wrong # during the installation process, it’s possible that other questions may # be asked. You can preseed those too, of course. To get a list of every # possible question that could be asked during an install, do an # installation, and then run these commands: # debconf-get-selections --installer > file # debconf-get-selections >> file # This first command is run as early as possible, just after # preseeding is read. #d-i preseed/early_command string anna-install some-udeb # This command is run immediately before the partitioner starts. It may be # useful to apply dynamic partitioner preseeding that depends on the state # of the disks (which may not be visible when preseed/early_command runs). #d-i partman/early_command \ # string debconf-set partman-auto/disk "$(list-devices disk | head -n1)" # This command is run just before the install finishes, but when there is # still a usable /target directory. You can chroot to /target and use it # directly, or use the apt-install and in-target commands to easily install # packages and run commands in the target system. #d-i preseed/late_command string apt-install zsh; in-target chsh -s /bin/zsh