-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpreseed.cfg
121 lines (105 loc) · 4.96 KB
/
preseed.cfg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
#_preseed_V1
#
# Preseed configuration for debian 11/bullseye
#
# ATTENTION: This preseed configuration ERASES the target disks
# without any confirmation whatsoever.
#
# base example can be found here:
# https://www.debian.org/releases/bullseye/example-preseed.txt
#
# additional directives were determined by doing a base install, and then
# $ apt install debconf-utils
# $ debconf-get-selections --installer > debconf-selections.txt
# $ debconf-get-selections >> debconf-selections.txt
#
# Locale
d-i debian-installer/language string en_US:en
d-i debian-installer/country string US
d-i debian-installer/locale string en_US.UTF-8
d-i localechooser/supported-locales multiselect en_US.UTF8
# Keyboard selection.
d-i keyboard-configuration/xkb-keymap skip-config
d-i keyboard-configuration/layout string "American English"
# Network configuration
d-i hw-detect/load_firmware boolean true
d-i netcfg/enable boolean true
d-i netcfg/choose_interface select auto
# Important! the next few lines do not work, by the time the preseed happens, netcfg has already decided on the hostname and the domain name, so these are not applied
# https://unix.stackexchange.com/q/106614
# d-i netcfg/hostname string vagrant # temporary hostname, final is set in late_command
# d-i netcfg/get_domain string local
# Apt
d-i apt-setup/cdrom/set-first boolean false
d-i apt-setup/cdrom/set-next boolean false
d-i apt-setup/cdrom/set-failed boolean false
d-i mirror/country string manual
d-i mirror/http/hostname string deb.debian.org
d-i mirror/http/directory string /debian
d-i mirror/http/proxy string
# Users & Passwords
## root
d-i passwd/root-login boolean false
## user
d-i passwd/make-user boolean true
d-i passwd/user-fullname string Vagrant User
d-i passwd/username string vagrant
d-i passwd/user-password password vagrant
d-i passwd/user-password-again password vagrant
d-i user-setup/allow-password-weak boolean true
d-i user-setup/encrypt-home boolean false
# Clock
d-i clock-setup/utc boolean true
d-i time/zone string US/Eastern
d-i clock-setup/utc-auto boolean true
d-i clock-setup/ntp boolean true
# Disk partition
# d-i partman-auto/init_automatically_partition select biggest_free # this is not honored since partman-auto/method (below) is set
d-i partman-auto/disk string /dev/nvme0n1
d-i partman-auto/method string regular
d-i partman-lvm/device_remove_lvm boolean true # note: this should not exist, but preseed away any warnings about overwriting existing lvm configuration
d-i partman-md/device_remove_md boolean true # note: this should not exist, but preseed away any warnings about overwriting existing software RAID array
d-i partman-auto/choose_recipe select atomic # atomic: all files in one partition
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
d-i partman/mount_style select label
# Base system installation
d-i base-installer/install-recommends boolean false
d-i base-installer/kernel/override-image string linux-image-$(uname -r)
# Apt setup
d-i apt-setup/non-free boolean true
d-i apt-setup/contrib boolean true
d-i apt-setup/use_mirror boolean true
d-i apt-setup/services-select multiselect security, updates
d-i apt-setup/security_host string security.debian.org
# Package selection
d-i pkgsel/run_tasksel boolean true
d-i tasksel/first multiselect ssh-server, standard
tasksel tasksel/first multiselect standard, ssh-server
d-i pkgsel/upgrade select safe-upgrade
d-i pkgsel/update-policy select none
d-i pkgsel/updatedb boolean true
popularity-contest popularity-contest/participate boolean false
# Boot loader installation
d-i grub-installer/only_debian boolean true
d-i grub-installer/with_other_os boolean true
d-i debian-installer/add-kernel-opts string ipv6.disable=1 swapaccount=1 nousb
d-i grub-installer/force-efi-extra-removable boolean true
d-i grub-installer/progress/step_force_efi_removable boolean true
d-i grub-installer/bootdev string default
d-i preseed/late_command string \
HOST_SUFFIX="debian-$(head /dev/urandom | tr -dc a-z0-9 | head -c8)" ; \
echo "vagrant ALL=(ALL) NOPASSWD: ALL" > /target/etc/sudoers.d/vagrant ; \
sed -i "s/vagrant/$HOST_SUFFIX/g" /target/etc/hostname ; \
sed -i "s/vagrant/$HOST_SUFFIX/g" /target/etc/hosts ; \
in-target sh -c 'mkdir -pv --mode=0700 /vagrant/.ssh'; \
in-target sh -c 'echo "ssh-rsa AAAAB//..." > /vagrant/.ssh/authorized_keys'; \
in-target chown --recursive vagrant:vagrant /vagrant/.ssh; \
in-target chmod 0600 /vagrant/.ssh/authorized_keys; \
in-target systemctl enable --now sshd; \
in-target update-grub \
d-i finish-install/keep-consoles boolean true
d-i finish-install/reboot_in_progress note
d-i cdrom-detect/eject boolean true