[U-Boot-Users] how to enable if, then command support in uboot

Gururaja Hebbar K R gururajakr at sanyo.co.in
Fri Mar 28 11:06:39 CET 2008


 
add missing info

Uboot version : 1.3.1
for ARM926EJS processor based board
using arm toolchain from CodeSourcery

Regards
Gururaja

-----Original Message-----
From: Gururaja Hebbar K R 
Sent: Friday, March 28, 2008 6:37 PM
To: 'u-boot-users at lists.sourceforge.net'
Subject: how to enable if, then command support in uboot

Hi all,

I am trying to execute some commands stored in environment as below 

#define	CONFIG_EXTRA_ENV_SETTINGS \
	"boot_mmc="
\
		"if	 mmcinit && "				\
			"fatload mmc 0 ${ramfs_addr} ${ramfs_file} && "
\
			"fatload mmc 0 ${loadaddr} ${bootfile}; "
\
		"then "						\
			"run ramargs fixedip addtty set_ramfs;"
\
			"setenv bootargs ${bootargs} ${othbootargs};"
\
			"bootm ${loadaddr}"	\
		"fi\0"	\


My board config is as below 

<snip>
<snip>

/*
 * Command line configuration. *
*/
#include <config_cmd_default.h>

#if defined(CONFIG_MMC)

/* User serviceable stuff */
#define CONFIG_DOS_PARTITION		1

#define CONFIG_CMD_MMC
//#define CONFIG_CMD_EXT2
#define CONFIG_CMD_FAT
#endif

#undef CONFIG_CMD_AUTOSCRIPT
#undef CONFIG_CMD_CONSOLE
#undef CONFIG_CMD_ECHO
#undef CONFIG_CMD_FPGA
#undef CONFIG_CMD_IMLS
#undef CONFIG_CMD_ITEST
#undef CONFIG_CMD_LOADS
#undef CONFIG_CMD_MISC
#undef CONFIG_CMD_SETGETDCR
#undef CONFIG_CMD_XIMG

#define	CONFIG_BOOTDELAY		3	/* autoboot after 3
seconds	*/
#define	CONFIG_BOOTCOMMAND		"run rom_boot"
#undef	CONFIG_BOOTARGS			/* the boot command will set
bootargs */
#define	CONFIG_TIMESTAMP		/* Print image info with
timestamp */


fom the command console when i type 

uboot #> if
Unknown command 'if' - try 'help'
LC69 #> run boot_mmc
Unknown command 'if' - try 'help'
Unknown command 'then' - try 'help'
## Booting image at 0300000f ...
Bad Magic Number
uboot #>


Kindly let me know what i need to enable for this to work.

Thanks in advance

Regards
Gururaja




More information about the U-Boot mailing list