Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Simplify module discovery, knowing that . is illegal

Taken from module-init-tools, a '.' won't be found in a module name, so
we can simplify how we string trim file/module names.
  • Loading branch information...
commit 52dcddc808fa67d169541b7bc16310381323ddbd 1 parent 7e273f1
Dave Reisner authored

Showing 1 changed file with 5 additions and 5 deletions. Show diff stats Hide diff stats

  1. +5 5 geninit.api
10 geninit.api
@@ -77,13 +77,13 @@ add_module() { # {{{
77 77 local -a firmware moddeps
78 78 local modpath= module= mod= dep=
79 79
80   - module=${1%.ko?(.gz)}
  80 + module=${1%%.*}
81 81
82 82 if [[ -z "$basedir" ]]; then # fast path =)
83 83 read -rd '' modpath < <(__kmodinfo -n "$module" 2>/dev/null)
84 84 else # slow path =(
85   - read -rd '' modpath < <(find "$basedir$moduledir/kernel" -type f \
86   - -name "$module.ko" -o -name "$module.ko.gz" -print0)
  85 + read -rd '' modpath < <(find "$basedir$moduledir/kernel" -type f
  86 + -name "$module.ko*" -print0)
87 87 fi
88 88
89 89 [[ -z "$modpath" ]] && return 1
@@ -202,8 +202,8 @@ add_checked_modules() { # {{{
202 202 pushd "$basedir$moduledir/kernel" &>/dev/null
203 203 while read -rd '' mod; do
204 204 mod=${mod##*/}
205   - mods+=("${mod%.ko?(.gz)}")
206   - done < <(find "$@" -type f \( -name '*.ko' -o -name '*.ko.gz' \) -print0 2>/dev/null)
  205 + mods+=("${mod%%.*}")
  206 + done < <(find "$@" -type f -name '*.ko*' -print0 2>/dev/null)
207 207 popd &>/dev/null
208 208
209 209 # only add what autodetect found if we have a module cache

0 comments on commit 52dcddc

Please sign in to comment.
Something went wrong with that request. Please try again.