summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Reisner <dreisner@archlinux.org>2012-09-30 17:55:57 +0200
committerDave Reisner <dreisner@archlinux.org>2012-10-07 02:38:02 +0200
commit903e79f5741b70fc5c0166a4b0a9b4f54768cd89 (patch)
tree39c0299d52616d912f4c1d28302245ce089f7994
parentcfee1d1d0031276820fc26dcd185b54be09aff4d (diff)
downloadmkinitcpio-903e79f5741b70fc5c0166a4b0a9b4f54768cd89.tar.gz
mkinitcpio-903e79f5741b70fc5c0166a4b0a9b4f54768cd89.tar.xz
mkinitcpio: remove find_moduledir
Using anything but /lib/modules isn't really sane, and it shouldn't be supported. If you want to use /usr/lib/modules, then /lib must be a symlink to usr/lib. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
-rwxr-xr-xmkinitcpio22
1 files changed, 2 insertions, 20 deletions
diff --git a/mkinitcpio b/mkinitcpio
index be7a1c2..76acc33 100755
--- a/mkinitcpio
+++ b/mkinitcpio
@@ -100,21 +100,6 @@ resolve_kernver() {
return 1
}
-find_moduledir() {
- local d
-
- for d in "$_optmoduleroot"{/usr,}/lib/modules; do
- if [[ -d $d/$1/ ]]; then
- printf '%s' "$d/$1/"
- return 0
- fi
- done
-
- error "unable to locate module directory for kernel \`%s'" "$1"
-
- return 1
-}
-
compute_hookset() {
local h
@@ -372,7 +357,8 @@ fi
[[ $_optpreset ]] && process_preset "$_optpreset"
KERNELVERSION=$(resolve_kernver "$_optkver") || cleanup 1
-_d_kmoduledir=$(find_moduledir "$KERNELVERSION") || cleanup 1
+_d_kmoduledir=$_optmoduleroot/lib/modules/$KERNELVERSION
+[[ -d $_d_kmoduledir ]] || die "'$_d_kmoduledir' is not a valid kernel module directory"
_d_workdir=$(initialize_buildroot "$KERNELVERSION") || cleanup 1
BUILDROOT=$_d_workdir/root
@@ -387,10 +373,6 @@ if (( ${#_hooks[*]} == 0 )); then
die "Invalid config: No hooks found"
fi
-if [[ ! -d $_d_kmoduledir ]]; then
- die "'$_d_kmoduledir' is not a valid kernel module directory"
-fi
-
if (( _optshowautomods )); then
msg "Modules autodetected"
_f_autodetect_hook=$(find_in_dirs 'autodetect' "${_d_install[@]}")