Bugfix: remove embedded null (\0) from CFG_BOOTFILE macro in TQM8540_config
authorGrant Likely <grant.likely@secretlab.ca>
Tue, 18 Sep 2007 18:24:57 +0000 (12:24 -0600)
committerWolfgang Denk <wd@denx.de>
Tue, 18 Sep 2007 19:24:59 +0000 (21:24 +0200)
/bin/bash and /bin/dash (which /bin/sh is linked to on ubuntu) handle embedded
nulls in a string differently.  For example, the following statement:
    echo "this is a string\0" > afile
Will produce the following with /bin/bash:
    "this is a string\0"
But with /bin/dash, will produce:
    "this is a string

Bug fixed by moving the embedded null out of the makefile and into the
config header.  Also renamed the macro to avoid usage colision with the same
macro used by other board ports.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Makefile
include/configs/TQM85xx.h

index 85885b166a6eab9d8efeefcb347d32b327761ee9..a87311ca1f9f2cf2e56eff265173284e0252cc47 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1961,7 +1961,7 @@ TQM8560_config:           unconfig
        echo "#define CONFIG_TQM$${CTYPE}">>$(obj)include/config.h; \
        echo "#define CONFIG_HOSTNAME tqm$${CTYPE}">>$(obj)include/config.h; \
        echo "#define CONFIG_BOARDNAME \"TQM$${CTYPE}\"">>$(obj)include/config.h; \
-       echo "#define CFG_BOOTFILE \"bootfile=/tftpboot/tqm$${CTYPE}/uImage\0\"">>$(obj)include/config.h
+       echo "#define CFG_BOOTFILE_PATH \"/tftpboot/tqm$${CTYPE}/uImage\"">>$(obj)include/config.h
        @$(MKCONFIG) -a TQM85xx ppc mpc85xx tqm85xx
 
 #########################################################################
index 2f23c504930ffbe6750332edfbccc9b5bd50ebf2..6dbd3924bdd45c0061b3a0b9011a2ef4b9eadec3 100644 (file)
 #undef CONFIG_BOOTARGS         /* the boot command will set bootargs   */
 
 #define        CONFIG_EXTRA_ENV_SETTINGS                                       \
-       CFG_BOOTFILE                                                    \
+       "bootfile="CFG_BOOTFILE_PATH"\0"                                \
        "netdev=eth0\0"                                                 \
        "consdev=ttyS0\0"                                               \
        "nfsargs=setenv bootargs root=/dev/nfs rw "                     \