From 606d15310a273da4a41b460b47ff3a4f5c54f3eb Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Mon, 16 Apr 2012 08:40:11 -0400 Subject: 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 --- mkinitcpio | 4 ++++ 1 file changed, 4 insertions(+) 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" -- cgit v1.2.3-24-g4f1b