commit:     2b115f3879bd2cbb5d525349f47391d412de2d62
Author:     William Hubbs <w.d.hubbs <AT> gmail <DOT> com>
AuthorDate: Tue Oct  4 16:51:24 2016 +0000
Commit:     William Hubbs <williamh <AT> gentoo <DOT> org>
CommitDate: Tue Oct  4 16:51:24 2016 +0000
URL:        https://gitweb.gentoo.org/proj/openrc.git/commit/?id=2b115f38

init.d/sysfs: fix efivarfs handling

Separate loading the module, if it isn't built in or loaded, from
mounting the file system.

This also makes sure the warning about configuring the module in
/etc/conf.d/modules or building it in is displayed only if it is loaded
successfully.

X-Gentoo-Bug: 595836
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=595836

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

diff --git a/init.d/sysfs.in b/init.d/sysfs.in
index b9478f8..7183e5d 100644
--- a/init.d/sysfs.in
+++ b/init.d/sysfs.in
@@ -98,15 +98,13 @@ mount_misc()
                fi
        fi
 
-       # setup up kernel support for efivarfs
-       # slightly complicated, as if it's build as a module but NOT yet loaded,
-       # it will NOT appear in /proc/filesystems yet
-       if [ -d /sys/firmware/efi/efivars ] \
-               && ! mountinfo -q /sys/firmware/efi/efivars; then
-               if modprobe -q efivarfs; then
-                       ewarn "The efivarfs module needs to be configured in" \
-                               "@SYSCONFDIR@/conf.d/modules or built in"
-               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} \

Reply via email to