Don't output failures when trying to load efivars
authorMichael Prokop <mika@grml.org>
Fri, 14 Sep 2018 07:05:14 +0000 (09:05 +0200)
committerMichael Prokop <mika@grml.org>
Fri, 14 Sep 2018 07:05:14 +0000 (09:05 +0200)
When running inside a system without efi support we get:

| modprobe: ERROR: could not insert 'efivars': No such device

autoconfig.functions

index 4ddf086..ec86e84 100755 (executable)
@@ -525,8 +525,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