init.d/sysfs: Do not load efivarfs module

My understanding is that the kernel can autoload this module. If it
doesn't, the module should be built in or loaded from an initramfs.

This fixes https://github.com/openrc/openrc/pulls/112.
This commit is contained in:
William Hubbs 2017-03-07 17:40:18 -06:00
parent 4a269674b7
commit 6a79aef015

View File

@ -15,7 +15,7 @@ sysfs_opts=nodev,noexec,nosuid
depend() depend()
{ {
want modules use modules
keyword -docker -lxc -prefix -systemd-nspawn -vserver keyword -docker -lxc -prefix -systemd-nspawn -vserver
} }
@ -102,19 +102,12 @@ mount_misc()
# The presence of /sys/firmware/efi indicates that the system was # The presence of /sys/firmware/efi indicates that the system was
# booted in efi mode. # booted in efi mode.
if [ -d /sys/firmware/efi ]; then 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 ] && if [ -d /sys/firmware/efi/efivars ] &&
! mountinfo -q /sys/firmware/efi/efivars; then ! mountinfo -q /sys/firmware/efi/efivars; then
if grep -qs efivarfs /proc/filesystems; then ebegin "Mounting efivarfs filesystem"
ebegin "Mounting efivarfs filesystem" mount -n -t efivarfs -o ${sysfs_opts} \
mount -n -t efivarfs -o ${sysfs_opts} \ efivarfs /sys/firmware/efi/efivars
efivarfs /sys/firmware/efi/efivars eend $?
eend $?
fi
fi fi
fi fi
} }