Bug 1704698 - dkms autoinstall` fails to substitute variables in build scripts
Summary: dkms autoinstall` fails to substitute variables in build scripts
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: dkms
Version: 31
Hardware: x86_64
OS: Linux
unspecified
unspecified
Target Milestone: ---
Assignee: Simone Caronni
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-04-30 11:39 UTC by Michael
Modified: 2020-11-24 20:09 UTC (History)
20 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-11-24 20:09:29 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github dell dkms issues 73 0 None open `dkms autoinstall` fails to substitute variables in build scripts 2020-07-15 19:45:16 UTC

Description Michael 2019-04-30 11:39:38 UTC
Originally reported here:
https://github.com/dell/dkms/issues/73

>I have observed an inconsistency in the behavior of DKMS regarding the substitution of the variables $kernelver and $arch in build scripts.
>It is documented that $kernelver within dkms.conf will be substituted with the version of the kernel the module is being built for. This appears to extend to build scripts (PRE_BUILD, POST_BUILD, etc.) specified within the conf file: guides such as this one use it within their own build scripts, as part of a setup that presumably works for them.
>
>I confirmed this behavior when initially performing a dkms install for a module on my current kernel: my script was executed with the proper values filled in for the variables. It was during a later kernel update that I noticed my modules weren't being signed automatically. After some digging, I discovered that the dkms autoinstall command run by the kernel update script was not substituting these variables in my script, naturally causing the signing to fail. (The module was otherwise built correctly.)
>
>For now, I've rewritten my script to take these variables as command-line parameters rather than relying on substitution by DKMS. (dkms autoinstall still performs substitutions in dkms.conf; the line POST_BUILD="sign.sh $kernelver $arch" behaves as expected.)

>I observed this behavior with DKMS version 2.6 on Fedora 29.

Comment 1 Michael 2019-04-30 11:40:44 UTC
Same on Fedora 30.

Comment 2 Michael 2019-04-30 15:49:44 UTC
Changing to component 'kernel' because 'dkms' seems to have just one person on CC list.

Comment 3 Laura Abbott 2019-04-30 15:53:19 UTC
The DKMS scripts are maintained by a different team. Please keep it on there for now unless you identify a specific fix required for the kernel.

Also note that module signing was broken for a bit with the 5.0 series. Please test on 5.0.10-200 for F29.

Comment 4 Michael 2019-04-30 16:00:33 UTC
Kernel version 5.0.10-200 is required to be able to load the self-signed module at all (https://bugzilla.redhat.com/show_bug.cgi?id=1701096)-

But my problem is related to the way, the POST_BUILD script is invoked.

This works:
sudo dkms install veeamsnap/3.0.1.1046 -k 5.0.10-200.fc29.x86_64

This is failing:
sudo dkms remove veeamsnap/3.0.1.1046 -k 5.0.10-200.fc29.x86_64
sudo dkms autoinstall

When using autoinstall, the variables ($module, $module_version, $kernelver, $arch) are not substituted when invoking the POST_BUILD script.

Comment 5 Michael 2019-04-30 16:06:01 UTC
Background information:
The issue in the first post is from somebody else. I stumbled over it when I was troubleshooting the same issue on my side.
But it seems like nobody cares about in that DELL issue tracker as this is clearly not a hardware vendor thing.

My context is this one:
https://forums.veeam.com/veeam-agent-for-linux-f41/uefi-secure-boot-on-fedora-t59054.html

Comment 6 Michael 2019-05-07 07:32:00 UTC
Seems like dkms autoinstall isn't called at all any more starting with kernel 5.0.10 or 5.0.11.

Comment 7 The Source 2019-05-12 18:33:03 UTC
I have noticed that dkms has trouble to build modules for newly installed kernels during system boot (i.e. by dkms service). The module itself builds fine but depmod fails:
depmod: FATAL: renameat(/lib/modules/5.0.14-300.fc30.x86_64, modules.dep.tmp, /lib/modules/5.0.14-300.fc30.x86_64, modules.dep): No such file or directory

However, if I call dkms autoinstall manually after boot, module installs just fine.

Comment 8 Ben Cotton 2019-10-31 19:21:09 UTC
This message is a reminder that Fedora 29 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora 29 on 2019-11-26.
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
Fedora 'version' of '29'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 29 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, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 9 Michael 2019-11-02 13:10:39 UTC
Unchanged

Comment 10 Simone Caronni 2020-07-03 07:57:10 UTC
DKMS 2.8.2 has been pushed to Bodhi right now, if someone wants to make a test.

Comment 11 Simon Lanzmich 2020-07-07 11:18:07 UTC
I was seeing the same issue.

Using dkms-2.8.2-1 from updates-testing and configuring the sign_tool in /etc/dkms/framework.conf makes "dkms autoinstall" work again.

Comment 12 Simone Caronni 2020-07-15 19:45:44 UTC
(In reply to Simon Lanzmich from comment #11)
> I was seeing the same issue.
> 
> Using dkms-2.8.2-1 from updates-testing and configuring the sign_tool in
> /etc/dkms/framework.conf makes "dkms autoinstall" work again.

Does it also work without the sign_tool being set?
Btw, just created an update for 2.8.3.

Comment 13 Simon Lanzmich 2020-07-23 09:20:11 UTC
Running a POST_BUILD script with dkms-2.8.3-1.fc32 still shows the original issue, environment variables "$kernelver" and "$arch" are only set with "dkms install", not "dkms autoinstall".

Comment 14 Ben Cotton 2020-11-03 15:14:03 UTC
This message is a reminder that Fedora 31 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora 31 on 2020-11-24.
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
Fedora 'version' of '31'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 31 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, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 15 Ben Cotton 2020-11-24 20:09:29 UTC
Fedora 31 changed to end-of-life (EOL) status on 2020-11-24. Fedora 31 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.


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