summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Reisner <dreisner@archlinux.org>2013-11-27 21:23:23 +0100
committerDave Reisner <dreisner@archlinux.org>2013-11-27 21:23:26 +0100
commite7b20bb79e72b311e7dce76d1b9f67eb8dcaa641 (patch)
treeff1824c0c49a2640b20dd7ebeb6d9c0f0172bd96
parentcf9be93525fb393b0db85a341dfca6fafdd9fab7 (diff)
downloadmkinitcpio-e7b20bb79e72b311e7dce76d1b9f67eb8dcaa641.tar.gz
mkinitcpio-e7b20bb79e72b311e7dce76d1b9f67eb8dcaa641.tar.xz
merge optkver into KERNELVERSION
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
-rwxr-xr-xmkinitcpio14
1 files changed, 8 insertions, 6 deletions
diff --git a/mkinitcpio b/mkinitcpio
index 2ec44ed..39aa4d9 100755
--- a/mkinitcpio
+++ b/mkinitcpio
@@ -18,7 +18,7 @@ _d_firmware=({/usr,}/lib/firmware/updates {/usr,}/lib/firmware)
_d_presets=mkinitcpio.d
# options and runtime data
-_optmoduleroot= _optkver= _optgenimg=
+_optmoduleroot= _optgenimg=
_optcompress= _opttargetdir=
_optshowautomods=0 _optsavetree=0 _optshowmods=0
_optquiet=1 _optcolor=1
@@ -104,7 +104,7 @@ resolve_kernver() {
kver "$kernel" && return
- error "invalid kernel specified: \`%s'" "$_optkver"
+ error "invalid kernel specified: \`%s'" "$1"
return 1
}
@@ -323,7 +323,7 @@ while :; do
;;
-k|--kernel)
shift
- _optkver=$1
+ KERNELVERSION=$1
;;
-s|--save)
_optsavetree=1
@@ -415,9 +415,11 @@ if (( ${#_optpreset[*]} )); then
exit
fi
-KERNELVERSION=$(resolve_kernver "$_optkver") || cleanup 1
-_d_kmoduledir=$_optmoduleroot/lib/modules/$KERNELVERSION
-[[ $KERNELVERSION == none || -d $_d_kmoduledir ]] || die "'$_d_kmoduledir' is not a valid kernel module directory"
+if [[ $KERNELVERSION != 'none' ]]; then
+ KERNELVERSION=$(resolve_kernver "$KERNELVERSION") || cleanup 1
+ _d_kmoduledir=$_optmoduleroot/lib/modules/$KERNELVERSION
+ [[ -d $_d_kmoduledir ]] || die "'$_d_kmoduledir' is not a valid kernel module directory"
+fi
_d_workdir=$(initialize_buildroot "$KERNELVERSION" $_opttargetdir) || cleanup 1
BUILDROOT=${_opttargetdir:-$_d_workdir/root}