<html><head></head><body><div class="yahoo-style-wrap" style="font-family:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:13px;"><div dir="ltr" data-setdir="false">In the dd-wrt community build project we noticed some errors buried for years in the huge build log and traced them back to a malformed line in a busybox <i>.config </i>file (our fault). The existing busybox scripts' error checking will only get triggered if the <span>malformed line is the last one executed in the</span> <i>.config</i> being sourced.<br></div><div dir="ltr" data-setdir="false"><br></div><div dir="ltr" data-setdir="false">The bad line (see below) passed the gnu make <span>syntax checking but unknowingly failed /bin/sh <span><span>syntax checking</span></span>.</span> <br></div><div dir="ltr" data-setdir="false"><br></div><div dir="ltr" data-setdir="false"><div>CONFIG_PREFIX="$(PREFIX)"<br><br></div><div dir="ltr" data-setdir="false"><span>Here's a possible way to trigger errors no matter on which line the error occurs. Note that the trylink script sources the .<i>config</i> file twice but the below patch only sets the "exit immediately" option during one of those times. In our case, one fatal error is enough to notice the bad .<i>config</i> file. Just noticed trylink does not have "|| exit 1" after sourcing so perhaps a missing/invalid .config is acceptable in that case and shouldn't be patched? I know nothing about busybox build scripts...<br></span></div></div><div dir="ltr" data-setdir="false"><i><br></i></div><div dir="ltr" data-setdir="false">Have been a fan of busybox for years. Congrats on a cool product!<i><br></i></div><div dir="ltr" data-setdir="false"><i><br></i></div><div dir="ltr" data-setdir="false"><i></i><div>diff --git a/scripts/embedded_scripts b/scripts/embedded_scripts<br>index aa7bf3e8a..bb060e787 100755<br>--- a/scripts/embedded_scripts<br>+++ b/scripts/embedded_scripts<br>@@ -1,6 +1,8 @@<br> #!/bin/sh<br> <br>+set -e<br> . ./.config || exit 1<br>+set +e<br> <br> target="$1"<br> custom_loc="$2"<br>diff --git a/scripts/generate_BUFSIZ.sh b/scripts/generate_BUFSIZ.sh<br>index 718788e0b..dedf8e74e 100755<br>--- a/scripts/generate_BUFSIZ.sh<br>+++ b/scripts/generate_BUFSIZ.sh<br>@@ -3,7 +3,9 @@<br> #<br> # scripts/generate_BUFSIZ.sh include/common_bufsiz.h<br> <br>+set -e<br> . ./.config || exit 1<br>+set +e<br> <br> debug=false<br> #debug=true<br>diff --git a/scripts/trylink b/scripts/trylink<br>index 6b74f092d..bf3f44d33 100755<br>--- a/scripts/trylink<br>+++ b/scripts/trylink<br>@@ -228,7 +228,9 @@ else<br>     }<br> fi<br> <br>+set -e<br> . ./.config<br>+set +e<br> <br> sharedlib_dir="0_lib"<br> </div><div><br></div></div></div></body></html>