3
3
#
4
4
# functions
5
5
#
6
- # (c) 2007-2022 , Hetzner Online GmbH
6
+ # (c) 2007-2024 , Hetzner Online GmbH
7
7
#
8
8
9
9
@@ -179,9 +179,8 @@ generate_menu() {
179
179
case $IMAGENAME in
180
180
Proxmox-Virtualization-Environment* )
181
181
case " $IMAGENAME " in
182
+ Proxmox-Virtualization-Environment-on-Debian-Bookworm) export PROXMOX_VERSION=" 8" ;;
182
183
Proxmox-Virtualization-Environment-on-Debian-Bullseye) export PROXMOX_VERSION=" 7" ;;
183
- Proxmox-Virtualization-Environment-on-Debian-Buster) export PROXMOX_VERSION=" 6" ;;
184
- Proxmox-Virtualization-Environment-on-Debian-Stretch) export PROXMOX_VERSION=" 5" ;;
185
184
esac
186
185
cp " $SCRIPTPATH /post-install/proxmox$PROXMOX_VERSION " /post-install
187
186
chmod 0755 /post-install
@@ -811,7 +810,7 @@ if [ -n "$1" ]; then
811
810
done < /tmp/part_lines.tmp
812
811
813
812
# get encryption password
814
- CRYPTPASSWORD=" $( grep -e ' ^CRYPTPASSWORD ' " $1 " ) "
813
+ CRYPTPASSWORD=" $( grep -m 1 ' ^CRYPTPASSWORD ' " $1 " | cut -d ' ' -f 2- | sed -z ' s/\n$// ' ) "
815
814
816
815
# get LVM volume group config
817
816
LVM_VG_COUNT=" $( egrep -c ' ^PART *lvm ' " $1 " ) "
@@ -958,6 +957,11 @@ if [ -n "$1" ]; then
958
957
fi
959
958
# keep dell_r6415 default
960
959
(( use_kernel_mode_setting_given == 0 )) && is_dell_r6415 && USE_KERNEL_MODE_SETTING=1
960
+
961
+ # set n to disable kms
962
+ if [[ " $( tac " $1 " | grep -m1 ^USE_KERNEL_MODE_SETTING | awk ' {print $2}' ) " =~ ^n ]]; then
963
+ export USE_KERNEL_MODE_SETTING=0
964
+ fi
961
965
fi
962
966
963
967
:
@@ -1632,7 +1636,7 @@ validate_vars() {
1632
1636
fi
1633
1637
1634
1638
if is_cpanel_install; then
1635
- if [ " $IAM " != " centos" -a " $IAM " != " almalinux" ]; then
1639
+ if [ " $IAM " != " centos" -a " $IAM " != " almalinux" -a " $IAM " != " ubuntu " ]; then
1636
1640
graph_error " ERROR: CPANEL is not available for this image"
1637
1641
return 1
1638
1642
fi
@@ -2211,11 +2215,7 @@ make_fstab_entry() {
2211
2215
elif [[ " $3 " =~ ^btrfs\. [0-9A-Za-z]+ ]] ; then
2212
2216
ENTRY=" # $1 $p $2 belongs to btrfs volume '$3 '"
2213
2217
else
2214
- if [ " $SYSTYPE " = " vServer" -a " $4 " = ' ext4' ]; then
2215
- ENTRY=" $1 $p $2 $3 $4 defaults,discard 0 0"
2216
- else
2217
- ENTRY=" $1 $p $2 $3 $4 defaults 0 0"
2218
- fi
2218
+ ENTRY=" $1 $p $2 $3 $4 defaults 0 0"
2219
2219
fi
2220
2220
2221
2221
if [ " $5 " = " crypt" ]; then
@@ -2587,7 +2587,7 @@ format_partitions() {
2587
2587
encrypt_partitions () {
2588
2588
if [ " $1 " -a " $2 " ]; then
2589
2589
local fstab=" $1 "
2590
- local cryptpassword=" $( echo " $2 " | awk ' {print $2} ' ) "
2590
+ local cryptpassword=" $2 "
2591
2591
local dev
2592
2592
local dev_uuid
2593
2593
@@ -2600,9 +2600,9 @@ encrypt_partitions() {
2600
2600
else
2601
2601
dev=" $( echo " $line " | grep " crypted" | awk ' {print $1}' ) "
2602
2602
fi
2603
- echo -n " ${cryptpassword} " | cryptsetup --cipher aes-xts-plain64 --key-size 256 --hash sha256 --iter-time 6000 --batch-mode luksFormat " $dev " -
2603
+ cryptsetup --cipher aes-xts-plain64 --key-size 256 --hash sha256 --iter-time 6000 --batch-mode luksFormat " $dev " <<< " $cryptpassword "
2604
2604
dev_uuid=$( blkid $dev -o value -s UUID)
2605
- echo -n " ${cryptpassword} " | cryptsetup --batch-mode luksOpen " $dev " " luks-${dev_uuid} " -
2605
+ cryptsetup --batch-mode luksOpen " $dev " " luks-${dev_uuid} " <<< " $cryptpassword "
2606
2606
touch " $FOLD /crypttab"
2607
2607
echo " luks-${dev_uuid} UUID=${dev_uuid} none luks" >> " $FOLD /crypttab"
2608
2608
sed -i -e " s+$dev +/dev/mapper/luks-${dev_uuid} +g" " $FOLD /fstab"
@@ -4163,4 +4163,35 @@ is_usb_disk() {
4163
4163
echo " $udevadm_info " | grep --quiet ' ID_USB_DRIVER=usb-storage'
4164
4164
}
4165
4165
4166
+ free_port_53 () {
4167
+ systemctl -q is-active systemd-resolved || return
4168
+
4169
+ debug ' # stopping rescue system systemd-resolved'
4170
+
4171
+ systemctl stop systemd-resolved || return 1
4172
+
4173
+ debug ' # updating /etc/resolv.conf'
4174
+
4175
+ if [[ -L /etc/resolv.conf ]]; then
4176
+ mv -v /etc/resolv.con{f,f.bak} | debugoutput
4177
+ else
4178
+ cp -v /etc/resolv.con{f,f.bak} | debugoutput
4179
+ fi
4180
+
4181
+ {
4182
+ while read nsaddr; do
4183
+ echo " nameserver $nsaddr "
4184
+ done < <( randomized_nsaddrs)
4185
+ } > /etc/resolv.conf
4186
+
4187
+ diff -Naur /etc/resolv.con{f.bak,f} | debugoutput
4188
+
4189
+ debug ' # updating /run/systemd/resolve/stub-resolv.conf'
4190
+
4191
+ cp /run/systemd/resolve/stub-resolv.con{f,f.bak}
4192
+ cp /etc/resolv.conf /run/systemd/resolve/stub-resolv.conf
4193
+
4194
+ diff -Naur /run/systemd/resolve/stub-resolv.con{f.bak,f} | debugoutput
4195
+ }
4196
+
4166
4197
# vim: ai:ts=2:sw=2:et
0 commit comments