-
Notifications
You must be signed in to change notification settings - Fork 164
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
dkms remove fails if /lib/modules/XXXX/modules.dep file not found #166
Comments
A reasonable thing to do is to simply ignore the |
Emil,
While I agree that using "module.ko*" would be a sensible idea, it
wouldn't work in this case, as actually fails in a test to see if the
file with different extensions exist. It would need to further code
rearrangements for it to work.
Frank
…On Mon, 2021-10-11 at 12:15 -0700, Emil Velikov wrote:
A reasonable thing to do is to simply ignore the compressed_suffix
and use rm /path/to/module/module.ko*. Although it might not be as
trivial - haven't looked at that code.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
|
I ran into a problem related to this issue on Arch Linux, which allows installing and uninstalling the kernel image and headers independently. If you uninstall the kernel image first (which removes As others have noted, the problem comes from the variable My first idea was that you could set the value by reading ( The best fix I found is to remove the use of diff --git a/dkms.in b/dkms.in
index ef94ad1..9de3a33 100644
--- a/dkms.in
+++ b/dkms.in
@@ -193,13 +193,13 @@ compressed_or_uncompressed()
{
# module dir = $1
# module = $2
- local test1="$1/$2$module_uncompressed_suffix"
- local test2="$1/$2$module_uncompressed_suffix$module_compressed_suffix"
- if [[ -e "$test1" ]]; then
- echo "$test1"
- elif [[ -e "$test2" ]]; then
- echo "$test2"
- fi
+ for suffix in "" .gz .xz .zst; do
+ local test="$1/$2$module_uncompressed_suffix$suffix"
+ if [[ -e "$test" ]]; then
+ echo "$test"
+ break
+ fi
+ done
}
# Finds .ko or .ko.xz based on a tree and module name As far as I can tell, this fixes the issue as reported by the OP. The only loose end is that there is another use of |
First ideas are usually the best ;-) Not a fan of the proposed semi-random file look-ups since it's not an indication that a) the user did not manually un/compressed the file and b) it will work. Usually it's kmod (or the busybox variant) doing the decompression before passing the module to the kernel, although upcoming work will defer the decompression to the kernel itself. While I don't think we can easily As an example the default
Is that for distro modules or dkms ones? I'm not sure how this can affect us*, although if needed we can add a quirk/override via If you can submit a MR + a trivial test or two that would be amazing. Couple of test ideas, feel free to add extra/change/extend as you see fit:
|
If the file modules.dep does not exist, because the directory has been removed or just cleaned up from an uninstall, then dkms remove fails with the message:
There is no instance of $module $module_version for kernel $1 ($2) located in the DKMS tree
Tracing back through the code, the issue is that the variable "module_compressed_suffix" is not set, as modules.dep does not exist, and hence it does not find the built module in the DKMS tree, if it is a compressed module. This then fails the remove_module function, and does not remove the files out of the DKMS tree.
The text was updated successfully, but these errors were encountered: