Skip to content

Commit

Permalink
find_module:fix a mistake for kernel with modules uncompressed
Browse files Browse the repository at this point in the history
For kernel with modules uncompressed,dkms find_module()'s command:
find "$1" -name "$2$module_uncompressed_suffix" -o -name "$2$module_suffix" -type f
actually turns out to be:
`find /lib/modules/[kerv] -name [module_name].ko -o -name [module_name].ko -type -f`

the "type -f" is used to include only for regular file, but with the command above,
it only takes effect for the lastest "-name" query,and will get the symbolic files
(are usually the symbolic files for weak_modules in /lib/*/weak-updates directory)
with the first "-name" query by mistake.

For kernel with modules compressed the command turns out to be like:
`find /lib/modules/[kerv] -name [module_name].ko -o -name [module_name].ko.xz -type -f`
All the modules are with suffix ".xz",the first "-name" query actually do nothing so it's
get nothing wrong.

Fix it by adding "-type -f" param after each "-name" query.
  • Loading branch information
WizardHowlhaha committed Sep 12, 2024
1 parent 5e8f056 commit 5bf360e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion dkms.in
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ find_module()
{
# tree = $1
# module = $2
find "$1" -name "$2$module_uncompressed_suffix" -o -name "$2$module_suffix" -type f
find "$1" -name "$2$module_uncompressed_suffix" -type -f -o -name "$2$module_suffix" -type f
return $?
}

Expand Down

0 comments on commit 5bf360e

Please sign in to comment.