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" match,and will get the symbolic files
(are usually the symbolic files for weak_modules in /lib/*/weak-updates directory)
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" match actually do nothing so it's
get nothing wrong.

Fix it by adding "-type f" param after each "-name" option.
  • Loading branch information
WizardHowlhaha authored and scaronni committed Sep 15, 2024
1 parent e2405f1 commit 270e0cd
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 270e0cd

Please sign in to comment.