B.5. Haladó lehetőségek

B.5.1. Egyéni parancs futtatása telepítéskor

Az előíró eszközök egy nagyon erős és rugalmas lehetősége parancsok vagy szkriptek futtatása a telepítés egyes pontjain.

When the filesystem of the target system is mounted, it is available in /target. If an installation CD/DVD is used, when it is mounted it is available in /cdrom.

# 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.

# 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

B.5.2. Előírás használata alap értékek módosítására

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

The same effect can be achieved for all questions by setting the parameter preseed/interactive=true at the boot prompt. This can also be useful for testing or debugging your preconfiguration file.

Note that the d-i owner should only be used for variables used in the installer itself. For variables belonging to packages installed on the target system, you should use the name of that package instead. See the footnote to B.2.2. szakasz - Indító paraméterek használata kérdések előírt válaszára.

If you are preseeding using boot parameters, you can make the installer ask the corresponding question by using the ?= operator, i.e. foo/bar?=value (or owner:foo/bar?=value). This will of course only have effect for parameters that correspond to questions that are actually displayed during an installation and not for internal parameters.

For more debugging information, use the boot parameter DEBCONF_DEBUG=5. This will cause debconf to print much more detail about the current settings of each variable and about its progress through each package's installation scripts.

B.5.3. Előíró fájlok lánc-betöltése

Más előíró fájlok is csatolhatók egy előíró fájlból. E fájlok beállításai felülírják a korábban betöltött fájlok beállításait. Ez lehetővé teszi például a helynek megfelelő általános hálózati beállítások elhelyezését egy fájlba és pontosabb beállításokat egyes konfigurációkhoz más fájlokba.

# More than one file can be listed, separated by spaces; all will be
# loaded. The included files can have preseed/include directives of their
# own as well. Note that if the filenames are relative, they are taken from
# the same directory as the preconfiguration file that includes them.
#d-i preseed/include string x.cfg

# The installer can optionally verify checksums of preconfiguration files
# before using them. Currently only md5sums are supported, list the md5sums
# in the same order as the list of files to include.
#d-i preseed/include/checksum string 5da499872becccfeda2c4872f9171c3d

# More flexibly, this runs a shell command and if it outputs the names of
# preconfiguration files, includes those files. 
#d-i preseed/include_command \
#      string if [ "`hostname`" = bob ]; then echo bob.cfg; fi

# Most flexibly of all, this downloads a program and runs it. The program
# can use commands such as debconf-set to manipulate the debconf database.
# More than one script can be listed, separated by spaces.
# Note that if the filenames are relative, they are taken from the same
# directory as the preconfiguration file that runs them.
#d-i preseed/run string foo.sh

Lehetséges lánc-töltés initrd vagy fájl előíró szakaszból, hálózati előírásba a preseed/url beállításával a korábbi fájlokban. Ez egy hálózati előírás végrehajtását adja a hálózat feléledésekor. Ezt óvatosan kell tenni, mert 2 önálló előírás fut, így például kétszer lefuthat a preseed/early parancs, másodszor a hálózat feléledése után.