Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#77680 - [linux-rt-lts] bootctl shows that EFI not available

Attached to Project: Arch Linux
Opened by Vladimir (_v_l) - Tuesday, 28 February 2023, 23:54 GMT
Last edited by David Runge (dvzrv) - Thursday, 02 March 2023, 09:37 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To David Runge (dvzrv)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
when using linux-rt-lts (5.15.95.60.realtime1-1-rt-lts) kernel, I can't use bootctl, but with linux-zen 6.2.1 bootctl works fine.

Additional info:
* linux-rt-lts 5.15.95.60.realtime1-1
* systemd 253-1

Steps to reproduce:
- install linux-rt-lts kernel;
- boot it;
- run $ sudo bootctl

This is bootctl output with linux-rt-lts kernel:

```
System:
Firmware: n/a (n/a)
Firmware Arch: x64
Secure Boot: disabled (unsupported)
TPM2 Support: no
Boot into FW: not supported

Current Boot Loader:
Product: n/a
Features: ✗ Boot counting
✗ Menu timeout control
✗ One-shot menu timeout control
✗ Default entry control
✗ One-shot entry control
✗ Support for XBOOTLDR partition
✗ Support for passing random seed to OS
✗ Load drop-in drivers
✗ Support Type #1 sort-key field
✗ Support @saved pseudo-entry
✗ Support Type #1 devicetree field
✗ Boot loader sets ESP information
ESP: n/a
File: └─n/a

Random Seed:
System Token: not set
Exists: yes

Available Boot Loaders on ESP:
ESP: /boot (/dev/disk/by-partuuid/44ef5eda-0d75-fb45-9713-9539b4303475)
File: ├─/EFI/systemd/systemd-bootx64.efi (systemd-boot 253-1-arch)
└─/EFI/BOOT/BOOTX64.EFI (systemd-boot 253-1-arch)

No boot loaders listed in EFI Variables.

Boot Loader Entries:
$BOOT: /boot (/dev/disk/by-partuuid/44ef5eda-0d75-fb45-9713-9539b4303475)
token: arch

Default Boot Loader Entry:
type: Boot Loader Specification Type #1 (.conf)
title: Arch Linux Zen
id: zen.conf
source: /boot//loader/entries/zen.conf
linux: /boot//vmlinuz-linux-zen
initrd: /boot//intel-ucode.img
/boot//initramfs-linux-zen.img
```

This is on a system with linux-zen kernel (similar system, but shows the same behavior with bootctl and linux-rt-lts, and linux-zen kernels):
```
System:
Firmware: UEFI 2.70 (American Megatrends 5.17)
Firmware Arch: x64
Secure Boot: disabled (setup)
TPM2 Support: no
Boot into FW: supported

Current Boot Loader:
Product: systemd-boot 253-1-arch
Features: ✓ Boot counting
✓ Menu timeout control
✓ One-shot menu timeout control
✓ Default entry control
✓ One-shot entry control
✓ Support for XBOOTLDR partition
✓ Support for passing random seed to OS
✓ Load drop-in drivers
✓ Support Type #1 sort-key field
✓ Support @saved pseudo-entry
✓ Support Type #1 devicetree field
✓ Boot loader sets ESP information
ESP: /dev/disk/by-partuuid/58a69e6c-84c2-fc48-be11-2d0c163b4900
File: └─/EFI/BOOT/BOOTX64.EFI

Random Seed:
System Token: set
Exists: yes

Available Boot Loaders on ESP:
ESP: /boot (/dev/disk/by-partuuid/58a69e6c-84c2-fc48-be11-2d0c163b4900)
File: ├─/EFI/systemd/systemd-bootx64.efi (systemd-boot 253-1-arch)
└─/EFI/BOOT/BOOTX64.EFI (systemd-boot 253-1-arch)

Boot Loaders Listed in EFI Variables:
Title: UEFI OS
ID: 0x0002
Status: active, boot-order
Partition: /dev/disk/by-partuuid/58a69e6c-84c2-fc48-be11-2d0c163b4900
File: └─/EFI/BOOT/BOOTX64.EFI

Title: Linux Boot Manager
ID: 0x0001
Status: active, boot-order
Partition: /dev/disk/by-partuuid/58a69e6c-84c2-fc48-be11-2d0c163b4900
File: └─/EFI/systemd/systemd-bootx64.efi

Boot Loader Entries:
$BOOT: /boot (/dev/disk/by-partuuid/58a69e6c-84c2-fc48-be11-2d0c163b4900)
token: arch

Default Boot Loader Entry:
type: Boot Loader Specification Type #1 (.conf)
title: Arch Linux Realtime LTS
id: rt.conf
source: /boot//loader/entries/rt.conf
linux: /boot//vmlinuz-linux-rt-lts
initrd: /boot//intel-ucode.img
/boot//initramfs-linux-rt-lts.img
```
This task depends upon

