From dad0a55b52c5003ce58e4afa6e071cc7d336a6bb Mon Sep 17 00:00:00 2001 From: Daniel Hansson Date: Mon, 13 Jul 2020 22:10:38 +0200 Subject: [PATCH] check SYSVENDOR for kernels (#1318) --- lib.sh | 3 +++ nextcloud_install_production.sh | 17 ++++++++++------- static/format-chosen.sh | 2 -- static/format-sdb.sh | 2 -- 4 files changed, 13 insertions(+), 11 deletions(-) diff --git a/lib.sh b/lib.sh index bb0813d4..cafe2d42 100644 --- a/lib.sh +++ b/lib.sh @@ -34,6 +34,9 @@ gen_passwd() { # Ubuntu OS DISTRO=$(lsb_release -sr) KEYBOARD_LAYOUT=$(localectl status | grep "Layout" | awk '{print $3}') +# Hypervisor +# HYPERVISOR=$(dmesg --notime | grep -i hypervisor | cut -d ':' -f2 | head -1 | tr -d ' ') TODO +SYSVENDOR=$(cat /sys/devices/virtual/dmi/id/sys_vendor) # Network [ -n "$FIRST_IFACE" ] && IFACE=$(lshw -c network | grep "logical name" | awk '{print $3; exit}') IFACE2=$(ip -o link show | awk '{print $2,$9}' | grep 'UP' | cut -d ':' -f 1) diff --git a/nextcloud_install_production.sh b/nextcloud_install_production.sh index ceb4e3d3..9b59b2f3 100644 --- a/nextcloud_install_production.sh +++ b/nextcloud_install_production.sh @@ -779,13 +779,16 @@ find /root "/home/$UNIXUSER" -type f \( -name '*.sh*' -o -name '*.html*' -o -nam # Kernel 5.4 if ! home_sme_server then - # Hyper-V - apt install -y --install-recommends \ - linux-virtual \ - linux-image-virtual \ - linux-tools-virtual \ - linux-cloud-tools-virtual - # linux-image-extra-virtual only needed for AUFS driver with Docker + if [ "$SYSVENDOR" == "Microsoft Corporation" ] + then + # Hyper-V + apt install -y --install-recommends \ + linux-virtual \ + linux-image-virtual \ + linux-tools-virtual \ + linux-cloud-tools-virtual + # linux-image-extra-virtual only needed for AUFS driver with Docker + fi fi # Add aliases diff --git a/static/format-chosen.sh b/static/format-chosen.sh index c91de63d..ec665188 100644 --- a/static/format-chosen.sh +++ b/static/format-chosen.sh @@ -24,8 +24,6 @@ umount /mnt/* &> /dev/null mkdir -p "$MOUNT_" # Check what Hypervisor disks are available -# HYPERVISOR=$(dmesg --notime | grep -i hypervisor | cut -d ':' -f2 | head -1 | tr -d ' ') TODO -SYSVENDOR=$(cat /sys/devices/virtual/dmi/id/sys_vendor) if [ "$SYSVENDOR" == "VMware, Inc." ]; then SYSNAME="VMware" diff --git a/static/format-sdb.sh b/static/format-sdb.sh index c4739a20..b3410b88 100644 --- a/static/format-sdb.sh +++ b/static/format-sdb.sh @@ -24,8 +24,6 @@ umount /mnt/* &> /dev/null mkdir -p "$MOUNT_" # Check what Hypervisor disks are available -# HYPERVISOR=$(dmesg --notime | grep -i hypervisor | cut -d ':' -f2 | head -1 | tr -d ' ') TODO -SYSVENDOR=$(cat /sys/devices/virtual/dmi/id/sys_vendor) if [ "$SYSVENDOR" == "VMware, Inc." ]; then SYSNAME="VMware"