Bug 1769144 - akmods does not build when systemd-boot is used
Summary: akmods does not build when systemd-boot is used
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: akmods
Version: 31
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: 2019-11-05 23:37 UTC by Olivier Samyn
Modified: 2019-12-07 02:38 UTC (History)
6 users (show)

Fixed In Version: akmods-0.5.6-24.fc31 akmods-0.5.6-24.fc30 akmods-0.5.6-24.el8 akmods-0.5.6-24.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-11-29 00:53:49 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Add check kernel for systemd-boot (1.73 KB, patch)
2019-11-06 15:35 UTC, nicolas.vieville
no flags Details | Diff
Add check kernel for systemd-boot (1.73 KB, patch)
2019-11-14 15:30 UTC, nicolas.vieville
no flags Details | Diff
Add check kernel differently (1.12 KB, patch)
2019-11-15 08:18 UTC, nicolas.vieville
no flags Details | Diff

Description Olivier Samyn 2019-11-05 23:37:31 UTC
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"

Comment 1 leigh scott 2019-11-06 07:11:38 UTC
I have zero interest in this.

Comment 2 Nicolas Chauvet (kwizart) 2019-11-06 07:53:41 UTC
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.

Comment 3 Nicolas Chauvet (kwizart) 2019-11-06 07:57:33 UTC
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).

Comment 4 Olivier Samyn 2019-11-06 09:02:37 UTC
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.

Comment 5 nicolas.vieville 2019-11-06 15:35:46 UTC
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

Comment 6 nicolas.vieville 2019-11-14 15:30:22 UTC
Created attachment 1636157 [details]
Add check kernel for systemd-boot

Corrected typo in patch.

Comment 7 Nicolas Chauvet (kwizart) 2019-11-14 15:35:12 UTC
@Nicolas
This is yet again a too complex change where it would only be needed to check for /lib/modules/$(uname -r) availability.

Comment 8 Nicolas Chauvet (kwizart) 2019-11-14 15:36:20 UTC
or /lib/modules/${KERNEL_UNAME_R} (whatever the appropriate variable is in the akmods context)

Comment 9 nicolas.vieville 2019-11-14 17:50:44 UTC
@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

Comment 10 Nicolas Chauvet (kwizart) 2019-11-14 18:50:08 UTC
Sorry, can you reword with less word ?

Comment 11 Nicolas Chauvet (kwizart) 2019-11-14 18:51:48 UTC
> - 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)

Comment 12 Nicolas Chauvet (kwizart) 2019-11-14 19:06:38 UTC
when using akmods, both kernel and the matching kernel-devel are mandatory.

Comment 13 nicolas.vieville 2019-11-15 08:18:45 UTC
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

Comment 14 Nicolas Chauvet (kwizart) 2019-11-15 16:50:38 UTC
Feel free to apply in branches.
Thx

Comment 15 Olivier Samyn 2019-11-18 00:18:59 UTC
Tested latest patch ( test for /lib/modules/"${1}" existence) and it works as expected.

Comment 16 nicolas.vieville 2019-11-18 18:06:04 UTC
(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

Comment 17 Fedora Update System 2019-11-20 14:25:51 UTC
FEDORA-2019-12b4f296d3 has been submitted as an update to Fedora 31. https://bodhi.fedoraproject.org/updates/FEDORA-2019-12b4f296d3

Comment 18 Fedora Update System 2019-11-20 14:33:19 UTC
FEDORA-2019-1fdd59ca98 has been submitted as an update to Fedora 30. https://bodhi.fedoraproject.org/updates/FEDORA-2019-1fdd59ca98

Comment 19 Fedora Update System 2019-11-20 14:39:44 UTC
FEDORA-2019-70a73b7747 has been submitted as an update to Fedora 29. https://bodhi.fedoraproject.org/updates/FEDORA-2019-70a73b7747

Comment 20 Fedora Update System 2019-11-20 14:44:55 UTC
FEDORA-EPEL-2019-7112c74966 has been submitted as an update to Fedora EPEL 7. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2019-7112c74966

Comment 21 Fedora Update System 2019-11-20 14:50:25 UTC
FEDORA-EPEL-2019-bdc2a0d1d4 has been submitted as an update to Fedora EPEL 8. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2019-bdc2a0d1d4

Comment 22 Fedora Update System 2019-11-21 02:27:24 UTC
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

Comment 23 Fedora Update System 2019-11-21 02:42:56 UTC
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

Comment 24 Fedora Update System 2019-11-21 03:08:26 UTC
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

Comment 25 Fedora Update System 2019-11-21 04:18:09 UTC
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

Comment 26 Fedora Update System 2019-11-21 04:22:15 UTC
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

Comment 27 Fedora Update System 2019-11-29 00:53:49 UTC
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.

Comment 28 Fedora Update System 2019-11-29 02:46:21 UTC
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.

Comment 29 Fedora Update System 2019-12-07 02:10:26 UTC
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.

Comment 30 Fedora Update System 2019-12-07 02:38:48 UTC
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.


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