Bug 2501572 - When using systemd-boot, akmods wrongly reports that kernel source is not installed
Summary: When using systemd-boot, akmods wrongly reports that kernel source is not ins...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: akmods
Version: 44
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Nicolas Chauvet (kwizart)
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2026-07-16 22:50 UTC by Tomáš Hnyk
Modified: 2026-07-29 11:25 UTC (History)
7 users (show)

Fixed In Version: akmods-0.6.2-14.fc45
Clone Of:
Environment:
Last Closed: 2026-07-29 09:44:23 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Tomáš Hnyk 2026-07-16 22:50:43 UTC
Description of problem:
When using systemd-boot, akmods wrongly reports that kernel source is not installed

Version-Release number of selected component (if applicable):
dnf list --installed \*akmods\*
Installed packages (available for reinstall, available for upgrade)
akmods.noarch 0.6.2-9.fc44 fedora


How reproducible:
Always

Steps to Reproduce:
1. Use systemd-boot
2. Try to compile a custom module with akmods (in my case Nvidia), i.e run akmods (when the said module is not installed, so maybe uninstall it first)

Actual results:
sudo akmods
Could not find files needed to compile modules for /boot/efi//3df672eef9054350b62cccb2eae56a38/7.1.3-201.fc44.x86_64/linux
Are the development files for kernel /boot/efi//3df672eef9054350b62cccb2eae56a38/7.1.3-201.fc44.x86_64/linux or the appropriate kernel-devel package installed?
Checking kmods exist for 7.1.3-201.fc44.x86_64 [  OK  ]


Expected results:
The error message is not emitted.

Additional info:
Problem seems to be in the check_default_kernel() function.

When after these two lines:

if command -v grubby >/dev/null 2>&1 ; then
		default_kernel=$(grubby --default-kernel | sed -e 's/^.*vmlinuz-//')


this code block is added, the problem disappears:

if [[ "${default_kernel}" == *vmlinuz-* ]]; then
    default_kernel="${default_kernel##*vmlinuz-}"
elif [[ "${default_kernel}" == */linux ]]; then
    default_kernel="$(basename "$(dirname "${default_kernel}")")"
fi

It seems the problem is only cosmetical - the build suceeds, only the error message is wrong.

Disclosure: I used Claude to diagnose the bug. I verified the fix and wrote this bug report with my words.

Comment 1 Nicolas Chauvet (kwizart) 2026-07-17 08:33:50 UTC
Thanks for the report.

Can you show the output of the "grubby --default-kernel" command under systemd-boot ? 
I assume you are using sdubby to have a proper grubby implementation ? (please show the version of sdubby)

Comment 2 Tomáš Hnyk 2026-07-17 08:43:25 UTC
sudo grubby --default-kernel
/boot/efi//3df672eef9054350b62cccb2eae56a38/7.1.3-201.fc44.x86_64/linux

dnf list --installed \*sdubby\*
sdubby.noarch 1.0-14.fc44 fedora

If I get it correctly, sdubby overwrites /usr/bin/grubby and does not have a separate binary.

Comment 3 Nicolas Chauvet (kwizart) 2026-07-17 08:56:57 UTC
> If I get it correctly, sdubby overwrites /usr/bin/grubby and does not have a separate binary.

Both sdubby and grubby provide a /usr/bin/grubby implementation, but the former works with systemd-boot while the latter works with grub2 and others.


Also can you show the output of:
bootctl is-installed
  and
bootctl list  --json=short

also verify if jq is installed on your system ?


Maybe it's just a matter to change the preference of the tool to be used...

Comment 4 Tomáš Hnyk 2026-07-17 09:02:30 UTC
sudo bootctl is-installed
yes

