diff options
author | maximilian attems <maks@debian.org> | 2010-06-17 14:29:23 +0200 |
---|---|---|
committer | maximilian attems <maks@debian.org> | 2010-06-17 14:32:13 +0200 |
commit | 68c87cd042ce2819625b2f067cf67e690d8b2ce8 (patch) | |
tree | 435bee5179d7a38c21002f8d183b955d0b06a022 | |
parent | fafede51c3adca9f70bdb1bbe629db9aba35be85 (diff) | |
download | initramfs-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>
-rw-r--r-- | scripts/functions | 11 |
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} |