acidanthera / bugtracker

Acidanthera Bugtracker
385 stars 45 forks source link

OpenLinuxBoot fails to process loader\entries\*.conf of Fedora 41 due to GRUB variables #2440

Closed AlexFullmoon closed 1 week ago

AlexFullmoon commented 3 weeks ago

OpenLinuxBoot fails to process loader\entries\*.conf files on Fedora 41 due to Fedora adding some GRUB variables (related to TuneD).

Specifically, in Fedora 40 conf files look like this:

title Fedora Linux (6.11.5-200.fc40.x86_64) 40 (Workstation Edition)
version 6.11.5-200.fc40.x86_64
linux /vmlinuz-6.11.5-200.fc40.x86_64
initrd /initramfs-6.11.5-200.fc40.x86_64.img
options root=UUID=f05a35ff-a897-4f55-ac04-5fcdf6db4dbf ro rootflags=subvol=root rhgb quiet
grub_users $grub_users
grub_arg --unrestricted
grub_class fedora

And in Fedora 41:

title Fedora Linux (6.11.5-300.fc41.x86_64) 41 (Workstation Edition)
version 6.11.5-300.fc41.x86_64
linux /vmlinuz-6.11.5-300.fc41.x86_64
initrd /initramfs-6.11.5-300.fc41.x86_64.img $tuned_initrd
options root=UUID=f05a35ff-a897-4f55-ac04-5fcdf6db4dbf ro rootflags=subvol=root rhgb quiet $tuned_params
grub_users $grub_users
grub_arg --unrestricted
grub_class fedora

Attached boot log, but here's the issue:

01:875 00:002 LNX: Reading 758c1891c87a4d4d947a61d4389e5ed3-6.11.5-300.fc41.x86_64.conf...
01:878 00:002 LNX: /initramfs-6.11.5-300.fc41.x86_64.img $tuned_initrd not found - Not Found
01:879 00:001 LNX: Error processing 758c1891c87a4d4d947a61d4389e5ed3-6.11.5-300.fc41.x86_64.conf - Not Found

Only detected boot option remains rescue mode, which does not have those variables in F41.

This could be circumvented by removing those variables (as suggested here), but that would probably disable some TuneD functionality.

opencore-2024-11-01-070424.txt If necessary, EFI is here: https://seaf.moonlightwell.ru/f/f34bac86e643485a8ba4/

mikebeaton commented 3 weeks ago

@AlexFullmoon - Could you send the OpenCore log using macOS XCODE5 Artifacts DEBUG version from this build: https://github.com/acidanthera/OpenCorePkg/actions/runs/11628445836 (you need to be logged in to GitHub, scroll to the bottom of the page, files may take a moment to show). This will add a bit more logging related to these variables.

PS: Am I right that you have set LINUX_BOOT_LOG_VERBOSE using OpenLinuxBoot flags for the debug log you sent, even though that is not shown in the EFI?

AlexFullmoon commented 3 weeks ago

Done, here: opencore-2024-11-01-193153.txt

Am I right that you have set LINUX_BOOT_LOG_VERBOSE using OpenLinuxBoot flags for the debug log you sent, even though that is not shown in the EFI?

Oops, yes, my bad. Must've been opened in editor when I copied it. Nothing else changed, I believe, but just in case I'll reupload. https://seaf.moonlightwell.ru/f/1fecb48d0bce42b7a917/

mikebeaton commented 3 weeks ago

I've found this causing problems for another project way back in 2019: https://github.com/error10/kexec-reboot/issues/11

Unlike sd-boot, we already do (partially) extract grub vars since they're quite often used in BootLoaderSpecByDefault files. We support expanding grub variables only for options, so far, it needs adding for initrd.

We will also need to work around this bug (we normally assume that a missing variable is an error condition; I imagine we should initialise these two variables to empty values when they are not present, on some flag which is enabled by default) and we also need to add code to support having multiple initrds in one initrd line (which is not standard, but is what they are doing).

mikebeaton commented 1 week ago

@AlexFullmoon - Could you confirm that the version in macOS XCODE5 Artifacts here works for you https://github.com/acidanthera/OpenCorePkg/actions/runs/11868306241? (Files are at bottom of page and may take a couple of seconds to appear when you visit the page.)

AlexFullmoon commented 1 week ago

@mikebeaton Yes, it works.