[2/3] installer: Setup efivarfs when possible

Message ID 20211104090554.6510-2-michael.tremer@ipfire.org
State Accepted
Commit 27944cdc4a2a10241936b011fa52755c1e658e7d
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/installer/dracut-module/module-setup.sh  | 1 +
 src/installer/dracut-module/run-installer.sh | 5 +++++
 2 files changed, 6 insertions(+)

Comments

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

> Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
> ---
>   src/installer/dracut-module/module-setup.sh  | 1 +
>   src/installer/dracut-module/run-installer.sh | 5 +++++
>   2 files changed, 6 insertions(+)
> 
> diff --git a/src/installer/dracut-module/module-setup.sh b/src/installer/dracut-module/module-setup.sh
> index 29ec4c0d7..9c3a5d03e 100755
> --- a/src/installer/dracut-module/module-setup.sh
> +++ b/src/installer/dracut-module/module-setup.sh
> @@ -23,6 +23,7 @@ install() {
>   
>       # Kernel drivers
>       instmods =drivers/hid
> +    instmods efivarfs
>   
>       # Network drivers
>       instmods =drivers/net/ethernet =drivers/net/usb
> diff --git a/src/installer/dracut-module/run-installer.sh b/src/installer/dracut-module/run-installer.sh
> index 33c8c4b10..755de1d3a 100644
> --- a/src/installer/dracut-module/run-installer.sh
> +++ b/src/installer/dracut-module/run-installer.sh
> @@ -8,6 +8,11 @@ if grep -q "installer.unattended" /proc/cmdline; then
>   	unattended=1
>   fi
>   
> +# Mount efivarfs on EFI systems
> +if [ -d "/sys/firmware/efi" ]; then
> +	mount -t efivarfs efivarfs /sys/firmware/efi/efivars
> +fi
> +
>   # Enable Unicode
>   echo -en '\033%G' && kbd_mode -u
>   
>

Patch

diff --git a/src/installer/dracut-module/module-setup.sh b/src/installer/dracut-module/module-setup.sh
index 29ec4c0d7..9c3a5d03e 100755
--- a/src/installer/dracut-module/module-setup.sh
+++ b/src/installer/dracut-module/module-setup.sh
@@ -23,6 +23,7 @@  install() {
 
     # Kernel drivers
     instmods =drivers/hid
+    instmods efivarfs
 
     # Network drivers
     instmods =drivers/net/ethernet =drivers/net/usb
diff --git a/src/installer/dracut-module/run-installer.sh b/src/installer/dracut-module/run-installer.sh
index 33c8c4b10..755de1d3a 100644
--- a/src/installer/dracut-module/run-installer.sh
+++ b/src/installer/dracut-module/run-installer.sh
@@ -8,6 +8,11 @@  if grep -q "installer.unattended" /proc/cmdline; then
 	unattended=1
 fi
 
+# Mount efivarfs on EFI systems
+if [ -d "/sys/firmware/efi" ]; then
+	mount -t efivarfs efivarfs /sys/firmware/efi/efivars
+fi
+
 # Enable Unicode
 echo -en '\033%G' && kbd_mode -u