Skip to content

Commit

Permalink
mkinitramfs-ll.{ba,z}sh: kernel module expression
Browse files Browse the repository at this point in the history
Fix kernel module extended regular expression, this previous
*<module>*.ko could possible match unwanted module (e.g. video).
So removed '*', now zsh will match '-*' more than <module-name>
and there is no way to do the same for bash script. So module
should be explicitely listed for bash script.
  • Loading branch information
tokiclover committed Sep 30, 2014
1 parent d098a01 commit bb37200
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion mkinitramfs-ll.bash
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ function domod {
local mod module ret
for mod in "$*"; do
declare -a modules
modules=($(find /lib/modules/${opts[-kv]} -name "*${mod}*.ko"))
modules=($(find /lib/modules/${opts[-kv]} -name "${mod}.ko"))
if (( "${#modules[@]}" > 0 )); then
for module in "${modules[@]}"; do
mkdir -p .${module%/*} && cp -ar {,.}${module} ||
Expand Down
2 changes: 1 addition & 1 deletion mkinitramfs-ll.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ function domod {
local mod module ret
for mod ($*) {
typeset -a modules
modules=(/lib/modules/${opts[-kv]}/**/*${mod}*.ko(.))
modules=(/lib/modules/${opts[-kv]}/**/${mod}(|-*).ko(.))
if (( ${#modules} > 0 )) {
for module (${modules})
mkdir -p .${module:h} && cp -ar {,.}${module} ||
Expand Down

0 comments on commit bb37200

Please sign in to comment.