Closed by  David Runge (dvzrv)
Thursday, 02 March 2023, 09:37 GMT
Reason for closing:  Not a bug
Additional comments about closing:  CONFIG_EFI_VARS is off by default (conflicts CONFIG_RT) on PREEMPT_RT kernels.
Using the `efi=runtime` kernel parameter allows for having efivars.
Comment by Toolybird (Toolybird) - Wednesday, 01 March 2023, 06:52 GMT
Confirmed in a VM. If I were to take a stab I'd guess:

# CONFIG_EFI_VARS is not set

is the reason.
Comment by Vladimir (_v_l) - Thursday, 02 March 2023, 00:05 GMT
Hello.

I'm not 100% sure, so I did some research. I checked the EFI config settings for linux-zen of versions 5.15.13, 5.19.13 and 6.2.1 (though I didn't test bootctl with 5.1x zen kernels, but do that for the 6.1 and 6.2x series).

What I did:
```
$ grep _EFI --color=never config-5.15.13-zen1 | sort > config-5.15.13-zen1-efi
$ grep _EFI --color=never config-5.15.13-zen1 | sort > config-5.15.13-zen1-efi
$ zcat /proc/config.gz | grep _EFI --color=never | sort > config-5.15.95.60-efi
$ diff -Naur config-5.15.95.60-efi config-5.15.13-zen1-efi > diffA
$ diff -Naur config-5.15.95.60-efi config-5.19.13-zen1-efi > diffB
$ diff -Naur config-5.15.95.60-efi config-6.2.1-zen1-efi > diffC
```

The first difference: nothing, the configurations are identical.

The second difference:
```
--- config-5.15.95.60-efi 2023-03-02 07:53:00.259384671 +0800
+++ config-5.19.13-zen1-efi 1970-01-01 08:00:00.000000000 +0800
@@ -1,27 +0,0 @@
-CONFIG_DMI_SCAN_MACHINE_NON_EFI_FALLBACK=y
-CONFIG_EFI_BOOTLOADER_CONTROL=m
-CONFIG_EFI_CAPSULE_LOADER=m
-CONFIG_EFI_CUSTOM_SSDT_OVERLAYS=y
-CONFIG_EFI_DEV_PATH_PARSER=y
-# CONFIG_EFI_DISABLE_PCI_DMA is not set
-CONFIG_EFI_EARLYCON=y
-CONFIG_EFI_EMBEDDED_FIRMWARE=y
-CONFIG_EFI_ESRT=y
-# CONFIG_EFI_FAKE_MEMMAP is not set
-CONFIG_EFI_GENERIC_STUB_INITRD_CMDLINE_LOADER=y
-CONFIG_EFI_MIXED=y
-CONFIG_EFI_PARTITION=y
-# CONFIG_EFI_PGT_DUMP is not set
-CONFIG_EFI_RCI2_TABLE=y
-CONFIG_EFI_RUNTIME_MAP=y
-CONFIG_EFI_RUNTIME_WRAPPERS=y
-CONFIG_EFI_SOFT_RESERVE=y
-CONFIG_EFI_STUB=y
-# CONFIG_EFI_TEST is not set
-CONFIG_EFIVAR_FS=y
-# CONFIG_EFI_VARS is not set
-CONFIG_EFI_VARS_PSTORE_DEFAULT_DISABLE=y
-CONFIG_EFI_VARS_PSTORE=y
-CONFIG_EFI=y
-CONFIG_FB_EFI=y
-CONFIG_XEN_EFI=y
```
Nothing surprising, different kernels.

