[U-Boot] [PATCH] mkconfig: deny messed up ARCH definition

Refuse to setup a platform if the command line ARCH= is not the same as the one required for the board. This prevents any user with prehistoric aliases from messing up thier builds
Reported in thread: http://old.nabble.com/-U-Boot--Build-breaks-on-some-OMAP3-configs-to26132721...
Signed-off-by: Nishanth Menon nm@ti.com --- mkconfig | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/mkconfig b/mkconfig index 4c5675b..87ac6d4 100755 --- a/mkconfig +++ b/mkconfig @@ -27,6 +27,11 @@ done [ $# -lt 4 ] && exit 1 [ $# -gt 6 ] && exit 1
+if [ ! -z "$ARCH" -a "$ARCH" != "$2" ]; then + echo "ARCH=$ARCH while ${BOARD_NAME} arch=$2: fail" + exit 1 +fi + echo "Configuring for ${BOARD_NAME} board..."
#

On Saturday 31 October 2009 10:12:01 Nishanth Menon wrote:
Refuse to setup a platform if the command line ARCH= is not the same as the one required for the board. This prevents any user with prehistoric aliases from messing up thier builds
seems like excessive line wrapping
+if [ ! -z "$ARCH" -a "$ARCH" != "$2" ]; then
is the !-z really needed ?
- echo "ARCH=$ARCH while ${BOARD_NAME} arch=$2: fail"
should be sent to stderr: 1>&2 -mike

-----Original Message----- From: Mike Frysinger [mailto:vapier@gentoo.org] Sent: Saturday, October 31, 2009 11:41 PM To: u-boot@lists.denx.de Cc: Menon, Nishanth; Gadiyar, Anand Subject: Re: [U-Boot] [PATCH] mkconfig: deny messed up ARCH definition
On Saturday 31 October 2009 10:12:01 Nishanth Menon wrote:
Refuse to setup a platform if the command line ARCH= is not the same as the one required for the board. This prevents any user with prehistoric aliases from messing up thier builds
seems like excessive line wrapping
Ok.. will stick with 70 chars..
+if [ ! -z "$ARCH" -a "$ARCH" != "$2" ]; then
is the !-z really needed ?
We don't want the check to trigger if ARCH is not defined. [ "$ARCH" != "$2" ] will trigger as "" != "arm"
- echo "ARCH=$ARCH while ${BOARD_NAME} arch=$2: fail"
should be sent to stderr: 1>&2
Ack.
Regards, Nishanth Menon

On Saturday 31 October 2009 18:20:06 Menon, Nishanth wrote:
From: Mike Frysinger
On Saturday 31 October 2009 10:12:01 Nishanth Menon wrote:
+if [ ! -z "$ARCH" -a "$ARCH" != "$2" ]; then
is the !-z really needed ?
We don't want the check to trigger if ARCH is not defined. [ "$ARCH" != "$2" ] will trigger as "" != "arm"
the implied question is whether this is a valid state. i know you dont want that kind of comparison, but i thought the Makefile would have set it up for you by default. now that i think about it a bit more, that isnt what happens at all.
so only thing to change here is to use -n and not !-z -mike

Dear Mike Frysinger,
In message 200911010838.08938.vapier@gentoo.org you wrote:
+if [ ! -z "$ARCH" -a "$ARCH" != "$2" ]; then
is the !-z really needed ?
We don't want the check to trigger if ARCH is not defined. [ "$ARCH" != "$2" ] will trigger as "" != "arm"
the implied question is whether this is a valid state. i know you dont wan> t that kind of comparison, but i thought the Makefile would have set it up fo> r you by default. now that i think about it a bit more, that isnt what happe> ns at all.
so only thing to change here is to use -n and not !-z
Or even omit the (redundant) "-n" and just write
if [ "$ARCH" -a "$ARCH" != "$2" ]; then ...
Best regards,
Wolfgang Denk

From: Wolfgang Denk [mailto:wd@denx.de] Sent: Sunday, November 01, 2009 8:58 AM
Dear Mike Frysinger,
In message 200911010838.08938.vapier@gentoo.org you wrote:
+if [ ! -z "$ARCH" -a "$ARCH" != "$2" ]; then
is the !-z really needed ?
We don't want the check to trigger if ARCH is not defined. [ "$ARCH" != "$2" ] will trigger as "" != "arm"
the implied question is whether this is a valid state. i know you dont
wan> t
that kind of comparison, but i thought the Makefile would have set it up
fo> r
you by default. now that i think about it a bit more, that isnt what
happe> ns
at all.
so only thing to change here is to use -n and not !-z
Or even omit the (redundant) "-n" and just write
if [ "$ARCH" -a "$ARCH" != "$2" ]; then
Ack. V2 coming up
Regards, Nishanth Menon
participants (4)
-
Menon, Nishanth
-
Mike Frysinger
-
Nishanth Menon
-
Wolfgang Denk