generated from HariSekhon/Template-Repo
-
Notifications
You must be signed in to change notification settings - Fork 6
/
preseed.cfg
143 lines (115 loc) · 5.33 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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
#_preseed_V1
#
# Author: Hari Sekhon
# Date: 2023-05-30 17:29:25 +0100 (Tue, 30 May 2023)
#
# vim:ts=4:sts=4:sw=4:et
#
# https://github.com/HariSekhon/Packer
#
# License: see accompanying Hari Sekhon LICENSE file
#
# If you're using my code you're welcome to connect with me on LinkedIn and optionally send me feedback to help steer this or other code I publish
#
# https://www.linkedin.com/in/HariSekhon
#
# ============================================================================ #
# D e b i a n P r e s e e d
# ============================================================================ #
# https://www.debian.org/releases/stretch/amd64/apbs04.html.en
# https://www.debian.org/releases/stretch/amd64/apbs05.html.en
# All options:
#
# https://preseed.debian.net/debian-preseed/
d-i debian-installer/locale string en_GB
d-i keyboard-configuration/xkb-keymap select gb
choose-mirror-bin mirror/http/proxy string
d-i netcfg/choose_interface select auto
#d-i netcfg/choose_interface select eth1
d-i netcfg/get_hostname string server1
d-i netcfg/get_domain string domain.local
# overrides DHCP / reverse DNS hostname
#d-i netcfg/hostname string server1
d-i clock-setup/utc boolean true
d-i time/zone string UTC
d-i clock-setup/ntp boolean true
# NTP server to use. The default is almost always fine here.
#d-i clock-setup/ntp-server string ntp.example.com
#d-i clock-setup/ntp-server string 0.debian.pool.ntp.org
# if 'hwclock' gets stuck trying to set the hardward clock
#d-i clock-setup/hwclock-wait boolean false
d-i partman-auto/method string lvm
d-i partman-auto-lvm/guided_size string max
d-i partman-lvm/device_remove_lvm boolean true
d-i partman-md/device_remove_md boolean true
d-i partman-lvm/confirm boolean true
d-i partman-lvm/confirm_nooverwrite boolean true
d-i partman-auto/choose_recipe select atomic
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 passwd/root-login boolean false
d-i passwd/user-fullname string packer
d-i passwd/username string packer
d-i passwd/user-uid string 1000
d-i passwd/user-password password packer
d-i passwd/user-password-again password packer
d-i user-setup/allow-password-weak boolean true
d-i user-setup/encrypt-home boolean false
# don't ask to scan another cd/dvd media and go straight to network mirror packages instead
d-i apt-setup/cdrom/set-first boolean false
#d-i apt-setup/cdrom/set-next boolean false
#d-i apt-setup/cdrom/set-double boolean false
d-i mirror/country string uk
#d-i mirror/http/hostname string ftp.uk.debian.org
d-i mirror/http/hostname string deb.debian.org
d-i mirror/http/directory string /debian
d-i mirror/http/proxy string
d-i apt-setup/use_mirror boolean true
#d-i mirror/http/countries select United Kingdom
#d-i mirror/http/mirror select deb.debian.org
d-i apt-setup/non-free boolean true
d-i apt-setup/contrib boolean true
d-i apt-setup/services-select multiselect security, updates
d-i apt-setup/security_host string security.debian.org
tasksel tasksel/first multiselect standard, ssh-server
d-i pkgsel/include string openssh-server debconf-utils curl iptables iputils-ping less net-tools ntp ntpdate procps psmisc tcpdump tmux traceroute wget vim
d-i pkgsel/install-language-support boolean false
# Whether to upgrade packages after debootstrap.
# Allowed values: none, safe-upgrade, full-upgrade
d-i pkgsel/upgrade select full-upgrade
d-i pkgsel/update-policy select none
popularity-contest popularity-contest/participate boolean false
d-i grub-installer/bootdev string default
#d-i grub-installer/bootdev string /dev/sda
d-i grub-installer/only_debian boolean true
# overwrite MBR even if another OS exists there
d-i grub-installer/with_other_os 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
# debconf-get-selections --installer > file
# debconf-get-selections >> file
#d-i preseed/early_command string systemctl stop sshd # not running during install unlike on Ubuntu AutoInstaller
# for installations from preseeding from 2nd cdrom drive such as Arm Tart on new Macs M1/M2 - turns out this is not needed
#d-i preseed/early_command string \
# umount /mnt/cdrom2;
# echo 1 > /sys/block/vdb/device/delete
# /etc/sudoers.d directory doesn't exist in early stage, try late stage
#d-i preseed/early_command string \
#d-i preseed/late_command string \
# sh -c 'mkdir -pv /etc/sudoers.d && echo "packer ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/packer';
#in-target sh -c 'mkdir -pv /etc/sudoers.d && echo "packer ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/packer'
# debconf-get-selections doesn't exist and the db doesn't exist at this stage either
#d-i preseed/late_command string \
# debconf-get-selections --installer > /target/var/log/preseed.cfg || \
# in-target sh -c 'debconf-get-selections --installer > /var/log/preseed.cfg'
d-i preseed/late_command string \
# Import my SSH key from GitHub
ssh-import-id gh:harisekhon; \
sh -c 'printf "%-30s %s\n" "Build Date:" "`date`" >> /etc/build_release'; \
sed -i 's/^ca:/#ca:/' /etc/inittab; \
sed -i 's/^deb cdrom/#deb cdrom/' /etc/apt/sources.list