The third difference:
```
--- config-5.15.95.60-efi 2023-03-02 07:53:00.259384671 +0800
+++ config-6.2.1-zen1-efi 1970-01-01 08:00:00.000000000 +0800
@@ -1,27 +0,0 @@
-CONFIG_DMI_SCAN_MACHINE_NON_EFI_FALLBACK=y
-CONFIG_EFI_BOOTLOADER_CONTROL=m
-CONFIG_EFI_CAPSULE_LOADER=m
-CONFIG_EFI_CUSTOM_SSDT_OVERLAYS=y
-CONFIG_EFI_DEV_PATH_PARSER=y
-# CONFIG_EFI_DISABLE_PCI_DMA is not set
-CONFIG_EFI_EARLYCON=y
-CONFIG_EFI_EMBEDDED_FIRMWARE=y
-CONFIG_EFI_ESRT=y
-# CONFIG_EFI_FAKE_MEMMAP is not set
-CONFIG_EFI_GENERIC_STUB_INITRD_CMDLINE_LOADER=y
-CONFIG_EFI_MIXED=y
-CONFIG_EFI_PARTITION=y
-# CONFIG_EFI_PGT_DUMP is not set
-CONFIG_EFI_RCI2_TABLE=y
-CONFIG_EFI_RUNTIME_MAP=y
-CONFIG_EFI_RUNTIME_WRAPPERS=y
-CONFIG_EFI_SOFT_RESERVE=y
-CONFIG_EFI_STUB=y
-# CONFIG_EFI_TEST is not set
-CONFIG_EFIVAR_FS=y
-# CONFIG_EFI_VARS is not set
-CONFIG_EFI_VARS_PSTORE_DEFAULT_DISABLE=y
-CONFIG_EFI_VARS_PSTORE=y
-CONFIG_EFI=y
-CONFIG_FB_EFI=y
-CONFIG_XEN_EFI=y
```

I could be wrong here, but it seems that the EFI configurations are identical. Could this be related to the rt kernel?
Comment by Vladimir (_v_l) - Thursday, 02 March 2023, 00:12 GMT
Damn, I made a typo while writing commands and got wrong result for 5.19.13 kernel.

I should be done
```
$ grep _EFI --color=never config-5.19.13-zen1 | sort > config-5.19.13-zen1-efi
$ diff -Naur config-5.15.95.60-efi config-5.19.13-zen1-efi > diffB
```
so the second difference has to be
```
--- config-5.15.95.60-efi 2023-03-02 07:53:00.259384671 +0800
+++ config-5.19.13-zen1-efi 2023-03-02 08:08:43.921948233 +0800
@@ -1,9 +1,12 @@
CONFIG_DMI_SCAN_MACHINE_NON_EFI_FALLBACK=y
CONFIG_EFI_BOOTLOADER_CONTROL=m
CONFIG_EFI_CAPSULE_LOADER=m
+CONFIG_EFI_COCO_SECRET=y
CONFIG_EFI_CUSTOM_SSDT_OVERLAYS=y
CONFIG_EFI_DEV_PATH_PARSER=y
# CONFIG_EFI_DISABLE_PCI_DMA is not set
+# CONFIG_EFI_DISABLE_RUNTIME is not set
+CONFIG_EFI_DXE_MEM_ATTRIBUTES=y
CONFIG_EFI_EARLYCON=y
CONFIG_EFI_EMBEDDED_FIRMWARE=y
CONFIG_EFI_ESRT=y
@@ -15,6 +18,7 @@
CONFIG_EFI_RCI2_TABLE=y
CONFIG_EFI_RUNTIME_MAP=y
CONFIG_EFI_RUNTIME_WRAPPERS=y
+CONFIG_EFI_SECRET=m
CONFIG_EFI_SOFT_RESERVE=y
CONFIG_EFI_STUB=y
# CONFIG_EFI_TEST is not set
```
Comment by Vladimir (_v_l) - Thursday, 02 March 2023, 00:20 GMT
And, of course, I did the wrong thing for the 6.2.1 kernel!

