summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Reisner <dreisner@archlinux.org>2012-04-16 14:40:11 +0200
committerDave Reisner <dreisner@archlinux.org>2012-04-16 14:40:11 +0200
commit606d15310a273da4a41b460b47ff3a4f5c54f3eb (patch)
tree9478cc4dba5b068b41cab63386104ecc877b3885
parent9b17abfc946a1cdb348e0d31c883cef621fdcef5 (diff)
downloadmkinitcpio-606d15310a273da4a41b460b47ff3a4f5c54f3eb.tar.gz
mkinitcpio-606d15310a273da4a41b460b47ff3a4f5c54f3eb.tar.xz
mkinitcpio: refuse to run without hooks defined
This still doesn't solve all our problems, but it gets us closer. There's no point in creating an image if HOOKS aren't present as this is the bread and butter of any sane mkinitcpio recipe. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
-rwxr-xr-xmkinitcpio4
1 files changed, 4 insertions, 0 deletions
diff --git a/mkinitcpio b/mkinitcpio
index bb85f7f..4618baa 100755
--- a/mkinitcpio
+++ b/mkinitcpio
@@ -276,6 +276,10 @@ if [[ ! -f "$CONFIG" ]]; then
fi
. "$CONFIG"
+if [[ -z ${HOOKS//[[:space:]]} && -z ${ADDHOOKS[@]} ]]; then
+ die "Invalid config: No hooks found"
+fi
+
MODULEDIR=$BASEDIR/lib/modules/$KERNELVERSION/
if [[ ! -d $MODULEDIR ]]; then
die "'$MODULEDIR' is not a valid kernel module directory"