Fedora Account System
Red Hat Associate
Red Hat Customer
Created attachment 1909499 [details] The patch Created attachment 1909499 [details] The patch Akmods uses grubby to figure out the default kernel. Nowadays, some people use systemd-boot instead of grub. In this case grubby provides incorrect information, and bootctl should be used instead. This is why I propose the following very simple patch (the patch is in attachment)
Thanks for working on this. I'm not use to understand how to assume systemd-boot is used. ? Isn't it better to use "bootctl is-installed" ? then fallback to grubby if any error ? Also parsing the bootctl status output looks fragile (first, start with using LANG=C), then maybe there is a better command, like "bootctl list" ? Even better would be to request systemd to add a list-default-entry command. So parsing output will be uneeded... Also do you have a good tutorial on using systemd-boot on fedora ? Last time I've checked, systemd-boot was lacking a mean to add additional linux cmdline arguments. We rely on "grubby --args" for nvidia driver without any better interface. Also I'm not sure if systemd-boot can be use in secureboot context ? or do you need to disable secure boot
Thank you for the quick answer. You asked important questions. I didn't think about that (my thinking was: on MY system it works). Regarding the tutorial. I migrated to systemd-boot a few years ago. I was migrating to UEFI from BIOS when realised that systemd-boot would be better suited in this setup. That is why migrating to systemd-boot was just one step in a larger procedure. I don't remember what resources I used at that time. They were definitely not Fedora specific. Quick googling provided me with a resource https://kowalski7cc.xyz/blog/systemd-boot-fedora-32 ("Systemd-boot install on Fedora 32 (Updated for 34)"). With the same search, I found a discussion on Reddit where a person says he used this resource to migrate to systemd-boot. Regarding the command line. I am not a strong specialist in this matter, I can just provide some observation now. I have an nvidia card though, so I am interested in solving this issue. Systemd-boot uses (/boot)/efi/loader/entries/* to specify command line arguments to kernel. They are created by /usr/bin/kernel-install which uses /etc/kernel/cmdline. /etc/kernel/cmdline is a text file and can be edited easily. Regarding secure boot. I don't use it, so unfortunately I know nothing about it. Quick googling showed me that you are probably right and using systemd-boot does require disabling secure boot. I'll do further research when I have a spare time. Regarding implementation. I shall think about your recommendations, implement them on my system and live with them some time. Then I shall upload a new patch.
Created attachment 1911030 [details] Updated patch
I uploaded the updated akmods patch. Regarding grubby and nvidia packages. I looked at nvidia drivers packages. I found preinstall and postinstall scripts for xorg-x11-drv-nvidia which use grubby (/usr/sbin/grubby --update-kernel=ALL). Is it what you meant? In any case, this way of changing kernels command line in situation when systemd-boot is used as boot loader leads incorrect result. Yes, as far as I know, systemd-boot doesn't have an alternative for "grubby --update-kernel=ALL". One need to implement this functionality in script. I can do this. Excuse me, I am new to Fedora bugtracker, so I have a question. When I am done with this functionality where shall I submit the results.
You can submit the patches to https://src.fedoraproject.org/rpms/akmods/ (that would help to give credit). Quick reviewing your patch, you may need to double check the coding style wrt conditions (wrapping with [[]] as needed... Other than that it looks correct. Another point is if bootctl is-installed is available but bootctl isn't the current bootloader, the default kernel will likely be wrong... My understand is that you may also need to modify the xorg-x11-drv-nvidia package to adapt to bootctl (you can use https://github.com/rpmfusion/xorg-x11-drv-nvidia/ )
Thank you for pointing me to the urls for submitting patches and for making modification of the xorg-x11-drv-nvidia package. I will use them. > Another point is if bootctl is-installed is available but bootctl isn't the current bootloader, the default kernel will likely be wrong... Yes, I knew that, and I wrote a comment about it. I thought about it. Now, I conclude it is a bug, and I need to fix it. I don't quite understand your comment about the style. Your are saying "wrap with [[]]" as need. However, I think "if command" and "if [[ ... ]]" are different language constructions, and not different styles (for example, one can find "if ! command" construction in the code, which is similar). The only difference in my style that I can see is position of "then". I place "then" on a new line while in the file they are placed on the same line as the "if". Sure this should be fixed, and I will do it. Excuse me if I misunderstood you, in which case could you explain to me my error.
> Yes, I knew that, and I wrote a comment about it. I thought about it. Now, I conclude it is a bug, and I need to fix it. It should be easy enough to fix having grubby tested first and using the value (if correct) , then if the value is incorrect (empty) try systemd-boot. Please check my implementation...
Seems like there is an error: LANG=C bootctl list | grep default | sed 's/.*(.*).*(\(.*\)).*(.*)/\1/' should output the uname -r of the default kernel: # bootctl list | grep default | sed 's/.*(.*).*(\(.*\)).*(.*)/\1/' default # grubby --default-kernel /boot/vmlinuz-6.0.15-200.fc36.x86_64 I don't know how the uname -r of a default kernel can be correctly assumed by bootctl
See also the current WIP: https://src.fedoraproject.org/rpms/akmods/pull-request/15 I don't see much way around than requesting a bootctl list-default-kernel command from systemd-boot upstream...
I have submitted a RFE for systemd-boot at https://github.com/systemd/systemd/issues/25889
This message is a reminder that Fedora Linux 36 is nearing its end of life. Fedora will stop maintaining and issuing updates for Fedora Linux 36 on 2023-05-16. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as EOL if it remains open with a 'version' of '36'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, change the 'version' to a later Fedora Linux version. Note that the version field may be hidden. Click the "Show advanced fields" button if you do not see it. Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora Linux 36 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora Linux, you are encouraged to change the 'version' to a later version prior to this bug being closed.
FEDORA-2023-edbc6478d6 has been submitted as an update to Fedora 39. https://bodhi.fedoraproject.org/updates/FEDORA-2023-edbc6478d6
FEDORA-2023-edbc6478d6 has been pushed to the Fedora 39 stable repository. If problem still persists, please make note of it in this bug report.