summaryrefslogtreecommitdiff
path: root/scripts/functions
diff options
context:
space:
mode:
authormaximilian attems <maks@debian.org>2010-06-17 14:29:23 +0200
committermaximilian attems <maks@debian.org>2010-06-17 14:32:13 +0200
commit68c87cd042ce2819625b2f067cf67e690d8b2ce8 (patch)
tree435bee5179d7a38c21002f8d183b955d0b06a022 /scripts/functions
parentfafede51c3adca9f70bdb1bbe629db9aba35be85 (diff)
downloadinitramfs-tools-68c87cd042ce2819625b2f067cf67e690d8b2ce8.tar.gz
initramfs-tools-68c87cd042ce2819625b2f067cf67e690d8b2ce8.zip
mkinitramfs: check syntax of boot and hook scripts
only run them when sytax is good. Idea from LP: #570243. important now that we have errexit on for them. Signed-off-by: maximilian attems <maks@debian.org>
Diffstat (limited to 'scripts/functions')
-rw-r--r--scripts/functions11
1 files changed, 11 insertions, 0 deletions
diff --git a/scripts/functions b/scripts/functions
index ac77972..8177216 100644
--- a/scripts/functions
+++ b/scripts/functions
@@ -100,6 +100,13 @@ set_initlist()
continue
fi
+ # skip bad syntax
+ if [ ! sh -n ${si_x} ]; then
+ [ "${verbose}" = "y" ] \
+ && echo "$si_x ignored: bad syntax"
+ continue
+ fi
+
initlist="${initlist} ${si_x#${initdir}/}"
done
}
@@ -123,6 +130,10 @@ reduce_satisfied()
if [ -d ${initdir}/${rs_y} ]; then
continue
fi
+ # skip bad syntax
+ if [ ! sh -n ${initdir}/${rs_y} ]; then
+ continue
+ fi
tmpdeplist="${tmpdeplist} ${rs_y}"
done
deplist=${tmpdeplist}