Bug#396388: should allow hooks to abort build
On Tue, Jun 08, 2010 at 03:32:32PM +0200, Michael Prokop wrote:
> * Joey Hess <email@example.com> [Tue Oct 31, 2006 at 01:39:55PM -0500]:
> > mkinitramfs is not a set -x script, and so when call_scripts runs a hook
> > script, any error is ignored.
> I guess you meant "set -e".
> > In some cases, a hook script needs to abort the initramfs build. For
> > example, then nslu2-tools hook script can detect issues, like a missing
> > ixp ethernet driver, that will make the box unusable, and needs to be
> > able to abort the initramfs build in these situations.
> Full ACK.
> > Currently the only way for a hook script to abort the build is a nasty
> > hack. Since call_scripts sources /conf/param.conf, a hook script could
> > create that file, and make it exit 1. Of course, that's beyond gross,
> > and I won't do it. :-)
> > Please provide a mechanism for hook scripts to abort a build. Note that
> > in the past, if a hook script exited nonzero, the build did abort, so my
> > guess is that there are few hook scripts that exit nonzero in cases
> > where the build would continue. However, if you don't feel that's safe
> > now, an alternative would be to check for a flag file in the initramfs
> > tree, which a hook script could create to indicate that the build needs
> > to be aborted.
> A "set -e ... set +e" inside call_scripts() would be sufficient
> AFAICS as the existing scripts seem to exit != 0 only iff there's a
> real problem. So we should just honor that and if people need a more
> flexible way we could provide it as well later on.
> maks, any objections against adding "set -e"? I'd take care of it.
please not too many changes just before release,
there are strange hook scripts out there.