aboutsummaryrefslogtreecommitdiff
path: root/init.d/sysfs.in
diff options
context:
space:
mode:
Diffstat (limited to 'init.d/sysfs.in')
-rw-r--r--init.d/sysfs.in27
1 files 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
}