mirror of
https://github.com/terem42/zfs-hetzner-vm.git
synced 2025-12-22 14:58:32 +00:00
Determine kernel variant
This is required to use this script for a dedicated root server.
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
# zfs-hetzner-vm
|
# zfs-hetzner-vm
|
||||||
|
|
||||||
Scripts to install Debian 10 or Ubuntu 18 with ZFS root on Hetzner VPS.<br/>
|
Scripts to install Debian 10 or Ubuntu 18 with ZFS root on Hetzner root servers (virtual and dedicated).<br/>
|
||||||
__WARNING:__ all data on the disk will be destroyed.
|
__WARNING:__ all data on the disk will be destroyed.
|
||||||
|
|
||||||
## How to use:
|
## How to use:
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ declare -a v_selected_disks
|
|||||||
v_swap_size= # integer
|
v_swap_size= # integer
|
||||||
v_free_tail_space= # integer
|
v_free_tail_space= # integer
|
||||||
v_hostname=
|
v_hostname=
|
||||||
|
v_kernel_variant=
|
||||||
v_zfs_arc_max_mb=
|
v_zfs_arc_max_mb=
|
||||||
v_root_password=
|
v_root_password=
|
||||||
v_encrypt_rpool= # 0=false, 1=true
|
v_encrypt_rpool= # 0=false, 1=true
|
||||||
@@ -387,6 +388,12 @@ function ask_hostname {
|
|||||||
print_variables v_hostname
|
print_variables v_hostname
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function determine_kernel_variant {
|
||||||
|
if dmidecode | grep vServer 2>&1; then
|
||||||
|
v_kernel_variant="-cloud"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
function chroot_execute {
|
function chroot_execute {
|
||||||
chroot $c_zfs_mount_dir bash -c "$1"
|
chroot $c_zfs_mount_dir bash -c "$1"
|
||||||
}
|
}
|
||||||
@@ -686,7 +693,7 @@ chroot_execute "rm -f /etc/localtime /etc/timezone"
|
|||||||
chroot_execute "dpkg-reconfigure tzdata -f noninteractive "
|
chroot_execute "dpkg-reconfigure tzdata -f noninteractive "
|
||||||
|
|
||||||
echo "======= installing latest kernel============="
|
echo "======= installing latest kernel============="
|
||||||
chroot_execute "apt install --yes -t buster-backports linux-image-cloud-amd64 linux-headers-cloud-amd64"
|
chroot_execute "apt install --yes -t buster-backports linux-image${v_kernel_variant}-amd64 linux-headers${v_kernel_variant}-amd64"
|
||||||
|
|
||||||
echo "======= installing aux packages =========="
|
echo "======= installing aux packages =========="
|
||||||
chroot_execute "apt install --yes man wget curl software-properties-common nano htop gnupg"
|
chroot_execute "apt install --yes man wget curl software-properties-common nano htop gnupg"
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ declare -a v_selected_disks
|
|||||||
v_swap_size= # integer
|
v_swap_size= # integer
|
||||||
v_free_tail_space= # integer
|
v_free_tail_space= # integer
|
||||||
v_hostname=
|
v_hostname=
|
||||||
|
v_kernel_variant=
|
||||||
v_zfs_arc_max_mb=
|
v_zfs_arc_max_mb=
|
||||||
v_root_password=
|
v_root_password=
|
||||||
v_encrypt_rpool= # 0=false, 1=true
|
v_encrypt_rpool= # 0=false, 1=true
|
||||||
@@ -352,6 +353,12 @@ function ask_hostname {
|
|||||||
print_variables v_hostname
|
print_variables v_hostname
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function determine_kernel_variant {
|
||||||
|
if dmidecode | grep vServer 2>&1; then
|
||||||
|
v_kernel_variant="-virtual"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
function chroot_execute {
|
function chroot_execute {
|
||||||
chroot $c_zfs_mount_dir bash -c "$1"
|
chroot $c_zfs_mount_dir bash -c "$1"
|
||||||
}
|
}
|
||||||
@@ -658,7 +665,7 @@ chroot_execute "rm -f /etc/localtime /etc/timezone"
|
|||||||
chroot_execute "dpkg-reconfigure tzdata -f noninteractive "
|
chroot_execute "dpkg-reconfigure tzdata -f noninteractive "
|
||||||
|
|
||||||
echo "======= installing latest kernel============="
|
echo "======= installing latest kernel============="
|
||||||
chroot_execute "DEBIAN_FRONTEND=noninteractive apt install --yes linux-headers-virtual-hwe-18.04 linux-image-virtual-hwe-18.04 linux-image-extra-virtual-hwe-18.04"
|
chroot_execute "DEBIAN_FRONTEND=noninteractive apt install --yes linux-headers${v_kernel_variant}-hwe-18.04 linux-image${v_kernel_variant}-hwe-18.04 linux-image-extra${v_kernel_variant}-hwe-18.04"
|
||||||
|
|
||||||
echo "======= installing aux packages =========="
|
echo "======= installing aux packages =========="
|
||||||
chroot_execute "apt install --yes man wget curl software-properties-common nano htop gnupg"
|
chroot_execute "apt install --yes man wget curl software-properties-common nano htop gnupg"
|
||||||
|
|||||||
Reference in New Issue
Block a user