sudo bootctl list  --json=short
[{"type":"type1","source":"esp","id":"3df672eef9054350b62cccb2eae56a38-7.1.3-201.fc44.x86_64.conf","path":"/boot/efi/loader/entries/3df672eef9054350b62cccb2eae56a38-7.1.3-201.fc44.x86_64.conf","root":"/boot/efi","title":"Fedora Linux 44 (Forty Four)","showTitle":"Fedora Linux 44 (Forty Four) (7.1.3-201.fc44.x86_64)","sortKey":"fedora","version":"7.1.3-201.fc44.x86_64","machineId":"3df672eef9054350b62cccb2eae56a38","options":"root=UUID=a84d55b0-4c25-4bfe-a78e-323a78963d67 systemd.machine_id=3df672eef9054350b62cccb2eae56a38","linux":"/3df672eef9054350b62cccb2eae56a38/7.1.3-201.fc44.x86_64/linux","initrd":["/3df672eef9054350b62cccb2eae56a38/7.1.3-201.fc44.x86_64/initrd"],"isReported":true,"isDefault":true,"isSelected":true,"addons":null,"cmdline":"root=UUID=a84d55b0-4c25-4bfe-a78e-323a78963d67 systemd.machine_id=3df672eef9054350b62cccb2eae56a38"},{"type":"type1","source":"esp","id":"3df672eef9054350b62cccb2eae56a38-7.1.3-200.fc44.x86_64.conf","path":"/boot/efi/loader/entries/3df672eef9054350b62cccb2eae56a38-7.1.3-200.fc44.x86_64.conf","root":"/boot/efi","title":"Fedora Linux 44 (Forty Four)","showTitle":"Fedora Linux 44 (Forty Four) (7.1.3-200.fc44.x86_64)","sortKey":"fedora","version":"7.1.3-200.fc44.x86_64","machineId":"3df672eef9054350b62cccb2eae56a38","options":"root=UUID=a84d55b0-4c25-4bfe-a78e-323a78963d67 systemd.machine_id=3df672eef9054350b62cccb2eae56a38","linux":"/3df672eef9054350b62cccb2eae56a38/7.1.3-200.fc44.x86_64/linux","initrd":["/3df672eef9054350b62cccb2eae56a38/7.1.3-200.fc44.x86_64/initrd"],"isReported":true,"isDefault":false,"isSelected":false,"addons":null,"cmdline":"root=UUID=a84d55b0-4c25-4bfe-a78e-323a78963d67 systemd.machine_id=3df672eef9054350b62cccb2eae56a38"},{"type":"type1","source":"esp","id":"3df672eef9054350b62cccb2eae56a38-7.0.13-200.fc44.x86_64.conf","path":"/boot/efi/loader/entries/3df672eef9054350b62cccb2eae56a38-7.0.13-200.fc44.x86_64.conf","root":"/boot/efi","title":"Fedora Linux 44 (Forty Four)","showTitle":"Fedora Linux 44 (Forty Four) (7.0.13-200.fc44.x86_64)","sortKey":"fedora","version":"7.0.13-200.fc44.x86_64","machineId":"3df672eef9054350b62cccb2eae56a38","options":"rhgb quiet root=UUID=a84d55b0-4c25-4bfe-a78e-323a78963d67 systemd.machine_id=3df672eef9054350b62cccb2eae56a38","linux":"/3df672eef9054350b62cccb2eae56a38/7.0.13-200.fc44.x86_64/linux","initrd":["/3df672eef9054350b62cccb2eae56a38/7.0.13-200.fc44.x86_64/initrd"],"isReported":true,"isDefault":false,"isSelected":false,"addons":null,"cmdline":"rhgb quiet root=UUID=a84d55b0-4c25-4bfe-a78e-323a78963d67 systemd.machine_id=3df672eef9054350b62cccb2eae56a38"},{"type":"type1","source":"esp","id":"3df672eef9054350b62cccb2eae56a38-0-rescue.conf","path":"/boot/efi/loader/entries/3df672eef9054350b62cccb2eae56a38-0-rescue.conf","root":"/boot/efi","title":"Fedora Linux 44 (Forty Four) - Rescue Image","showTitle":"Fedora Linux 44 (Forty Four) - Rescue Image","version":"7.0.10-201.fc44.x86_64","machineId":"3df672eef9054350b62cccb2eae56a38","options":"rhgb root=UUID=a84d55b0-4c25-4bfe-a78e-323a78963d67 quiet","linux":"/3df672eef9054350b62cccb2eae56a38/0-rescue/linux","initrd":["/3df672eef9054350b62cccb2eae56a38/0-rescue/initrd"],"isReported":true,"isDefault":false,"isSelected":false,"addons":null,"cmdline":"rhgb root=UUID=a84d55b0-4c25-4bfe-a78e-323a78963d67 quiet"},{"type":"auto","source":"esp","id":"auto-reboot-to-firmware-setup","path":"/sys/firmware/efi/efivars/LoaderEntries-4a67b082-0a4c-41cf-b6c7-440b29bb8c4f","title":"Reboot Into Firmware Interface","showTitle":"Reboot Into Firmware Interface","isReported":true,"isDefault":false,"isSelected":false,"addons":null}]

