Comments (6)
If you are going to make a PR, you should probably start with adding some tests for mktarball
and ldtarball
to run_tests.sh
. These should cover at least the three use cases source/binary/both. For a start it should be sufficient to look at the "success" cases (whether or not they return 0), tests covering all the possible error paths can come later.
From a sanely behaving mktarball and ldtarball subcommand I'd expect a return value of 0 on success and !0 otherwise.
I'm not sure which error case it tries to signal currently with the return of 1.
(Using sane return values is not something dkms did in the past. But it is getting better.)
from dkms.
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.
from dkms.
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 dkms mktarball
with binaries only options to create a prebuilt tar.gz which works fine if we load it using dkms ldtarball
and then dkms install -m Mname -v Mversion
.
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
%posttrans
/usr/lib/dkms/common.postinst %{module} %{version} $RPM_BUILD_ROOT/usr/modules %{buildarch}
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 %{module}-%{version}.dkms.tar.gz
and return success status to the rpm package installer.
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 %posttrans
command to install it again. Use echo $?
to check the exit status code, you will see it is not 0, as the common.postinst expects.
from dkms.
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.
from dkms.
Hint: You could use the minimal kernel module from test/dkms_test-1.0/
for the step-by-step reproducer.
from dkms.
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
from dkms.
Related Issues (20)
- common.postinst and AUTOINSTALL="" HOT 6
- adding a BUILD_EXCLUSIVE_KERNEL... blacklist? HOT 3
- command to (re)sign currently installed modules
- Warnings since dkms-3.0.10 on Arch system HOT 9
- dkms built modules may be compressed in a way unsupported by the kernel HOT 4
- Kernel match for BUILT_MODULE_NAME HOT 9
- Introduce a `build $module for all kernels` functionality HOT 1
- Reintroduce support for `dkms add/build/install m/v --all` HOT 1
- A typo in the readme file
- Ubuntu 22.04 VM broke HOT 6
- marking built/installed modules as rebuild-needed
- parameter validation
- 3.0.13 release isn't tagged as latest on GitHub HOT 1
- OBSOLETE_BY does not prevent building HOT 1
- Retrospective from the recent XZ vuln HOT 1
- DOS-style line endings in dkms.conf break dkms in unpredictable ways HOT 1
- Stop handling dkms.conf as a bash/shell script HOT 7
- Failing to compile nvidia-open-dkms while using a ThinLTO/Clang kernel HOT 3
- Leftover files after zfs build HOT 2
- Keep the Module.symvers file along with the *.ko HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dkms.