X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=common%2Fbootm.c;h=e34617a145ccbe1526e55b0b998416c25d734cff;hb=018f530323b2cc41be05be5b12375d3648f06554;hp=2431019b3f407d8eff683fa1cd8c5ce46a468cc4;hpb=1e031249a53e38d9b8290fa99106477c231bf2dd;p=people%2Fms%2Fu-boot.git diff --git a/common/bootm.c b/common/bootm.c index 2431019b3f..e34617a145 100644 --- a/common/bootm.c +++ b/common/bootm.c @@ -41,6 +41,8 @@ DECLARE_GLOBAL_DATA_PTR; +bootm_headers_t images; /* pointers to os/initrd/fdt images */ + static const void *boot_get_kernel(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[], bootm_headers_t *images, ulong *os_data, ulong *os_len); @@ -567,7 +569,7 @@ static void fixup_silent_linux(void) env_val = CONSOLE_ARG; } - setenv("bootargs", env_val); + env_set("bootargs", env_val); debug("after silent fix-up: %s\n", env_val); free(buf); } @@ -617,10 +619,8 @@ int do_bootm_states(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[], if (!ret && (states & BOOTM_STATE_FINDOS)) ret = bootm_find_os(cmdtp, flag, argc, argv); - if (!ret && (states & BOOTM_STATE_FINDOTHER)) { + if (!ret && (states & BOOTM_STATE_FINDOTHER)) ret = bootm_find_other(cmdtp, flag, argc, argv); - argc = 0; /* consume the args */ - } /* Load the OS */ if (!ret && (states & BOOTM_STATE_LOADOS)) { @@ -635,10 +635,6 @@ int do_bootm_states(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[], goto err; else if (ret == BOOTM_ERR_OVERLAP) ret = 0; -#if defined(CONFIG_SILENT_CONSOLE) && !defined(CONFIG_SILENT_U_BOOT_ONLY) - if (images->os.os == IH_OS_LINUX) - fixup_silent_linux(); -#endif } /* Relocate the ramdisk */ @@ -649,8 +645,8 @@ int do_bootm_states(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[], ret = boot_ramdisk_high(&images->lmb, images->rd_start, rd_len, &images->initrd_start, &images->initrd_end); if (!ret) { - setenv_hex("initrd_start", images->initrd_start); - setenv_hex("initrd_end", images->initrd_end); + env_set_hex("initrd_start", images->initrd_start); + env_set_hex("initrd_end", images->initrd_end); } } #endif @@ -678,13 +674,19 @@ int do_bootm_states(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[], return 1; } + /* Call various other states that are not generally used */ if (!ret && (states & BOOTM_STATE_OS_CMDLINE)) ret = boot_fn(BOOTM_STATE_OS_CMDLINE, argc, argv, images); if (!ret && (states & BOOTM_STATE_OS_BD_T)) ret = boot_fn(BOOTM_STATE_OS_BD_T, argc, argv, images); - if (!ret && (states & BOOTM_STATE_OS_PREP)) + if (!ret && (states & BOOTM_STATE_OS_PREP)) { +#if defined(CONFIG_SILENT_CONSOLE) && !defined(CONFIG_SILENT_U_BOOT_ONLY) + if (images->os.os == IH_OS_LINUX) + fixup_silent_linux(); +#endif ret = boot_fn(BOOTM_STATE_OS_PREP, argc, argv, images); + } #ifdef CONFIG_TRACE /* Pretend to run the OS, then run a user command */