Konfigurationsfragmenterne brugt i dette appendiks er også tilgængelige som et eksempel på en forhåndskonfigureret fil fra http://www.debian.org/releases/stretch/example-preseed.txt.
Bemærk at dette eksempel er baseret på en installation for Intel x86-arkitekturen. Hvis du installerer en anden arkitektur, så kan nogle af eksemplerne (såsom tastatturvalg og installation af opstartsindlæser) være irrelevante og skal erstattes af debconf-indstillinger passende for din arkitektur.
Detaljer om hvordan forskellige komponenter for Debians installationsprogram fungerer kan findes i Afsnit 6.3, “Brug af individuelle komponenter”.
Under en normal installation vil spørgsmål om sted blive spurgt først, så disse værdier kan kun forhåndskonfigureres via metoderne hos initrd- eller kerneopstartsparametre. Automatisk tilstand (Afsnit B.2.3, “Auto-tilstand”) inkluderer indstillingen auto-install/enable=true
(normalt via aliasset for forhåndskonfiguration auto
). Dette forsinker spørgsmålene om sted, så de kan forhåndskonfigureres med enhver metode.
Stedet kan bruges til at specificere både sprog og land og kan være enhver kombination af et sprog understøttet af debian-installer
og et anerkendt land. Hvis kombinationen ikke udgør et gyldigt sted, så vil installationsprogrammet automatisk vælge et sted, som er gyldig for det valgte sprog. For at specificere stedet som en opstartsparametre, så brug locale=
. en_US
Selvom denne metode er meget nem at bruge, så tillader den ikke forhåndskonfiguration af alle mulige kombinationer af sprog, land og sted[21]. Så alternativt kan værdierne forhåndskonfigureres individuelt. Sprog og land kan også angives som opstartsparametre.
# Forhåndskonfiguration af sted angiver sprog, land og sted.. d-i debian-installer/locale string en_US # Værdierne kan også forhåndskonfigureres individuelt for større fleksibilitet. #d-i debian-installer/language string en #d-i debian-installer/country string NL #d-i debian-installer/locale string en_GB.UTF-8 # Valgfrit kan yderligere steder angives for oprettelse. #d-i localechooser/supported-locales multiselect en_US.UTF-8, nl_NL.UTF-8
Tastaturkonfiguration består af valg af et tastaturkort og (for andre end latinske tastaturkort) en ændringstast til at skifte mellem det amerikanske tastaturkort og andre ikke latinske tastaturkort. Kun grundlæggende tastaturkortvarianter er tilgængelige under installation. Avancerede varianter er kun tilgængelige i det installerede system, via dpkg-reconfigure keyboard-configuration.
# Tastaturvalg. d-i keyboard-configuration/xkb-keymap select us # d-i keyboard-configuration/toggle select No toggling
For at undlade tastaturkonfiguration, forhåndskonfigureres keymap
med skip-config
. Dette vil medføre, at kernens tastaturkort forbliver aktiv.
Of course, preseeding the network configuration won't work if you're loading your preconfiguration file from the network. But it's great when you're booting from CD or USB stick. If you are loading preconfiguration files from the network, you can pass network config parameters by using kernel boot parameters.
Hvis du skal vælge en bestemt grænseflade under netopstart før indlæsning af en forhåndskonfigurationsfil fra netværket, så brug en opstartsparameter såsom interface=
. eth1
Although preseeding the network configuration is normally not possible when using network preseeding (using “preseed/url”), you can use the following hack to work around that, for example if you'd like to set a static address for the network interface. The hack is to force the network configuration to run again after the preconfiguration file has been loaded by creating a “preseed/run” script containing the following commands:
kill-all-dhcp; netcfg
De følgende debconf-variabler er relevante for netværkskonfiguration.
# Disable network configuration entirely. This is useful for cdrom # installations on non-networked devices where the network questions, # warning and long timeouts are a nuisance. #d-i netcfg/enable boolean false # netcfg will choose an interface that has link if possible. This makes it # skip displaying a list if there is more than one interface. d-i netcfg/choose_interface select auto # To pick a particular interface instead: #d-i netcfg/choose_interface select eth1 # To set a different link detection timeout (default is 3 seconds). # Values are interpreted as seconds. #d-i netcfg/link_wait_timeout string 10 # If you have a slow dhcp server and the installer times out waiting for # it, this might be useful. #d-i netcfg/dhcp_timeout string 60 #d-i netcfg/dhcpv6_timeout string 60 # If you prefer to configure the network manually, uncomment this line and # the static network configuration below. #d-i netcfg/disable_autoconfig boolean true # If you want the preconfiguration file to work on systems both with and # without a dhcp server, uncomment these lines and the static network # configuration below. #d-i netcfg/dhcp_failed note #d-i netcfg/dhcp_options select Configure network manually # Static network configuration. # # IPv4 example #d-i netcfg/get_ipaddress string 192.168.1.42 #d-i netcfg/get_netmask string 255.255.255.0 #d-i netcfg/get_gateway string 192.168.1.1 #d-i netcfg/get_nameservers string 192.168.1.1 #d-i netcfg/confirm_static boolean true # # IPv6 example #d-i netcfg/get_ipaddress string fc00::2 #d-i netcfg/get_netmask string ffff:ffff:ffff:ffff:: #d-i netcfg/get_gateway string fc00::1 #d-i netcfg/get_nameservers string fc00::1 #d-i netcfg/confirm_static boolean true # Any hostname and domain names assigned from dhcp take precedence over # values set here. However, setting the values still prevents the questions # from being shown, even if values come from dhcp. d-i netcfg/get_hostname string unassigned-hostname d-i netcfg/get_domain string unassigned-domain # If you want to force a hostname, regardless of what either the DHCP # server returns or what the reverse DNS entry for the IP is, uncomment # and adjust the following line. #d-i netcfg/hostname string somehost # Disable that annoying WEP key dialog. d-i netcfg/wireless_wep string # The wacky dhcp hostname that some ISPs use as a password of sorts. #d-i netcfg/dhcp_hostname string radish # If non-free firmware is needed for the network or other hardware, you can # configure the installer to always try to load it, without prompting. Or # change to false to disable asking. #d-i hw-detect/load_firmware boolean true
Please note that netcfg will automatically determine the netmask if netcfg/get_netmask
is not preseeded. In this case, the variable has to be marked as seen
for automatic installations. Similarly, netcfg will choose an appropriate address if netcfg/get_gateway
is not set. As a special case, you can set netcfg/get_gateway
to “none” to specify that no gateway should be used.
# Use the following settings if you wish to make use of the network-console # component for remote installation over SSH. This only makes sense if you # intend to perform the remainder of the installation manually. #d-i anna/choose_modules string network-console #d-i network-console/authorized_keys_url string http://10.0.0.1/openssh-key #d-i network-console/password password r00tme #d-i network-console/password-again password r00tme
Depending on the installation method you use, a mirror may be used to download additional components of the installer, to install the base system, and to set up the /etc/apt/sources.list
for the installed system.
Parameteren mirror/suite
bestemmer programpakken for det installerede system.
The parameter mirror/udeb/suite
determines the suite for additional components for the installer. It is only useful to set this if components are actually downloaded over the network and should match the suite that was used to build the initrd for the installation method used for the installation. Normally the installer will automatically use the correct value and there should be no need to set this.
# If you select ftp, the mirror/country string does not need to be set. #d-i mirror/protocol string ftp d-i mirror/country string manual d-i mirror/http/hostname string http.us.debian.org d-i mirror/http/directory string /debian d-i mirror/http/proxy string # Suite to install. #d-i mirror/suite string testing # Suite to use for loading installer components (optional). #d-i mirror/udeb/suite string testing
Adgangskoden for root-kontoen og navn og adgangskode for den første normale brugers konto kan forhåndskonfigureres. For adgangskoderne kan du enten bruge rene tekstværdier eller crypt(3)-hasher.
![]() |
Advarsel |
---|---|
Vær opmærksom på at forhåndskonfiguration af adgangskoder ikke er fuldstændig sikker da alle med adgang til den forhåndskonfigurerede fil vil have viden om disse adgangskoder. Lagring af hashede adgangskoder anses for at være sikker medmindre at en svag hashingalgoritme såsom DES eller MD5 bruges; de giver mulighed for »bruteforce«-angreb. Anbefalede hashingalgoritmer for adgangskoder er SHA-256 og SHA512. |
# Udelad oprettelsen af en root-konto (normal brugerkonto vil kunne # anvende sudo). #d-i passwd/root-login boolean false # Alternativet, for at undlade oprettelsen af en normal brugerkonto. #d-i passwd/make-user boolean false # Root-adgangskode, enten i klar tekst #d-i passwd/root-password password r00tme #d-i passwd/root-password-again password r00tme # eller krypteret via en crypt(3)-hash. #d-i passwd/root-password-crypted password [crypt(3) hash] # For at oprette en normal brugerkonto. #d-i passwd/user-fullname string Debian User #d-i passwd/username string debian # Normal brugers adgangskode, enten i klar tekst #d-i passwd/user-password password insecure #d-i passwd/user-password-again password insecure # eller krypteret via en crypt(3)-hash. #d-i passwd/user-password-crypted password [crypt(3) hash] # Opret den første bruger med den specificerde UID i stedet for standarden. #d-i passwd/user-uid string 1010 # Brugerkontoen vil blive tilføjet til nogle opstartsgrupper. For at # omgå dette, så brug følgende. #d-i passwd/user-default-groups string audio cdrom video
Variablerne passwd/root-password-crypted
og passwd/user-password-crypted
kan også forhåndskonfigureres med “!” som deres værdi. I det tilfælde, bliver den tilsvarende konto deaktiveret. Dette kan være nyttigt for root-kontoen, selvfølgelig såfremt en alternativ metode er opsat til at tillade administrative aktiviteter eller root-logind (for eksempel ved at bruge SSH-nøglegodkendelse eller sudo).
Den følgende kommando (tilgængelig fra pakken whois
) kan bruges til at oprette en SHA-512-baseret crypt(3)-hash for en adgangskode:
mkpasswd -m sha-512
# Kontrollerer om udstyrets ur er sat til UTC. d-i clock-setup/utc boolean true # Du kan sætte dette til enhver gyldig indstilling for $TZ; se indholdet af # /usr/share/zoneinfo/ for gyldige værdier. d-i time/zone string US/Eastern # Kontrollerer om NTP skal bruges til at sætte uret under installationen d-i clock-setup/ntp boolean true # NTP-server at bruge. Standarden er næsten altid fin her. #d-i clock-setup/ntp-server string ntp.example.com
Using preseeding to partition the harddisk is limited to what is supported by partman-auto
. You can choose to partition either existing free space on a disk or a whole disk. The layout of the disk can be determined by using a predefined recipe, a custom recipe from a recipe file or a recipe included in the preconfiguration file.
Preseeding of advanced partition setups using RAID, LVM and encryption is supported, but not with the full flexibility possible when partitioning during a non-preseeded install.
The examples below only provide basic information on the use of recipes. For detailed information see the files partman-auto-recipe.txt
and partman-auto-raid-recipe.txt
included in the debian-installer
package. Both files are also available from the debian-installer
source repository. Note that the supported functionality may change between releases.
![]() |
Advarsel |
---|---|
Identifikationen af diske er afhængige af rækkefølgen, som deres drivere indlæses i. Hvis der er flere diske i systemet, så sikr dig, at den korrekte vil blive valgt, før forhåndskonfiguration anvendes. |
# If the system has free space you can choose to only partition that space. # This is only honoured if partman-auto/method (below) is not set. #d-i partman-auto/init_automatically_partition select biggest_free # Alternatively, you may specify a disk to partition. If the system has only # one disk the installer will default to using that, but otherwise the device # name must be given in traditional, non-devfs format (so e.g. /dev/sda # and not e.g. /dev/discs/disc0/disc). # For example, to use the first SCSI/SATA hard disk: #d-i partman-auto/disk string /dev/sda # In addition, you'll need to specify the method to use. # The presently available methods are: # - regular: use the usual partition types for your architecture # - lvm: use LVM to partition the disk # - crypto: use LVM within an encrypted partition d-i partman-auto/method string lvm # If one of the disks that are going to be automatically partitioned # contains an old LVM configuration, the user will normally receive a # warning. This can be preseeded away... d-i partman-lvm/device_remove_lvm boolean true # The same applies to pre-existing software RAID array: d-i partman-md/device_remove_md boolean true # And the same goes for the confirmation to write the lvm partitions. d-i partman-lvm/confirm boolean true d-i partman-lvm/confirm_nooverwrite boolean true # You can choose one of the three predefined partitioning recipes: # - atomic: all files in one partition # - home: separate /home partition # - multi: separate /home, /var, and /tmp partitions d-i partman-auto/choose_recipe select atomic # Or provide a recipe of your own... # If you have a way to get a recipe file into the d-i environment, you can # just point at it. #d-i partman-auto/expert_recipe_file string /hd-media/recipe # If not, you can put an entire recipe into the preconfiguration file in one # (logical) line. This example creates a small /boot partition, suitable # swap, and uses the rest of the space for the root partition: #d-i partman-auto/expert_recipe string \ # boot-root :: \ # 40 50 100 ext3 \ # $primary{ } $bootable{ } \ # method{ format } format{ } \ # use_filesystem{ } filesystem{ ext3 } \ # mountpoint{ /boot } \ # . \ # 500 10000 1000000000 ext3 \ # method{ format } format{ } \ # use_filesystem{ } filesystem{ ext3 } \ # mountpoint{ / } \ # . \ # 64 512 300% linux-swap \ # method{ swap } format{ } \ # . # The full recipe format is documented in the file partman-auto-recipe.txt # included in the 'debian-installer' package or available from D-I source # repository. This also documents how to specify settings such as file # system labels, volume group names and which physical devices to include # in a volume group. # This makes partman automatically partition without confirmation, provided # that you told it what to do using one of the methods above. d-i partman-partitioning/confirm_write_new_label boolean true d-i partman/choose_partition select finish d-i partman/confirm boolean true d-i partman/confirm_nooverwrite boolean true # When disk encryption is enabled, skip wiping the partitions beforehand. #d-i partman-auto-crypto/erase_disks boolean false
Du kan også bruge forhåndskonfiguration til at opsætte partitioner på program-RAID-arrayer. Understøttet er RAID-niveauerne 0, 1, 5, 6 og 10, der opretter degraded arrayer og specificerer ledige enheder.
![]() |
Advarsel |
---|---|
This type of automated partitioning is easy to get wrong. It is also functionality that receives relatively little testing from the developers of |
# The method should be set to "raid". #d-i partman-auto/method string raid # Specify the disks to be partitioned. They will all get the same layout, # so this will only work if the disks are the same size. #d-i partman-auto/disk string /dev/sda /dev/sdb # Next you need to specify the physical partitions that will be used. #d-i partman-auto/expert_recipe string \ # multiraid :: \ # 1000 5000 4000 raid \ # $primary{ } method{ raid } \ # . \ # 64 512 300% raid \ # method{ raid } \ # . \ # 500 10000 1000000000 raid \ # method{ raid } \ # . # Last you need to specify how the previously defined partitions will be # used in the RAID setup. Remember to use the correct partition numbers # for logical partitions. RAID levels 0, 1, 5, 6 and 10 are supported; # devices are separated using "#". # Parameters are: # <raidtype> <devcount> <sparecount> <fstype> <mountpoint> \ # <devices> <sparedevices> #d-i partman-auto-raid/recipe string \ # 1 2 0 ext3 / \ # /dev/sda1#/dev/sdb1 \ # . \ # 1 2 0 swap - \ # /dev/sda5#/dev/sdb5 \ # . \ # 0 2 0 ext3 /home \ # /dev/sda6#/dev/sdb6 \ # . # For additional information see the file partman-auto-raid-recipe.txt # included in the 'debian-installer' package or available from D-I source # repository. # This makes partman automatically partition without confirmation. d-i partman-md/confirm boolean true d-i partman-partitioning/confirm_write_new_label boolean true d-i partman/choose_partition select finish d-i partman/confirm boolean true d-i partman/confirm_nooverwrite boolean true
Normally, filesystems are mounted using a universally unique identifier (UUID) as a key; this allows them to be mounted properly even if their device name changes. UUIDs are long and difficult to read, so, if you prefer, the installer can mount filesystems based on the traditional device names, or based on a label you assign. If you ask the installer to mount by label, any filesystems without a label will be mounted using a UUID instead.
Enheder med stabile navne, såsom LVM logiske diskenehder, vil fortsætte med at bruge deres traditionelle navne frem for UUID'er.
![]() |
Advarsel |
---|---|
Traditional device names may change based on the order in which the kernel discovers devices at boot, which may cause the wrong filesystem to be mounted. Similarly, labels are likely to clash if you plug in a new disk or a USB drive, and if that happens your system's behaviour when started will be random. |
# Standarden er at montere efter UUID, men du kan også vælge »traditional« # brug traditionelle enhedsnavne, eller »label« for at prøve filsystemetiketter af # før der faldes tilbage til UUID'er. #d-i partman/mount_style select uuid
Der er faktisk ikke meget som kan forhåndskonfigureres på dette trin af installationen. De eneste spørgsmål, der stilles, vedrører installationen af kernen.
# Konfigurer APT til ikke at installere anbefalede pakker som standard. Brug # af denne indstilling medføre et ufuldstændigt system og bør kun bruges af # meget erfarne brugere. #d-i base-installer/install-recommends boolean false # (Meta)pakken for kerneaftryk at installere; »none« kan bruges hvis ingen # kerne skal installeres. #d-i base-installer/kernel/image string linux-image-686
Opsætning af /etc/apt/sources.list
og grundlæggende konfigurationsindstillinger er fuldt automatiseret baseret på din installationsmetode og svarer til tidligere spørgsmål. Du kan valgfrit tilføje andre (lokale) arkiver.
# Du kan vælge at installere programmer fra non-free og contrib. #d-i apt-setup/non-free boolean true #d-i apt-setup/contrib boolean true # Fjern udkommentering hvis du ikke ønsker at bruge et netværksspejl. #d-i apt-setup/use_mirror boolean false # Vælg opdateringstjenesten; definer spejlene. # Værdier vist nedenfor er de normale standarder. #d-i apt-setup/services-select multiselect security, updates #d-i apt-setup/security_host string security.debian.org # Yderligere arkiver, local[0-9] tilgængelig #d-i apt-setup/local0/repository string \ # http://local.server/debian stable main #d-i apt-setup/local0/comment string local server # Aktiver deb-src-linjer #d-i apt-setup/local0/source boolean true # Adresse til den offentlige nøgle for det lokale arkiv; du skal angive en # ellers vil apt beklage sig over et arkiv uden godkendelse og så vil # linjen sources.list blive efterladt udkommenteret #d-i apt-setup/local0/key string http://local.server/key # Som standard kræver installationsprogrammet at arkiverne godkendes # via en kendt gpg-nøgle. Denne indstilling kan bruges til at deaktivere den # godkendelse. Advarsel: Usikker, anbefales ikke. #d-i debian-installer/allow_unauthenticated boolean true # Fjern # for at tilføje flerarkitekturkonfiguration for i386 #d-i apt-setup/multiarch string i386
Du kan vælge at installere enhver kombination af opgaver, som er tilgængelige. Tilgængelige opgaver, da dette skrives, inkluderer:
standard
(standardværktøjer)
desktop
(grafisk skrivebord)
gnome-desktop
(GNOME-skrivebord)
xfce-desktop
(XFCE-skrivebord)
kde-desktop
(KDE Plasma-skrivebord)
cinnamon-desktop
(Cinnamonskrivebord)
mate-desktop
(MATE-skrivebord)
lxde-desktop
(LXDE-skrivebord)
web-server
(netserver)
print-server
(printerserver)
ssh-server
(SSH-server)
Du kan også vælge ikke at installere opgaver og tvinge installationen af et sæt af pakke igennem på en anden måde. Vi anbefaler altid inkludering af standardopgaven
.
Hvis du ønsker at installere nogle individuelle pakker udover pakkerne installeret af tasks, så kan du bruge parameteren pkgsel/include
. Værdien for denne parameter kan være en liste af pakker adskilt af enten kommaer eller mellemrum, som gør at den kan nemt kan bruges på kernes kommandolinje.
#tasksel tasksel/first multiselect standard, web-server, kde-desktop # Individual additional packages to install #d-i pkgsel/include string openssh-server build-essential # Whether to upgrade packages after debootstrap. # Allowed values: none, safe-upgrade, full-upgrade #d-i pkgsel/upgrade select none # Some versions of the installer can report back on what software you have # installed, and what software you use. The default is not to report back, # but sending reports helps the project determine what software is most # popular and include it on CDs. #popularity-contest popularity-contest/participate boolean false
# During installations from serial console, the regular virtual consoles # (VT1-VT6) are normally disabled in /etc/inittab. Uncomment the next # line to prevent this. #d-i finish-install/keep-consoles boolean true # Avoid that last message about the install being complete. d-i finish-install/reboot_in_progress note # This will prevent the installer from ejecting the CD during the reboot, # which is useful in some situations. #d-i cdrom-detect/eject boolean false # This is how to make the installer shutdown when finished, but not # reboot into the installed system. #d-i debian-installer/exit/halt boolean true # This will power off the machine instead of just halting it. #d-i debian-installer/exit/poweroff boolean true
# Afhængig af hvilke programmer du vælger at installere, eller hvis noget # går galt under installationsprocessen, så er det muligt at andre spørgsmål # kan stilles. Du kan selvfølgelig også forhåndskonfigurere disse. For en liste # over alle de mulige spørgsmål, der kan stilles under en installation, udføres en # installation, og disse kommandoer afvikles: # debconf-get-selections --installer > file # debconf-get-selections >> file
[21] Forhåndskonfiguration af locale
til en_NL
vil for eksempel medføre en_US.UTF-8
som standardsted for det installerede system. Hvis f.eks. en_GB.UTF-8
foretrækkes i stedet for, så skal værdierne forhåndskonfigureres individuelt.