Skip to content
This repository was archived by the owner on Jan 18, 2022. It is now read-only.

Commit d26bad4

Browse files
sylvestreroot
authored and
root
committed
Upgrade configuration for debian stretch
1 parent e0971c1 commit d26bad4

File tree

3 files changed

+58
-48
lines changed

3 files changed

+58
-48
lines changed

Diff for: firstboot

+10-10
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,16 @@ sleep 60
1111

1212
# install our new sources
1313
cat > /etc/apt/sources.list <<EOF
14-
deb http://$PXESERVER:3142/debian wheezy main contrib non-free
15-
deb http://debian.saltstack.com/debian wheezy-saltstack main
14+
deb http://$PXESERVER:3142/debian stretch main contrib non-free
15+
deb http://repo.saltstack.com/apt/debian/9/amd64/latest stretch main
1616
1717
EOF
1818

19-
echo "APT::Get::AllowUnauthenticated yes;" > /etc/apt/apt.conf.d/99auth
19+
#echo "APT::Get::AllowUnauthenticated yes;" > /etc/apt/apt.conf.d/99auth
2020

2121
# add salt key
22-
wget -q -O- "http://debian.saltstack.com/debian-salt-team-joehealy.gpg.key" | apt-key add -
22+
wget -O - https://repo.saltstack.com/apt/debian/9/amd64/latest/SALTSTACK-GPG-KEY.pub | apt-key add -
23+
2324

2425
# update apt
2526
/usr/bin/apt-get update
@@ -29,23 +30,22 @@ apt-get install --yes --no-install-recommends --force-yes salt-minion
2930

3031
sed -i -e "s|#master: salt|master: $PXESERVER|" /etc/salt/minion
3132

32-
/etc/init.d/salt-minion restart
33-
3433
# download configuration files
3534
/usr/bin/curl -o /tmp/iplist http://$PXESERVER/iplist
3635

3736
# get ip and detect hostname
38-
_ip=`ip addr list eth0 |grep 'inet ' |cut -d' ' -f6|cut -d/ -f1`
37+
_ip=`ip addr list eno1 |grep 'inet ' |cut -d' ' -f6|cut -d/ -f1`
3938
hostname=`grep $_ip /tmp/iplist | awk '{print $1}'`
4039
rm /tmp/iplist
4140

4241
# set hostname
4342
echo $hostname > /etc/hostname
44-
/etc/init.d/hostname.sh
43+
echo $hostname > /etc/salt/minion_id
44+
45+
/etc/init.d/salt-minion restart
4546

4647
# Remove our firstboot service so that it won't run again
47-
update-rc.d firstboot remove
48-
rm /etc/init.d/firstboot /root/firstboot
48+
rm -f /etc/init.d/firstboot /root/firstboot /lib/systemd/system/firstboot.service
4949

5050
# Reboot into the new kernel
5151
/sbin/reboot

Diff for: postinstall

+25
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,30 @@
44
/usr/bin/curl -o /root/firstboot http://10.0.0.1/firstboot
55
chmod +x /root/firstboot
66

7+
8+
# create a service that will run our firstboot script
9+
cat > /lib/systemd/system/firstboot.service << EOF
10+
11+
[Unit]
12+
Description=Firstboot script
13+
14+
[Service]
15+
Type=simple
16+
WorkingDirectory=/root/
17+
ExecStart=/root/firstboot
18+
SyslogIdentifier=firstboot
19+
20+
[Install]
21+
WantedBy=multi-user.target
22+
EOF
23+
24+
ln -s /lib/systemd/system/firstboot.service /etc/systemd/system/multi-user.target.wants/fistboot.service
25+
systemctl enable firstboot
26+
systemctl unmask firstboot
27+
28+
echo "finished postinst"
29+
exit 0
30+
731
# create a service that will run our firstboot script
832
cat > /etc/init.d/firstboot << EOF
933
### BEGIN INIT INFO
@@ -24,5 +48,6 @@ EOF
2448
# install the firstboot service
2549
chmod +x /etc/init.d/firstboot
2650
update-rc.d firstboot defaults
51+
systemctl enable firstboot
2752

2853
echo "finished postinst"

