I'm trying to get rid of grub on my system, and uses systemd-boot. I also have a nvidia card, so I use akmods to build that kernel module. The kernel install.d script calls akmods with the following command: /usr/sbin/akmods --from-kernel-posttrans --kernels ${KERNEL_VERSION} Since the kernel flag is set then akmods explicitely tries to find the kernel file in /boot/vmlinuz-${KERNEL_VERSION} But, this file does not exists when we use systemd-boot. In that case, the kernel is copied in $ESP/<machine-id>/<kernel-version>/linux So, akmods fails to build the kernel with "Kernel ${KERNEL+VERSION} not installed"
I have zero interest in this.
Thx for the report Olivier. Please consider to suggest a working (tested) patch, it should be easy enough to change the test for the vmlinuz as appropriate for your case.
btw, the reason we test the kernel is not because we need it to build the kernel module (we can build for another kernel than the one installed), but instead that we need to ensure the kernel is present, so the resulting kmod can be installed along the target kernel in "offline mode". So maybe we can change the test for something that doesn't change across fedora/el and the chosen bootloader. (We need to support distro down to EL6 and current Fedora).
I understood the reason, and started working on a patch (but I also had other issues regarding the execution order of kernel/install.d scripts). I'll try to come with a solution that does not break the current behaviour but adds an option to check for the kernel installation.
Created attachment 1633360 [details] Add check kernel for systemd-boot Hello, Maybe you should be interested by the attached patch. This is an attempt to respond to your issue and it needs to be reviewed. The required tools or files are already present: - /etc/machine-id is provided by systemd package; - /usr/bin/bootctl is provided by systemd-udev package. but: - /var/lib/dbus/machine-id is not provided by a package but is present on some systems (don't know where it comes from, dnf provides doesn't find it too). Concerning D-BUS machine id and according to https://www.freedesktop.org/software/systemd/man/machine-id.html /var/lib/dbus/machine-id can be a plain text file, or a symlink to /etc/machine-id. That's why /etc/machine-id file is evaluated first. Any comment about this subject is welcome. Cordially, -- NVieville
Created attachment 1636157 [details] Add check kernel for systemd-boot Corrected typo in patch.
@Nicolas This is yet again a too complex change where it would only be needed to check for /lib/modules/$(uname -r) availability.
or /lib/modules/${KERNEL_UNAME_R} (whatever the appropriate variable is in the akmods context)
@kwizart Thank you for your feedback. My only goal, as a first attempt (not again), was to try to address the issue described by Olivier Samyn. Reading the comments just below the piece of shell script of akmods file concerned by this issue led me to make the proposition I made with the patch. akmods file line 476: "# this is a red hat / fedora kernel-devel package, but the kernel for it is not installed # kmodtool would add a dep on that kernel when building; thus when we'd try to install the # rpms we'd run into a missing-dep problem. Thus we prevent that case " Checking for /lib/modules/$(uname -r)/Makefile or /lib/modules/$(uname -r)/build/Makefile is made line 469 of akmods file and we can consider that it would fail if the /lib/modules/$(uname -r) directory was not present. So two possibilities: - remove the failing check of this issue, but what do we do with/about the comments. - replace line 475 of akmods file with: [[ ! -d /lib/modules/"${1}" ]] ; then Should I provide a patch for this? Cordially, -- NVieville
Sorry, can you reword with less word ?
> - replace line 475 of akmods file with: [[ ! -d /lib/modules/"${1}" ]] ; then Yes > Should I provide a patch for this? Yes and apply if it works for you. (I haven't tested anything)
when using akmods, both kernel and the matching kernel-devel are mandatory.
Created attachment 1636397 [details] Add check kernel differently (In reply to Nicolas Chauvet (kwizart) from comment #10) > Sorry, can you reword with less word ? It's already the minimal response it was possible to do to avoid misunderstanding. Sorry if that did not help you to understand my response. (In reply to Nicolas Chauvet (kwizart) from comment #11) > Yes Done in the attached patch. > Yes and apply if it works for you. (I haven't tested anything) I will wait for Olivier Syman to test it since I don't have such a configuration at hand. (In reply to Nicolas Chauvet (kwizart) from comment #12) > when using akmods, both kernel and the matching kernel-devel are mandatory. Yes, that was the sense of my too long response when including akmods script comments saying... the same thing. Hope this response is not too long, and the patch will fit the needs. Cordially, __ NVieville
Feel free to apply in branches. Thx
Tested latest patch ( test for /lib/modules/"${1}" existence) and it works as expected.
(In reply to Olivier Samyn from comment #15) > Tested latest patch ( test for /lib/modules/"${1}" existence) and it works > as expected. Thank you Olivier for your feedback. Patch will be applied ASAP. Cordially, -- NVieville
FEDORA-2019-12b4f296d3 has been submitted as an update to Fedora 31. https://bodhi.fedoraproject.org/updates/FEDORA-2019-12b4f296d3
FEDORA-2019-1fdd59ca98 has been submitted as an update to Fedora 30. https://bodhi.fedoraproject.org/updates/FEDORA-2019-1fdd59ca98
FEDORA-2019-70a73b7747 has been submitted as an update to Fedora 29. https://bodhi.fedoraproject.org/updates/FEDORA-2019-70a73b7747
FEDORA-EPEL-2019-7112c74966 has been submitted as an update to Fedora EPEL 7. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2019-7112c74966
FEDORA-EPEL-2019-bdc2a0d1d4 has been submitted as an update to Fedora EPEL 8. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2019-bdc2a0d1d4
akmods-0.5.6-24.fc31 has been pushed to the Fedora 31 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2019-12b4f296d3
akmods-0.5.6-24.el8 has been pushed to the Fedora EPEL 8 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2019-bdc2a0d1d4
akmods-0.5.6-24.el7 has been pushed to the Fedora EPEL 7 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2019-7112c74966
akmods-0.5.6-24.fc30 has been pushed to the Fedora 30 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2019-1fdd59ca98
akmods-0.5.6-24.fc29 has been pushed to the Fedora 29 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2019-70a73b7747
akmods-0.5.6-24.fc31 has been pushed to the Fedora 31 stable repository. If problems still persist, please make note of it in this bug report.
akmods-0.5.6-24.fc30 has been pushed to the Fedora 30 stable repository. If problems still persist, please make note of it in this bug report.
akmods-0.5.6-24.el8 has been pushed to the Fedora EPEL 8 stable repository. If problems still persist, please make note of it in this bug report.
akmods-0.5.6-24.el7 has been pushed to the Fedora EPEL 7 stable repository. If problems still persist, please make note of it in this bug report.