Release new version 0.17.4
[grml-autoconfig.git] / autoconfig.functions
index 90bc6bd..b71e69d 100755 (executable)
@@ -188,11 +188,15 @@ VMWARE=false
 
 if vmware-detect &>/dev/null; then
   VIRTUAL=true; VMWARE=true; VIRTUAL_ENV='VMware'
-elif [ "$(virt-what 2>/dev/null)" = "kvm" ] || \
-   [ "$(imvirt 2>/dev/null)" = "KVM" ] ; then
+fi
+
+if virt-what 2>/dev/null | grep -q 'kvm' || \
+  [ "$(imvirt 2>/dev/null)" = "KVM" ] ; then
   VIRTUAL=true; KVM=true; VIRTUAL_ENV='KVM'
-elif [ "$(virt-what 2>/dev/null)" = "virtualbox" ] || \
-   [ "$(imvirt 2>/dev/null)" = "VirtualBox" ] ; then
+fi
+
+if virt-what 2>/dev/null | grep -q 'virtualbox' || \
+  [ "$(imvirt 2>/dev/null)" = "VirtualBox" ] ; then
   VIRTUAL=true; VIRTUALBOX=true; VIRTUAL_ENV='VirtualBox'
 fi
 # }}}
@@ -314,20 +318,6 @@ config_language(){
 
  [ -r /etc/sysconfig/keyboard ] && . /etc/sysconfig/keyboard
 
- # activate unicode console if running within utf8 environment
- if [ -r /etc/default/locale ] ; then
-    if grep -q "LANG=.*UTF" /etc/default/locale ; then
-       einfo "Setting up unicode environment."
-       unicode_start >>$DEBUG 2>&1 ; eend $?
-    fi
- fi
-
- # Set default keyboard before interactive setup
- if [ -n "$KEYTABLE" ] ; then
-    einfo "Running loadkeys for ${WHITE}${KEYTABLE}${NORMAL} in background"
-    loadkeys -q $KEYTABLE &
-    eend $?
- fi
 
  # we have to set up all consoles, therefore loop it over all ttys:
  NUM_CONSOLES=$(fgconsole --next-available 2>/dev/null)
@@ -383,6 +373,21 @@ config_language(){
     fi
  fi
 
+ # Set default keyboard before interactive setup
+ if [ -n "$KEYTABLE" ] ; then
+    einfo "Running loadkeys for ${WHITE}${KEYTABLE}${NORMAL} in background"
+    loadkeys -q $KEYTABLE &
+    eend $?
+ fi
+
+ # activate unicode console if running within utf8 environment
+ if [ -r /etc/default/locale ] ; then
+    if grep -q "LANG=.*UTF" /etc/default/locale ; then
+       einfo "Setting up unicode environment."
+       unicode_start ; eend $?
+    fi
+ fi
+
  eoutdent
 }
 # }}}
@@ -521,8 +526,9 @@ config_secureboot(){
   # doesn't work as needed as it relies on /sys/firmware/efi/efivars (while
   # /sys/firmware/efi/vars would exist)
   if ! $SYSTEMD ; then
-    modprobe efivars
-    mount -t efivarfs efivarfs /sys/firmware/efi/efivars
+    if modprobe efivars &>/dev/null ; then
+      mount -t efivarfs efivarfs /sys/firmware/efi/efivars
+    fi
   fi
 
   if [ -x /usr/bin/mokutil ] ; then