Diff for: preseed.cfg

+23-38
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,41 @@
1-
#d-i anna/choose_modules string network-console
2-
#d-i network-console/password password password++
3-
#d-i network-console/password-again password password++
4-
#d-i network-console/start select continue
5-
d-i debian-installer/locale string en_US
6-
d-i console-keymaps-at/keymap select us
7-
d-i console-setup/ask_detect boolean false
1+
d-i debian-installer/country string US
2+
d-i debian-installer/locale string en_US.UTF-8
3+
d-i debian-installer/language string en
84
d-i keyboard-configuration/xkb-keymap select us
9-
d-i keyboard-configuration/layoutcode string us
5+
d-i passwd/user-fullname string
6+
d-i passwd/username string debian
7+
d-i passwd/root-password password password++
8+
d-i passwd/root-password-again password password++
9+
d-i passwd/user-password password debian++
10+
d-i passwd/user-password-again password debian++
11+
d-i user-setup/allow-password-weak boolean true
1012
d-i netcfg/choose_interface select auto
11-
d-i netcfg/get_hostname string noconfigured
12-
d-i netcfg/get_domain string example.com
13-
d-i netcfg/no_default_route boolean true
13+
d-i netcfg/get_hostname string unassigned-hostname
14+
d-i netcfg/get_domain string unassigned-domain
1415
d-i mirror/country string manual
15-
d-i mirror/protocol string http
1616
d-i mirror/http/hostname string 10.0.0.1:3142
17-
d-i mirror/http/directory string /debian/
17+
d-i mirror/http/directory string /debian
1818
d-i mirror/http/proxy string
19-
d-i mirror/suite string wheezy
20-
d-i time/zone string Europe/Paris
2119
d-i clock-setup/utc boolean true
2220
d-i clock-setup/ntp boolean true
21+
d-i time/zone string Europe/Paris
22+
d-i partman/confirm boolean true
23+
d-i partman/choose_partition select finish
24+
d-i partman/confirm_nooverwrite boolean true
2325
d-i partman-auto/disk string /dev/sda
2426
d-i partman-auto/method string regular
2527
d-i partman-lvm/device_remove_lvm boolean true
26-
#d-i partman-md/device_remove_md boolean true
27-
#d-i partman-auto-lvm/guided_size string 200G
28-
d-i partman-auto/choose_recipe select atomic
29-
d-i partman/default_filesystem string ext4
30-
#d-i partman-auto/expert_recipe string \
31-
# debile-blade :: \
32-
# 500 10000 1000000000 ext4 \
33-
# method{ format } format{ } \
34-
# use_filesystem{ } filesystem{ ext4 } \
35-
# mountpoint{ / } \
36-
#. \
37-
# 64 512 300% linux-swap \
38-
# method{ swap } format{ } \
28+
d-i partman-lvm/confirm boolean true
29+
d-i partman-lvm/confirm_nooverwrite boolean true
30+
d-i partman-auto-lvm/guided_size string max
3931
d-i partman-partitioning/confirm_write_new_label boolean true
40-
d-i partman/choose_partition select finish
41-
d-i partman/confirm boolean true
42-
d-i partman/confirm_nooverwrite boolean true
43-
d-i passwd/root-login boolean true
44-
d-i passwd/make-user boolean false
45-
d-i passwd/root-password password password++
46-
d-i passwd/root-password-again password password++
47-
#d-i user-setup/allow-password-weak boolean true
48-
#d-i apt-setup/restricted boolean true
32+
d-i grub-installer/grub2_instead_of_grub_legacy boolean true
33+
d-i grub-installer/only_debian boolean true
34+
d-i grub-installer/bootdev string /dev/[sv]da
4935
tasksel tasksel/first multiselect standard
5036
d-i pkgsel/include string openssh-server curl lsb-release ntp
5137
d-i grub-installer/only_debian boolean true
5238
d-i grub-installer/with_other_os boolean true
53-
popularity-contest popularity-contest/participate boolean false
5439
d-i finish-install/reboot_in_progress note
5540
# Once the installation is done we'll set the system up for some firstboot
5641
# magic.

0 commit comments

Comments
 (0)