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.
This commit is contained in:
William Hubbs 2016-10-05 22:43:56 -05:00
parent 3d2c2f0b87
commit deaae7ab5c

View File

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