diff --git a/README.md b/README.md index 2b2c334..f70a4f0 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # zfs-hetzner-vm -Scripts to install Debian 10 or Ubuntu 18 with ZFS root on Hetzner VPS.
+Scripts to install Debian 10 or Ubuntu 18 with ZFS root on Hetzner root servers (virtual and dedicated).
__WARNING:__ all data on the disk will be destroyed. ## How to use: diff --git a/hetzner-debian10-zfs-setup.sh b/hetzner-debian10-zfs-setup.sh index 84017ca..4b4eeff 100644 --- a/hetzner-debian10-zfs-setup.sh +++ b/hetzner-debian10-zfs-setup.sh @@ -26,6 +26,7 @@ declare -a v_selected_disks v_swap_size= # integer v_free_tail_space= # integer v_hostname= +v_kernel_variant= v_zfs_arc_max_mb= v_root_password= v_encrypt_rpool= # 0=false, 1=true @@ -387,6 +388,12 @@ function ask_hostname { print_variables v_hostname } +function determine_kernel_variant { + if dmidecode | grep vServer 2>&1; then + v_kernel_variant="-cloud" + fi +} + function chroot_execute { chroot $c_zfs_mount_dir bash -c "$1" } @@ -683,7 +690,7 @@ chroot_execute "rm -f /etc/localtime /etc/timezone" chroot_execute "dpkg-reconfigure tzdata -f noninteractive " 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 ==========" chroot_execute "apt install --yes man wget curl software-properties-common nano htop gnupg" diff --git a/hetzner-ubuntu18-zfs-setup.sh b/hetzner-ubuntu18-zfs-setup.sh index 4a5a466..9b772b0 100644 --- a/hetzner-ubuntu18-zfs-setup.sh +++ b/hetzner-ubuntu18-zfs-setup.sh @@ -26,6 +26,7 @@ declare -a v_selected_disks v_swap_size= # integer v_free_tail_space= # integer v_hostname= +v_kernel_variant= v_zfs_arc_max_mb= v_root_password= v_encrypt_rpool= # 0=false, 1=true @@ -352,6 +353,12 @@ function ask_hostname { print_variables v_hostname } +function determine_kernel_variant { + if dmidecode | grep vServer 2>&1; then + v_kernel_variant="-virtual" + fi +} + function chroot_execute { 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 " 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 ==========" chroot_execute "apt install --yes man wget curl software-properties-common nano htop gnupg"