After I did:
```
$ grep _EFI --color=never config-6.2.1-zen1 | sort > config-6.2.1-zen1-efi
$ diff -Naur config-5.15.95.60-efi config-6.2.1-zen1-efi > diffC
```
I got the correct difference with the 6.2.1 kernel:
```
--- config-5.15.95.60-efi 2023-03-02 07:53:00.259384671 +0800
+++ config-6.2.1-zen1-efi 2023-03-02 08:14:17.233809094 +0800
@@ -1,25 +1,28 @@
CONFIG_DMI_SCAN_MACHINE_NON_EFI_FALLBACK=y
CONFIG_EFI_BOOTLOADER_CONTROL=m
CONFIG_EFI_CAPSULE_LOADER=m
+CONFIG_EFI_COCO_SECRET=y
CONFIG_EFI_CUSTOM_SSDT_OVERLAYS=y
CONFIG_EFI_DEV_PATH_PARSER=y
# CONFIG_EFI_DISABLE_PCI_DMA is not set
+# CONFIG_EFI_DISABLE_RUNTIME is not set
+CONFIG_EFI_DXE_MEM_ATTRIBUTES=y
CONFIG_EFI_EARLYCON=y
CONFIG_EFI_EMBEDDED_FIRMWARE=y
CONFIG_EFI_ESRT=y
# CONFIG_EFI_FAKE_MEMMAP is not set
-CONFIG_EFI_GENERIC_STUB_INITRD_CMDLINE_LOADER=y
+# CONFIG_EFI_HANDOVER_PROTOCOL is not set
CONFIG_EFI_MIXED=y
CONFIG_EFI_PARTITION=y
# CONFIG_EFI_PGT_DUMP is not set
CONFIG_EFI_RCI2_TABLE=y
CONFIG_EFI_RUNTIME_MAP=y
CONFIG_EFI_RUNTIME_WRAPPERS=y
+CONFIG_EFI_SECRET=m
CONFIG_EFI_SOFT_RESERVE=y
CONFIG_EFI_STUB=y
# CONFIG_EFI_TEST is not set
CONFIG_EFIVAR_FS=y
-# CONFIG_EFI_VARS is not set
CONFIG_EFI_VARS_PSTORE_DEFAULT_DISABLE=y
CONFIG_EFI_VARS_PSTORE=y
CONFIG_EFI=y
```

So it seems `_EFI_VARS` should be set.
Comment by nl6720 (nl6720) - Thursday, 02 March 2023, 08:36 GMT
As https://wiki.archlinux.org/title/Unified_Extensible_Firmware_Interface#Linux_kernel_configuration_options_for_UEFI says, CONFIG_EFI_VARS should be disabled, so "# CONFIG_EFI_VARS is not set" is correct.

As https://wiki.archlinux.org/title/Unified_Extensible_Firmware_Interface#Requirements_for_UEFI_variable_support says, realtime kernels disable runtime EFI services by default ( https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=d9f283ae71afef6560a7101c0a31d7ddb5b0f29a ). The solution is as the wiki instructs: adding efi=runtime to the kernel parameters.
Comment by David Runge (dvzrv) - Thursday, 02 March 2023, 09:36 GMT
@nl6720: Thanks! I was just about to post the same :)

@_v_l:h
CONFIG_EFI_VARS has been conditioned to !CONFIG_RT for a long time now. Whether this really helps in regards to realtime processing I don't know, but upstream would be the correct place to discuss this.

As a workaround exists with the efi=runtime kernel parameter, I'll close this as not a bug.

Loading...