Bug 216640 - grub-install, efibootmgr etc. not working with new kernel
Summary: grub-install, efibootmgr etc. not working with new kernel
Status: RESOLVED CODE_FIX
Alias: None
Product: EFI
Classification: Unclassified
Component: Services (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: EFI Virtual User
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-10-30 14:45 UTC by Stephan Verbücheln
Modified: 2022-11-16 06:35 UTC (History)
1 user (show)

See Also:
Kernel Version: 6.0.5
Subsystem:
Regression: No
Bisected commit-id:


Attachments

Description Stephan Verbücheln 2022-10-30 14:45:27 UTC
When I boot with kernel 6.0.x, grub-install, efibootmgr etc. keep
failing. With kernel 5.19.x it works on the same machine with the same
userland.

Hardware:
MacBookPro11,1 (13" Macbook Pro from 2014)
Intel(R) Core(TM) i7-4578U CPU @ 3.00GHz
aka Intel-based Macbook without Apple T2 Security Chip

I am not sure if this bug is Apple specific. I recommend developers to
test grub-install and efibootmgr on other hardware setups.





grub-install: info: copying `/usr/lib/shim/shimx64.efi.signed' ->
`/boot/efi/EFI/debian/shimx64.efi'.
grub-install: info: copying `/usr/lib/grub/x86_64-efi-
signed/grubx64.efi.signed' -> `/boot/efi/EFI/debian/grubx64.efi'.
grub-install: info: copying `/usr/lib/shim/mmx64.efi.signed' ->
`/boot/efi/EFI/debian/mmx64.efi'.
grub-install: info: copying `/usr/lib/shim/fbx64.efi.signed' ->
`/boot/efi/EFI/debian/fbx64.efi'.
grub-install: info: copying `/usr/lib/shim/BOOTX64.CSV' ->
`/boot/efi/EFI/debian/BOOTX64.CSV'.
grub-install: info: copying `/boot/grub/x86_64-efi/load.cfg' ->
`/boot/efi/EFI/debian/grub.cfg'.
grub-install: info: Registering with EFI: distributor = `debian', path
= `\EFI\debian\shimx64.efi', ESP at hostdisk//dev/sda,gpt1.
grub-install: info: executing modprobe efivars 2>/dev/null.
grub-install: info: setting EFI variable Boot0000.
grub-install: warning: Cannot set EFI variable Boot0000.
grub-install: warning: efivarfs_set_variable: writing to fd 6 failed:
Invalid argument.
grub-install: warning: _efi_set_variable_mode: ops->set_variable()
failed: Invalid argument.
grub-install: error: failed to register the EFI boot entry: Invalid
argument.




I have tested this with various Debian and vanilla kernels and manually applied this patch:
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-6.0.y&id=c2a000ad03bb3a0d0f389adcfc9f8c61622da363

Debian:
linux-image-5.19.0-2-amd64 5.19.11-1 (not affected)
linux-image-6.0.0-1-amd64 6.0.2-1+b1 (affected)
linux-image-6.0.0-2-amd64 6.0.3-1 (affected)
linux-image-6.0.0-2-amd64 6.0.5-1 (affected)

Vanilla:
linux-image-6.0.5/now 6.0.5-1 (affected)

Various relevant package versions (no recent updates):
efibootmgr/unstable,now 17-1
efivar/unstable,now 37-6
libefivar1/unstable,now 37-6
grub-common/unstable,now 2.06-4
grub-efi-amd64/unstable,now 2.06-4
grub-efi-amd64-bin/unstable,now 2.06-4
grub-efi-amd64-signed/unstable,now 1+2.06+4
grub2-common/unstable,now 2.06-4


Anyone with access to potentially affected hardware can test this by setting the boot order with “efibootmgr -o”.

Regards
Comment 1 Stephan Verbücheln 2022-10-30 14:46:47 UTC
A Debian bug can be found here.

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1022900
Comment 2 Ard Biesheuvel 2022-10-30 21:26:16 UTC
This should be fixed in 

https://git.kernel.org/pub/scm/linux/kernel/git/efi/efi.git/log/?h=urgent

This will go upstream the coming week, and land in the v6.0 kernel shortly after.
Comment 3 Stephan Verbücheln 2022-11-11 06:51:56 UTC
I am happy to confirm that kernel 6.0.8 fixes the issue.

Regards

Note You need to log in before you can comment on or make changes to this bug.