--- uClinux-dist-orig/linux-2.6.x/arch/blackfin/kernel/setup.c 2010-08-25 16:56:14.402699145 +0930 +++ uClinux-dist/linux-2.6.x/arch/blackfin/kernel/setup.c 2010-08-25 16:51:43.527198906 +0930 @@ -208,10 +208,40 @@ #endif #if defined(CONFIG_BOOTPARAM) + /* + memset(command_line, 0, sizeof(command_line)); strncpy(&command_line[0], CONFIG_BOOTPARAM_STRING, sizeof(command_line)); command_line[sizeof(command_line) - 1] = 0; + + */ + { + char *p; + char lhs[80]; + char change[80]; + + strncpy(change, CONFIG_BOOTPARAM_STRING, sizeof(command_line)); + + /* extract LHS */ + + p = strchr(change, '='); + if (p) { + strcpy(lhs, change); + lhs[p-change] = 0; + + /* search for LHS in original command line */ + + p = strstr(command_line, lhs); + + if (p) { + /* replace old RHS - + this only works if replacement string is the same length */ + + memcpy(p, change, strlen(change)); + } + } + } #endif /* Keep a copy of command line */