disk: part_rkparm: add initrd fixup for cmdline
remove unused "initrd=0x...,0x...", this for compatible with legacy parameter.txt. Change-Id: I7d9c5708a6b183479ac5980a90067cff8f0872de Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
This commit is contained in:
parent
bf98386f4f
commit
8fb96674f6
|
|
@ -40,6 +40,8 @@ static int rkparm_param_parse(char *param, struct list_head *parts_head,
|
||||||
char *pend;
|
char *pend;
|
||||||
int len, offset = 0;
|
int len, offset = 0;
|
||||||
unsigned long size, start;
|
unsigned long size, start;
|
||||||
|
char *initrd;
|
||||||
|
const char *str;
|
||||||
|
|
||||||
if (!cmdline) {
|
if (!cmdline) {
|
||||||
printf("invalid parameter\n");
|
printf("invalid parameter\n");
|
||||||
|
|
@ -47,6 +49,20 @@ static int rkparm_param_parse(char *param, struct list_head *parts_head,
|
||||||
}
|
}
|
||||||
|
|
||||||
*cmdline_end = '\0';
|
*cmdline_end = '\0';
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Initrd fixup: remove unused "initrd=0x...,0x...", this for
|
||||||
|
* compatible with legacy parameter.txt
|
||||||
|
*/
|
||||||
|
initrd = strstr(cmdline, "initrd=");
|
||||||
|
if (initrd) {
|
||||||
|
str = strstr(initrd, " ");
|
||||||
|
/* Terminate, so cmdline can be dest for strcat() */
|
||||||
|
*initrd = '\0';
|
||||||
|
/* +1 to skip current white space */
|
||||||
|
strcat((char *)cmdline, (str + 1));
|
||||||
|
}
|
||||||
|
|
||||||
/* skip "CMDLINE:" */
|
/* skip "CMDLINE:" */
|
||||||
env_update("bootargs", cmdline + strlen("CMDLINE:"));
|
env_update("bootargs", cmdline + strlen("CMDLINE:"));
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue