cmd: pxe: reorder kernel treatment in label_boot
Reorder kernel treatment in label_boot at the beginning of the function. This patch doesn't change the pxe command behavior, it is only a preliminary step for next patch to build bootm_argv[1] before parsing initrd and fdt to build the next bootm arguments. Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Change-Id: If04f25e393f3af8cd75af331ca2f432a7a1b88e8 Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/268489 Reviewed-by: CITOOLS <MDG-smet-aci-reviews@list.st.com> Reviewed-by: CIBUILD <MDG-smet-aci-builds@list.st.com>
This commit is contained in:
@ -466,11 +466,30 @@ static int label_boot(struct cmd_tbl *cmdtp, struct pxe_label *label)
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (get_relfile_envaddr(cmdtp, label->kernel, "kernel_addr_r") < 0) {
|
||||
printf("Skipping %s for failure retrieving kernel\n",
|
||||
label->name);
|
||||
return 1;
|
||||
}
|
||||
bootm_argv[1] = env_get("kernel_addr_r");
|
||||
/* for FIT, append the configuration identifier */
|
||||
if (label->config) {
|
||||
int len = strlen(bootm_argv[1]) + strlen(label->config) + 1;
|
||||
|
||||
fit_addr = malloc(len);
|
||||
if (!fit_addr) {
|
||||
printf("malloc fail (FIT address)\n");
|
||||
return 1;
|
||||
}
|
||||
snprintf(fit_addr, len, "%s%s", bootm_argv[1], label->config);
|
||||
bootm_argv[1] = fit_addr;
|
||||
}
|
||||
|
||||
if (label->initrd) {
|
||||
if (get_relfile_envaddr(cmdtp, label->initrd, "ramdisk_addr_r") < 0) {
|
||||
printf("Skipping %s for failure retrieving initrd\n",
|
||||
label->name);
|
||||
return 1;
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
bootm_argv[2] = initrd_str;
|
||||
@ -480,12 +499,6 @@ static int label_boot(struct cmd_tbl *cmdtp, struct pxe_label *label)
|
||||
bootm_argc = 3;
|
||||
}
|
||||
|
||||
if (get_relfile_envaddr(cmdtp, label->kernel, "kernel_addr_r") < 0) {
|
||||
printf("Skipping %s for failure retrieving kernel\n",
|
||||
label->name);
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (label->ipappend & 0x1) {
|
||||
sprintf(ip_str, " ip=%s:%s:%s:%s",
|
||||
env_get("ipaddr"), env_get("serverip"),
|
||||
@ -513,7 +526,7 @@ static int label_boot(struct cmd_tbl *cmdtp, struct pxe_label *label)
|
||||
strlen(label->append ?: ""),
|
||||
strlen(ip_str), strlen(mac_str),
|
||||
sizeof(bootargs));
|
||||
return 1;
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (label->append)
|
||||
@ -528,20 +541,6 @@ static int label_boot(struct cmd_tbl *cmdtp, struct pxe_label *label)
|
||||
printf("append: %s\n", finalbootargs);
|
||||
}
|
||||
|
||||
bootm_argv[1] = env_get("kernel_addr_r");
|
||||
/* for FIT, append the configuration identifier */
|
||||
if (label->config) {
|
||||
int len = strlen(bootm_argv[1]) + strlen(label->config) + 1;
|
||||
|
||||
fit_addr = malloc(len);
|
||||
if (!fit_addr) {
|
||||
printf("malloc fail (FIT address)\n");
|
||||
return 1;
|
||||
}
|
||||
snprintf(fit_addr, len, "%s%s", bootm_argv[1], label->config);
|
||||
bootm_argv[1] = fit_addr;
|
||||
}
|
||||
|
||||
/*
|
||||
* fdt usage is optional:
|
||||
* It handles the following scenarios.
|
||||
|
||||
Reference in New Issue
Block a user