diff options
author | Dave Reisner <dreisner@archlinux.org> | 2012-04-16 14:40:11 +0200 |
---|---|---|
committer | Dave Reisner <dreisner@archlinux.org> | 2012-04-16 14:40:11 +0200 |
commit | 606d15310a273da4a41b460b47ff3a4f5c54f3eb (patch) | |
tree | 9478cc4dba5b068b41cab63386104ecc877b3885 | |
parent | 9b17abfc946a1cdb348e0d31c883cef621fdcef5 (diff) | |
download | mkinitcpio-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-x | mkinitcpio | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -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" |