Skip to content
Browse files

api: kill slow path in locating modules

since modinfo _does_ in fact have an undocumented basedir option, use
it.
  • Loading branch information...
1 parent 29583f3 commit 86126ed4c5779228f9a16853be5e294c08ffe1e1 @falconindy committed Jun 8, 2011
Showing with 1 addition and 7 deletions.
  1. +1 −7 geninit.api
View
8 geninit.api
@@ -79,13 +79,7 @@ add_module() { # {{{
module=${1%%.*}
- if [[ -z "$basedir" ]]; then # fast path =)
- read -rd '' modpath < <(__kmodinfo -n "$module" 2>/dev/null)
- else # slow path =(
- read -rd '' modpath < <(find "$basedir$moduledir/kernel" -type f
- -name "$module.ko*" -print0)
- fi
-
+ read -rd '' modpath < <(__kmodinfo -n "$module" 2>/dev/null)
if [[ -z "$modpath" ]]; then
error "Module not found: $module"
return 1

0 comments on commit 86126ed

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