Skip to content

Commit 8bf61da

Browse files
authored
Merge pull request #5 from syself/tg/merge-upstream-into-fork
🌱 Merge changes from upstream into our fork
2 parents 1c32750 + 458d664 commit 8bf61da

20 files changed

+507
-171
lines changed

config.sh

+4-7
Original file line numberDiff line numberDiff line change
@@ -88,16 +88,14 @@ export OSMENULIST+=(
8888
"Custom image" "(Config for custom images)"
8989
)
9090

91-
export PROXMOX4_BASE_IMAGE="Debian-811-jessie-64-minimal"
92-
export PROXMOX5_BASE_IMAGE="Debian-913-stretch-64-minimal"
93-
export PROXMOX6_BASE_IMAGE="Debian-1013-buster-64-minimal"
94-
export PROXMOX7_BASE_IMAGE="Debian-1107-bullseye-amd64-base"
91+
export PROXMOX7_BASE_IMAGE="Debian-bullseye-latest-amd64-base"
92+
export PROXMOX8_BASE_IMAGE="Debian-bookworm-latest-amd64-base"
9593

9694
export CPANEL_INSTALLER_SRC=http://mirror.hetzner.com/tools/cpanelinc/cpanel
9795

9896
export PLESK_INSTALLER_SRC=http://mirror.hetzner.com/tools/parallels/plesk
9997
export PLESK_MIRROR=http://mirror.hetzner.com/plesk
100-
export PLESK_STD_VERSION=PLESK_18_0_53
98+
export PLESK_STD_VERSION=PLESK_18_0_57
10199
export PLESK_DOWNLOAD_RETRY_COUNT=999
102100
export PLESK_COMPONENTS=(
103101
awstats
@@ -144,9 +142,8 @@ export ARCHLINUX_BOOTSTRAP="$ARCHLINUX_DIR/archlinux-bootstrap-latest-x86_64.tar
144142

145143
other_images() {
146144
find "$IMAGESPATH"/ -maxdepth 1 -type f -name "CoreOS*" -a -not -name "*.sig" -printf '%f\n'
145+
echo 'Proxmox-Virtualization-Environment-on-Debian-Bookworm'
147146
echo 'Proxmox-Virtualization-Environment-on-Debian-Bullseye'
148-
echo 'Proxmox-Virtualization-Environment-on-Debian-Buster'
149-
echo 'Proxmox-Virtualization-Environment-on-Debian-Stretch'
150147
find "$IMAGESPATH/" -maxdepth 1 -type f -iname '*beta*' -a -not -name '*.sig' -printf '%f\n'
151148
}
152149

configs/proxmox6

-20
This file was deleted.

configs/proxmox7

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ PART lvm vg0 all
1717
LV vg0 root / ext4 15G
1818
LV vg0 swap swap swap 6G
1919

20-
IMAGE /root/images/Debian-1107-bullseye-amd64-base.tar.gz
20+
IMAGE /root/images/Debian-bullseye-latest-amd64-base.tar.gz

configs/proxmox5 renamed to configs/proxmox8

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
## ===================================================
32
## Hetzner Online GmbH - installimage - Proxmox-VE
43
## ===================================================
@@ -18,4 +17,4 @@ PART lvm vg0 all
1817
LV vg0 root / ext4 15G
1918
LV vg0 swap swap swap 6G
2019

21-
IMAGE /root/images/Debian-913-stretch-64-minimal.tar.gz
20+
IMAGE /root/images/Debian-bookworm-latest-amd64-base.tar.gz

configs/simple-debian64-noraid

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ SWRAIDLEVEL 1
88

99
BOOTLOADER grub
1010

11-
HOSTNAME Debian-1101-bullseye-amd64-base
11+
HOSTNAME Debian-stable-amd64-base
1212

1313
PART swap swap 8G
1414
PART /boot ext3 1024M
1515
PART / ext4 all
1616

17-
IMAGE /root/images/Debian-1106-bullseye-amd64-base.tar.gz
17+
IMAGE /root/images/Debian-stable-amd64-base.tar.gz

configs/simple-debian64-raid

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ SWRAIDLEVEL 1
77

88
BOOTLOADER grub
99

10-
HOSTNAME Debian-1101-bullseye-amd64-base
10+
HOSTNAME Debian-stable-amd64-base
1111

1212
PART swap swap 2G
1313
PART /boot ext3 1024M
1414
PART / ext4 all
1515

16-
IMAGE /root/images/Debian-1106-bullseye-amd64-base.tar.gz
16+
IMAGE /root/images/Debian-stable-amd64-base.tar.gz

configs/simple-debian64-raid-lvm

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ SWRAIDLEVEL 1
77

88
BOOTLOADER grub
99

10-
HOSTNAME Debian-1101-bullseye-amd64-base
10+
HOSTNAME Debian-stable-amd64-base
1111

1212
PART /boot ext3 1024M
1313
PART lvm vg0 all
1414

1515
LV vg0 root / ext4 20G
1616
LV vg0 swap swap swap 4G
1717

18-
IMAGE /root/images/Debian-1106-bullseye-amd64-base.tar.gz
18+
IMAGE /root/images/Debian-stable-amd64-base.tar.gz

cpanel.functions.sh

+15-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#
44
# cpanel functions
55
#
6-
# (c) 2008-2018, Hetzner Online GmbH
6+
# (c) 2008-2024, Hetzner Online GmbH
77
#
88

99
# is_cpanel_install()
@@ -121,6 +121,11 @@ prevent_outdated_keyring_issues() {
121121
execute_chroot_command 'yum makecache'
122122
}
123123

124+
install_ubuntu_2004_cpanel_depenencies() {
125+
execute_chroot_command 'apt-get update' || return 1
126+
execute_chroot_command 'apt-get -y install dirmngr libfindbin-libs-perl' || return 1
127+
}
128+
124129
# install_cpanel()
125130
install_cpanel() {
126131
if [[ "$IAM" == 'almalinux' ]]; then
@@ -139,8 +144,14 @@ install_cpanel() {
139144
chmod a+x "${FOLD}/hdd/${temp_file}"
140145
debug 'downloaded cpanel installer'
141146

142-
execute_chroot_command 'yum check-update' # || return 1
143-
execute_chroot_command 'yum -y install yum-utils' || return 1
147+
if rhel_based_image; then
148+
execute_chroot_command 'yum check-update' # || return 1
149+
execute_chroot_command 'yum -y install yum-utils' || return 1
150+
fi
151+
152+
if [[ "$IAM" == 'ubuntu' ]] && (( IMG_VERSION == 2004 )); then
153+
install_ubuntu_2004_cpanel_depenencies || return 1
154+
fi
144155

145156
if [[ -e "$FOLD/hdd/usr/bin/needs-restarting" ]]; then
146157
mv "$FOLD/hdd/usr/bin/needs-restarting" "$FOLD/hdd/usr/bin/needs-restarting.bak"
@@ -156,6 +167,7 @@ install_cpanel() {
156167
if installed_os_uses_systemd && ! systemd_nspawn_booted; then
157168
boot_systemd_nspawn || return 1
158169
fi
170+
159171
execute_command "${command}" || return 1
160172
systemd_nspawn_booted && poweroff_systemd_nspawn
161173

functions.sh

+44-13
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#
44
# functions
55
#
6-
# (c) 2007-2022, Hetzner Online GmbH
6+
# (c) 2007-2024, Hetzner Online GmbH
77
#
88

99

@@ -179,9 +179,8 @@ generate_menu() {
179179
case $IMAGENAME in
180180
Proxmox-Virtualization-Environment*)
181181
case "$IMAGENAME" in
182+
Proxmox-Virtualization-Environment-on-Debian-Bookworm) export PROXMOX_VERSION="8" ;;
182183
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" ;;
185184
esac
186185
cp "$SCRIPTPATH/post-install/proxmox$PROXMOX_VERSION" /post-install
187186
chmod 0755 /post-install
@@ -811,7 +810,7 @@ if [ -n "$1" ]; then
811810
done < /tmp/part_lines.tmp
812811

813812
# get encryption password
814-
CRYPTPASSWORD="$(grep -e '^CRYPTPASSWORD ' "$1")"
813+
CRYPTPASSWORD="$(grep -m 1 '^CRYPTPASSWORD ' "$1" | cut -d ' ' -f 2- | sed -z 's/\n$//')"
815814

816815
# get LVM volume group config
817816
LVM_VG_COUNT="$(egrep -c '^PART *lvm ' "$1")"
@@ -958,6 +957,11 @@ if [ -n "$1" ]; then
958957
fi
959958
# keep dell_r6415 default
960959
(( 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
961965
fi
962966

963967
:
@@ -1632,7 +1636,7 @@ validate_vars() {
16321636
fi
16331637

16341638
if is_cpanel_install; then
1635-
if [ "$IAM" != "centos" -a "$IAM" != "almalinux" ]; then
1639+
if [ "$IAM" != "centos" -a "$IAM" != "almalinux" -a "$IAM" != "ubuntu" ]; then
16361640
graph_error "ERROR: CPANEL is not available for this image"
16371641
return 1
16381642
fi
@@ -2211,11 +2215,7 @@ make_fstab_entry() {
22112215
elif [[ "$3" =~ ^btrfs\.[0-9A-Za-z]+ ]] ; then
22122216
ENTRY="# $1$p$2 belongs to btrfs volume '$3'"
22132217
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"
22192219
fi
22202220

22212221
if [ "$5" = "crypt" ]; then
@@ -2587,7 +2587,7 @@ format_partitions() {
25872587
encrypt_partitions() {
25882588
if [ "$1" -a "$2" ]; then
25892589
local fstab="$1"
2590-
local cryptpassword="$(echo "$2" | awk '{print $2}')"
2590+
local cryptpassword="$2"
25912591
local dev
25922592
local dev_uuid
25932593

@@ -2600,9 +2600,9 @@ encrypt_partitions() {
26002600
else
26012601
dev="$(echo "$line" | grep "crypted" | awk '{print $1}')"
26022602
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"
26042604
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"
26062606
touch "$FOLD/crypttab"
26072607
echo "luks-${dev_uuid} UUID=${dev_uuid} none luks" >> "$FOLD/crypttab"
26082608
sed -i -e "s+$dev+/dev/mapper/luks-${dev_uuid}+g" "$FOLD/fstab"
@@ -4163,4 +4163,35 @@ is_usb_disk() {
41634163
echo "$udevadm_info" | grep --quiet 'ID_USB_DRIVER=usb-storage'
41644164
}
41654165

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+
41664197
# vim: ai:ts=2:sw=2:et

imageinfo.functions.sh

+15-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#
44
# imageinfo functions
55
#
6-
# (c) 2019-2022, Hetzner Online GmbH
6+
# (c) 2019-2024, Hetzner Online GmbH
77
#
88

99
debian_buster_image() {
@@ -71,4 +71,18 @@ image_requires_xfs_version_check() {
7171
return 1
7272
}
7373

74+
image_i40e_driver_version() {
75+
[[ "$(modinfo -F vermagic "$FOLD/hdd/lib/modules/"*'/kernel/drivers/net/ethernet/intel/i40e/i40e.ko' 2> /dev/null)" =~ ^([0-9]+\.[0-9]+)[^0-9] ]] || return
76+
echo "${BASH_REMATCH[1]}"
77+
}
78+
79+
image_i40e_driver_version_ge() {
80+
local other="$1"
81+
[[ "$(echo -e "$(image_i40e_driver_version)\n$other" | sort -V | head -n 1)" == "$other" ]]
82+
}
83+
84+
image_i40e_driver_exposes_port_name() {
85+
image_i40e_driver_version_ge '6.7'
86+
}
87+
7488
# vim: ai:ts=2:sw=2:et

installimage

+2-3
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,8 @@
1010

1111
# simple params - restart with other params
1212
case $1 in
13-
proxmox4) exec "$0" -c proxmox4 -x proxmox4 ;;
14-
proxmox5) exec "$0" -c proxmox5 -x proxmox5 ;;
15-
proxmox6) exec "$0" -c proxmox6 -x proxmox6 ;;
1613
proxmox7) exec "$0" -c proxmox7 -x proxmox7 ;;
14+
proxmox8) exec "$0" -c proxmox8 -x proxmox8 ;;
1715
hsa-baculadir) exec "$0" -c hsa-baculadir -x hsa-baculadir ;;
1816
hsa-minimal64) exec "$0" -c hsa-minimal64 -x hsa-minimal64 ;;
1917
hsa-managed) exec "$0" -c hsa-managed -x hsa-managed ;;
@@ -113,6 +111,7 @@ if [ $EXITCODE -ne 0 ] ; then
113111
exit 1
114112
fi
115113

114+
free_port_53
116115

117116
# check if we have a autosetup-file, else we start the menu
118117
if [ -e "$AUTOSETUPCONFIG" ] ; then

kernel_module_config.functions.sh

+19
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,19 @@ board_requires_drm_blacklisting() {
2626
[[ "$(board_vendor)" == 'ASUSTeK COMPUTER INC.' ]] &&
2727
[[ "$(board_name)" == 'PRIME B760M-A D4' ]] &&
2828
return 0
29+
[[ "$IAM" == ubuntu ]] &&
30+
((IMG_VERSION == 2004)) &&
31+
hwe_image &&
32+
[[ "$(board_vendor)" == 'ASUSTeK COMPUTER INC.' ]] &&
33+
[[ "$(board_name)" == 'PRIME B760M-A D4' ]] &&
34+
return 0
35+
{
36+
{ [[ "$IAM" == debian ]] && ((IMG_VERSION < 1300)) } ||
37+
{ [[ "$IAM" == ubuntu ]] && ((IMG_VERSION < 2204)) }
38+
} &&
39+
[[ "$(board_vendor)" == 'Gigabyte Technology Co., Ltd.' ]] &&
40+
has_b360hd3p_board &&
41+
return 0
2942
return 1
3043
}
3144

@@ -43,6 +56,10 @@ buggy_kernel_modules() {
4356

4457
blacklist_unwanted_and_buggy_kernel_modules() {
4558
local blacklist_conf="$FOLD/hdd/etc/modprobe.d/blacklist-$C_SHORT.conf"
59+
60+
# skip if virtual machine
61+
is_virtual_machine && return
62+
4663
debug '# blacklisting unwanted and buggy kernel modules'
4764
{
4865
echo "### $COMPANY - installimage"
@@ -63,6 +80,8 @@ configure_kernel_modules() {
6380

6481
# skip if drm is blacklisted
6582
board_requires_drm_blacklisting && return
83+
# skip if virtual machine
84+
is_virtual_machine && return
6685

6786
debug '# configuring kernel modules'
6887
{

0 commit comments

Comments
 (0)