check SYSVENDOR for kernels (#1318)

This commit is contained in:
Daniel Hansson 2020-07-13 22:10:38 +02:00 committed by GitHub
parent 69856779ec
commit dad0a55b52
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 13 additions and 11 deletions

3
lib.sh
View File

@ -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)

View File

@ -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

View File

@ -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"

View File

@ -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"