initramfs-tools: only allow hook scripts to errexit on mkinitramfs

version is "the" essential exported variable by mkinitramfs.
Use it's string length to determine that we are on mkinitramfs stage
and not trying to boot a not precached initramfs image.

hook scripts on boot can exit due to random failures and shouldn't
interrupt boot there.

Signed-off-by: maximilian attems <maks@debian.org>
This commit is contained in:
maximilian attems 2010-08-06 23:59:07 +02:00
parent 762ae2a78f
commit a4e1a9ea73

View File

@ -222,7 +222,8 @@ call_scripts()
# allow hooks to abort build:
if [ "$ec" -ne 0 ]; then
echo "E: ${initdir}/${cs_x} failed with return $ec."
exit $ec
# only errexit on mkinitramfs
[ -n "${version}" ] && exit $ec
fi
# allow boot scripts to modify exported boot parameters
if [ -e /conf/param.conf ]; then