[1/3] mountkernfs: Mount /sys/firmware/efi/efivars on EFI systems

Message ID 20211104090554.6510-1-michael.tremer@ipfire.org
State Accepted
Commit 76050bdcf2874846ca2cb22981666c6381e7cb2f
Headers show
Series [1/3] mountkernfs: Mount /sys/firmware/efi/efivars on EFI systems | expand

Commit Message

Michael Tremer Nov. 4, 2021, 9:05 a.m. UTC
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
---
 src/initscripts/system/mountkernfs | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Peter Müller Nov. 17, 2021, 8:10 p.m. UTC | #1
Reviewed-by: Peter Müller <peter.mueller@ipfire.org>

> Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
> ---
>   src/initscripts/system/mountkernfs | 5 +++++
>   1 file changed, 5 insertions(+)
> 
> diff --git a/src/initscripts/system/mountkernfs b/src/initscripts/system/mountkernfs
> index 264da24c4..1f1426077 100644
> --- a/src/initscripts/system/mountkernfs
> +++ b/src/initscripts/system/mountkernfs
> @@ -39,6 +39,11 @@ case "${1}" in
>   			mount -t cgroup2 none /sys/fs/cgroup || failed=1
>   		fi
>   
> +		if ! mountpoint /sys/firmware/efi/efivars &>/dev/null && [ -d "/sys/firmware/efi" ]; then
> +			boot_mesg -n " /sys/firmware/efi/efivars" ${NORMAL}
> +			mount -t efivarfs efivarfs /sys/firmware/efi/efivars || failed=1
> +		fi
> +
>   		# create folder for dhcpcd changeroot
>   		mkdir -p /run/dhcpcd/chroot
>   		chown dhcpcd:dhcpcd /run/dhcpcd/chroot
>

Patch

diff --git a/src/initscripts/system/mountkernfs b/src/initscripts/system/mountkernfs
index 264da24c4..1f1426077 100644
--- a/src/initscripts/system/mountkernfs
+++ b/src/initscripts/system/mountkernfs
@@ -39,6 +39,11 @@  case "${1}" in
 			mount -t cgroup2 none /sys/fs/cgroup || failed=1
 		fi
 
+		if ! mountpoint /sys/firmware/efi/efivars &>/dev/null && [ -d "/sys/firmware/efi" ]; then
+			boot_mesg -n " /sys/firmware/efi/efivars" ${NORMAL}
+			mount -t efivarfs efivarfs /sys/firmware/efi/efivars || failed=1
+		fi
+
 		# create folder for dhcpcd changeroot
 		mkdir -p /run/dhcpcd/chroot
 		chown dhcpcd:dhcpcd /run/dhcpcd/chroot