Modifications since 0.6.0:
======================================================================
+* Allow to use '\' to escape control characters (';' and '$') while
+ parsing input - needed to be able to enter a `bootcmd' which
+ contains more than one command and/or references to variables,
+ which are resolved not before when running the command.
+
* MBX8xx support (thanks to Marius Gröger)
* Fix violation of BOOTP message format.
- cogent Files specific to Cogent boards
(need further configuration)
- fads Files specific to Motorola FADS boards
+- mbx8xx Files specific to Motorola MBX boards
Software Configuration:
CONFIG_TQM823L, CONFIG_TQM850L, CONFIG_TQM855L,
CONFIG_TQM860L, CONFIG_ETX094, CONFIG_ADCIOP,
CONFIG_CPCI405, CONFIG_COGENT, CONFIG_FADS,
- CONFIG_SPD823TS,CONFIG_FPS850L
+ CONFIG_SPD823TS,CONFIG_FPS850L, CONFIG_MBX
--- FIXME --- not tested yet:
- CONFIG_TQM860, CONFIG_MBX, CONFIG_ADS,
+ CONFIG_TQM860, CONFIG_ADS,
CONFIG_RPXLITE, CONFIG_RPXCLASSIC, CONFIG_BSEIP
FADS850SAR_config
SPD823TS_config
cogent_mpc8xx_config
+ MBX_config
If the system board that you have is not listed, then you will need
static void process_macros (char *input, char *output)
{
- char c, *varname_start;
+ char c, prev, *varname_start;
int inputcnt = strlen (input);
int outputcnt = CFG_CBSIZE;
int state = 0; /* 0 = waiting for '$' */
printf ("[PROCESS_MACROS] INPUT=%s\n", input);
#endif
+ prev = '\0'; /* previous character */
+
while (inputcnt && outputcnt) {
c = *input++;
inputcnt--;
+ /* remove one level of escape characters */
+ if ((c == '\\') && (prev != '\\')) {
+ if (inputcnt-- == 0)
+ break;
+ prev = c;
+ c = *input++;
+ }
+
switch (state) {
- case 0: /* Waiting for $ */
- if (c == '$') {
+ case 0: /* Waiting for (unescaped) $ */
+ if ((c == '$') && (prev != '\\')) {
state++;
} else {
*(output++) = c;
}
break;
}
+
+ prev = c;
}
if (outputcnt)
char *sep;
char *t;
- /* find separator, or string end */
+ /*
+ * Find separator, or string end
+ * Allow simple escape of ';' by writing "\;"
+ */
for (sep = str; *sep; sep++) {
- if (*sep == ';')
+ if ((*sep == ';') && /* separator */
+ ( sep != str) && /* past string start */
+ (*(sep-1) != '\\')) /* and NOT escaped */
break;
}
- /* extract the token between separators */
+ /*
+ * Extract the token between separators
+ */
for (t = token; str < sep;) {
*t++ = *str++;
if (t >= token + CFG_CBSIZE - 1)
break; /* just in case */
}
*t = '\0';
+#ifdef DEBUG_PARSER
+ printf ("token: \"%s\"\n", token);
+#endif
/* Process macros into this token and replace them */
process_macros (token, finaltoken);
#undef CONFIG_BOOTARGS
#define CONFIG_BOOTCOMMAND \
"bootp; " \
- "setenv bootargs root=/dev/nfs nfsroot=$(serverip):$(rootpath) " \
+ "setenv bootargs root=/dev/nfs rw nfsroot=$(serverip):$(rootpath) " \
"ip=$(ipaddr):$(serverip):$(gatewayip):$(netmask):$(hostname)::off; " \
"bootm"