jq --version
jq-1.8.1

Comment 5 Nicolas Chauvet (kwizart) 2026-07-20 12:38:45 UTC
Thanks for the answer on this. I should be able to setup a reproduce VM in order to properly test this.
Can you report which doc you have followed to setup systemd-boot (do you have secure boot enabled ?)

The previous bootctl output is likely truncated, can you test the following instead ?
bootctl list  --json=short 2>/dev/null |jq -r '.[] | select(.isDefault).version'


Also I wonder if jq can be assumed to be installed  (or need to be enforced) ? which components can bring it in your local system ?
rpm -e jq --test

Basically, using the bootctl over the grubby output should likely be more relevant instead of parsing back and both from more or less broken assumptions.
I'm going to prefer using bootctl instead. (which could also works under grub2 either or not "bootctl is-installed" returns true.

Comment 6 Tomáš Hnyk 2026-07-20 20:52:58 UTC
I do not think it is really properly documented anywhere. To install with systemd-boot use netinstall(Fedora Everything here: https://fedoraproject.org/misc/), and before booting it, in grub, press E and add inst.sdboot to the kernel (?) parametres. Then it will install with systemd-boot. 

sudo bootctl list  --json=short 2>/dev/null |jq -r '.[] | select(.isDefault).version'
[sudo] password for drew:    
7.1.3-201.fc44.x86_64

rpm -e jq --test does not do anything.

Not sure if jq is available by default or not.

Comment 7 Fedora Update System 2026-07-29 09:42:03 UTC
FEDORA-2026-a175fbd017 (akmods-0.6.2-14.fc45) has been submitted as an update to Fedora 45.
https://bodhi.fedoraproject.org/updates/FEDORA-2026-a175fbd017

Comment 8 Fedora Update System 2026-07-29 09:44:23 UTC
FEDORA-2026-a175fbd017 (akmods-0.6.2-14.fc45) has been pushed to the Fedora 45 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 9 Nicolas Chauvet (kwizart) 2026-07-29 09:56:14 UTC
I've added a different fix that now uses bootctl by default.

What was difficult is to consider older rhel because isDefault is not available and even the json output is missing on EL8
But bootctl is-installed is harder to achieve there unless using a dedicated non standard systemd-boot.

I've also fixed a broken assumption about expected path for testing vmlinuz location, so all in all fixing the value will be less needed.


Please test the fix in this report
https://koji.fedoraproject.org/koji/taskinfo?taskID=148443897


I've referenced the issue on the commit message, that should count as "reported by"
Thanks for the report.

Comment 10 Nicolas Chauvet (kwizart) 2026-07-29 09:56:44 UTC
Bodhi ticket for f44: https://bodhi.fedoraproject.org/updates/FEDORA-2026-f0ca40a976

Comment 11 Tomáš Hnyk 2026-07-29 10:05:33 UTC
Thanks. Though, weirdly, without me touching anything (bar dnf update on July 18), I cannot reproduce the error on my system, so I cannot really verify the fix either. But I guess you reproduced it before fixing, right :-)?

Comment 12 Nicolas Chauvet (kwizart) 2026-07-29 11:17:23 UTC
(In reply to Tomáš Hnyk from comment #11)
> Thanks. Though, weirdly, without me touching anything (bar dnf update on
> July 18), I cannot reproduce the error on my system, so I cannot really
> verify the fix either. But I guess you reproduced it before fixing, right
> :-)?

Note quite, I never managed to get into a situation where kernel was located in /boot/efi//3df672eef9054350b62cccb2eae56a38/7.1.3-201.fc44.x86_64/linux
But there are many cases and possibilities !

Comment 13 Tomáš Hnyk 2026-07-29 11:25:00 UTC
Yeah, that is where I have them :-).

I remember when installing, I was not sure where to mount EFI. Per bootloader spec: https://uapi-group.org/specifications/specs/boot_loader_specification/#mount-points

I seemed to have choosen the one unrecommended mountpoint :-).


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