From deaae7ab5c499191426cec81f6e803c972f0cca3 Mon Sep 17 00:00:00 2001 From: William Hubbs Date: Wed, 5 Oct 2016 22:43:56 -0500 Subject: 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 7183e5d8..6d6ec62c 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 } -- cgit v1.2.3