mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-23 05:08:24 +00:00
bootm: Fix flags used for bootargs string substitution
Commit 51bb33846a
("bootm: Support string substitution in
bootargs") introduced a feature of bootargs string substitution
and changed a flag used in bootm_process_cmdline_env() call
to be either true or false. With this flag value,
condition in bootm_process_cmdline()
`if (flags & BOOTM_CL_SUBST)` is never true
and process_subst() is never called.
Add a simple test to verify if substitution works OK.
Signed-off-by: Piotr Kubik <piotr.kubik@iopsys.eu>
Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
785834d62e
commit
7481632b19
2 changed files with 13 additions and 1 deletions
|
@ -1103,7 +1103,11 @@ int do_bootm_states(struct cmd_tbl *cmdtp, int flag, int argc,
|
||||||
if (!ret && (states & BOOTM_STATE_OS_BD_T))
|
if (!ret && (states & BOOTM_STATE_OS_BD_T))
|
||||||
ret = boot_fn(BOOTM_STATE_OS_BD_T, argc, argv, images);
|
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)) {
|
||||||
ret = bootm_process_cmdline_env(images->os.os == IH_OS_LINUX);
|
int flags = 0;
|
||||||
|
/* For Linux OS do all substitutions at console processing */
|
||||||
|
if (images->os.os == IH_OS_LINUX)
|
||||||
|
flags = BOOTM_CL_ALL;
|
||||||
|
ret = bootm_process_cmdline_env(flags);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
printf("Cmdline setup failed (err=%d)\n", ret);
|
printf("Cmdline setup failed (err=%d)\n", ret);
|
||||||
ret = CMD_RET_FAILURE;
|
ret = CMD_RET_FAILURE;
|
||||||
|
|
|
@ -339,6 +339,14 @@ def test_fit(u_boot_console):
|
||||||
'U-Boot loaded FDT from offset %#x, FDT is actually at %#x' %
|
'U-Boot loaded FDT from offset %#x, FDT is actually at %#x' %
|
||||||
(fit_offset, real_fit_offset))
|
(fit_offset, real_fit_offset))
|
||||||
|
|
||||||
|
# Check if bootargs strings substitution works
|
||||||
|
output = cons.run_command_list([
|
||||||
|
'env set bootargs \\\"\'my_boot_var=${foo}\'\\\"',
|
||||||
|
'env set foo bar',
|
||||||
|
'bootm prep',
|
||||||
|
'env print bootargs'])
|
||||||
|
assert 'bootargs="my_boot_var=bar"' in output, "Bootargs strings not substituted"
|
||||||
|
|
||||||
# Now a kernel and an FDT
|
# Now a kernel and an FDT
|
||||||
with cons.log.section('Kernel + FDT load'):
|
with cons.log.section('Kernel + FDT load'):
|
||||||
params['fdt_load'] = 'load = <%#x>;' % params['fdt_addr']
|
params['fdt_load'] = 'load = <%#x>;' % params['fdt_addr']
|
||||||
|
|
Loading…
Add table
Reference in a new issue