commit:     deaae7ab5c499191426cec81f6e803c972f0cca3
Author:     William Hubbs <w.d.hubbs <AT> gmail <DOT> com>
AuthorDate: Thu Oct  6 03:43:56 2016 +0000
Commit:     William Hubbs <williamh <AT> gentoo <DOT> org>
CommitDate: Thu Oct  6 03:48:17 2016 +0000
URL:        https://gitweb.gentoo.org/proj/openrc.git/commit/?id=deaae7ab

init.d/sysfs: load efivarfs module when booting in efi mode:1

The presence of /sys/firmware/efi is used to indicate that the system
was booted in efi mode.

 init.d/sysfs.in | 27 ++++++++++++++++-----------
 1 file changed, 16 insertions(+), 11 deletions(-)

diff --git a/init.d/sysfs.in b/init.d/sysfs.in
index 7183e5d..6d6ec62 100644
--- a/init.d/sysfs.in
+++ b/init.d/sysfs.in
@@ -99,17 +99,22 @@ mount_misc()
        fi
 
        # set up kernel support for efivarfs
-       if [ ! -d /sys/firmware/efi/efivars ] && modprobe -q efivarfs; then
-               ewarn "The efivarfs module needs to be configured in " \
-                         "@SYSCONFDIR@/conf.d/modules or built in"
-       fi
-       if [ -d /sys/firmware/efi/efivars ] &&
-               ! mountinfo -q /sys/firmware/efi/efivars; then
-               if grep -qs efivarfs /proc/filesystems; then
-                       ebegin "Mounting efivarfs filesystem"
-                       mount -n -t efivarfs -o ${sysfs_opts} \
-                               efivarfs /sys/firmware/efi/efivars
-                       eend $?
+       # The presence of /sys/firmware/efi indicates that the system was
+       # booted in efi mode.
+       if [ -d /sys/firmware/efi ]; then
+               if [ ! -d /sys/firmware/efi/efivars ] &&
+                       modprobe -q efivarfs; then
+                       ewarn "The efivarfs module needs to be configured in " \
+                                 "@SYSCONFDIR@/conf.d/modules or built in"
+               fi
+               if [ -d /sys/firmware/efi/efivars ] &&
+                       ! mountinfo -q /sys/firmware/efi/efivars; then
+                       if grep -qs efivarfs /proc/filesystems; then
+                               ebegin "Mounting efivarfs filesystem"
+                               mount -n -t efivarfs -o ${sysfs_opts} \
+                                       efivarfs /sys/firmware/efi/efivars
+                               eend $?
+                       fi
                fi
        fi
 }

Reply via email to