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
# 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
}