-
Notifications
You must be signed in to change notification settings - Fork 150
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
common.postinst: binary-only ldtarball fails because load_tarball returns non-zero status #362
Comments
Abstracting ourselves from all the code and implementation details, can you outline a simple reproducer - the more noob friendly the better - the expected behaviour and the actual result you're seeing. Thanks. |
Sure, you're welcome. We have a dkms driver which works fine compiling from sources (fedora 38, x86_64). We would like to avoid the compilation step on a specific device with fixed kernel and distro (fedora 38 as well, x86_64). We used That said, we are now working on packaging such prebuilt driver as RPM package for which we have the following command in the %posttrans hook
According to the code of common.postinst, when $3 is defined (TARBALL_ROOT, valued /usr/modules at runtime) it is expected to load the driver from a prebuilt tarball with specific file name However, the rpm install fails because common.postinst exits with error from the above line of code. During install, we see the ldtarball command is being executed with right arguments and is printing out normal informational messages to the console but its final exit status makes the if statement at that sae line to take the main branch and thus entering the error condition returned to the rpm package installer. To reproduce, load and build any dkms module, use mktarball with binaries-only option to create a prebuilt tarball, remove the module from dkms system and then try using the above |
If you have done the analysis and can open a MR that would be great. I would request that it includes a test case so we don't regress things. Alternatively a step-by-step reproducer, as requested earlier is warranted. |
Hint: You could use the minimal kernel module from |
Great I'll try to make repro steps then. I can also make a PR for the fix but before making a blind fix I would need to ask whoever authored the load_tarball function if it is expected for that function to return 1 in similar invocations. Then I would patch load_tarball rather then common.postinst |
If you are going to make a PR, you should probably start with adding some tests for From a sanely behaving mktarball and ldtarball subcommand I'd expect a return value of 0 on success and !0 otherwise. (Using sane return values is not something dkms did in the past. But it is getting better.) |
dkms/dkms_common.postinst
Line 141 in 749b219
The line above expects ldtarball to exit with status 0 on success but 1 is returned. I have a binary-only tarball made by mktarball which loads and works just fine but I can't make an rpm out of it using common.postinst because it seems that load_tarball function returns non-zero status even if tarball is loaded successfully.
If the exit status of 1 is correct then the above line should be changed in order to accept that situation without failing.
The text was updated successfully, but these errors were encountered: