From 68c87cd042ce2819625b2f067cf67e690d8b2ce8 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Thu, 17 Jun 2010 14:29:23 +0200 Subject: 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 --- scripts/functions | 11 +++++++++++ 1 file changed, 11 insertions(+) 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} -- cgit v1.2.3