Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dkms: error out if $arch cannot be determined
if for some reason $arch cannot be determined (e.g. due to a broken rpm shim on distributions using a different package manager), dkms will happily build a module, placing state info in /var/lib/dkms/$module/$version/$kernel//, but that subsequently causes errors because the module is not considered to be installed and at the same time cannot be removed any more Before: .# dkms status .# ln -s /bin/true /usr/bin/rpm .# dkms add dkms_test/1.0 Creating symlink /var/lib/dkms/dkms_test/1.0/source -> /usr/src/dkms_test-1.0 .# dkms status dkms_test/1.0: added .# dkms build -k 6.1.0-9-amd64 dkms_test/1.0 Sign command: /usr/lib/linux-kbuild-6.1/scripts/sign-file Signing key: /var/lib/dkms/mok.key Public certificate (MOK): /var/lib/dkms/mok.pub Building module: Cleaning build area... make -j16 KERNELRELEASE=6.1.0-9-amd64 -C /lib/modules/6.1.0-9-amd64/build M=/var/lib/dkms/dkms_test/1.0/build... Signing module /var/lib/dkms/dkms_test/1.0/build/dkms_test.ko Cleaning build area... .# dkms status dkms_test/1.0: added .# dkms build -k 6.1.0-9-amd64 dkms_test/1.0 Sign command: /usr/lib/linux-kbuild-6.1/scripts/sign-file Signing key: /var/lib/dkms/mok.key Public certificate (MOK): /var/lib/dkms/mok.pub Error! This module/version has already been built on: 6.1.0-9-amd64 Directory /var/lib/dkms/dkms_test/1.0/6.1.0-9-amd64/ already exists. Use the dkms remove function before trying to build again. .# dkms status dkms_test/1.0: added .# dkms remove -k 6.1.0-9-amd64 dkms_test/1.0 Module dkms_test 1.0 is not installed for kernel 6.1.0-9-amd64 (). Skipping... Module dkms_test 1.0 is not built for kernel 6.1.0-9-amd64 (). Skipping... .# dkms status dkms_test/1.0: added .# dkms remove dkms_test/1.0 --all .# dkms status dkms_test/1.0: added .# find /var/lib/dkms/dkms_test/1.0/ /var/lib/dkms/dkms_test/1.0/ /var/lib/dkms/dkms_test/1.0/6.1.0-9-amd64 /var/lib/dkms/dkms_test/1.0/6.1.0-9-amd64/module /var/lib/dkms/dkms_test/1.0/6.1.0-9-amd64/module/dkms_test.ko /var/lib/dkms/dkms_test/1.0/6.1.0-9-amd64/log /var/lib/dkms/dkms_test/1.0/6.1.0-9-amd64/log/make.log /var/lib/dkms/dkms_test/1.0/6.1.0-9-amd64/log/.config /var/lib/dkms/dkms_test/1.0/source After: .# dkms status .# ln -s /bin/true /usr/bin/rpm .# dkms add dkms_test/1.0 Error! Could not determine architecture. .# echo $? 12
- Loading branch information