commit:     5f5b1f7cbefd0bc14352e86a9c33260266f98d9b
Author:     William Hubbs <w.d.hubbs <AT> gmail <DOT> com>
AuthorDate: Sun Mar 12 18:55:49 2017 +0000
Commit:     William Hubbs <williamh <AT> gentoo <DOT> org>
CommitDate: Sun Mar 12 18:55:49 2017 +0000
URL:        https://gitweb.gentoo.org/proj/openrc.git/commit/?id=5f5b1f7c

init.d/sysfs.in: efivarfs tweaks

Since we check for /sys/firmware/efi/efivars, we do not need to check
for /sys/firmware/efi

Since Failing to mount efivarfs is not critical, we silence the error
message from mount.

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

diff --git a/init.d/sysfs.in b/init.d/sysfs.in
index 8030ea84..e493f584 100644
--- a/init.d/sysfs.in
+++ b/init.d/sysfs.in
@@ -98,16 +98,12 @@ mount_misc()
        fi
 
        # set up kernel support for efivarfs
-       # 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 ] &&
-                       ! mountinfo -q /sys/firmware/efi/efivars; then
-                       ebegin "Mounting efivarfs filesystem"
-                       mount -n -t efivarfs -o ${sysfs_opts} \
-                               efivarfs /sys/firmware/efi/efivars
-                       eend $?
-               fi
+       if [ -d /sys/firmware/efi/efivars ] &&
+               ! mountinfo -q /sys/firmware/efi/efivars; then
+               ebegin "Mounting efivarfs filesystem"
+               mount -n -t efivarfs -o ${sysfs_opts} \
+                       efivarfs /sys/firmware/efi/efivars 2> /dev/null
+               eend 0
        fi
 }
 

Reply via email to