Files
u-boot/board/toradex/smarc-imx8mp/smarc-imx8mp.env
Franz Schnyder 92a04aea6d board: toradex: Quote variables in test cmd expression
With correct POSIX handling, unquoted empty variables can turn the
expression like
	test -n ${fdtfile}
into
	test -n

The POSIX handling for single argument `test` evaluates it as true,
so the fallback initialization will be skipped unexpectedly.
Quoting variable expansions in `test` expressions will always result in
correct behavior for empty and non-empty values.
This change was triggered by
commit 8b0619579b ("cmd: test: fix handling of single-argument form of test")
The aim is to have a less fragile codebase that is not dependent on a
quirk of the shell implementation.

Use quoted variable expansions in `test` expressions throughout.

Signed-off-by: Franz Schnyder <franz.schnyder@toradex.com>
Acked-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2026-05-04 11:07:43 -06:00

21 lines
531 B
Bash

boot_script_dhcp=boot.scr
boot_targets=mmc1 mmc0 dhcp
console=ttymxc1
fdt_addr_r=0x50200000
fdt_board=dev
initrd_addr=0x43800000
initrd_high=0xffffffffffffffff
kernel_addr_r=CONFIG_SYS_LOAD_ADDR
kernel_comp_addr_r=0x40200000
kernel_comp_size=0x08000000
ramdisk_addr_r=0x50300000
scriptaddr=0x50280000
update_uboot=
askenv confirm Did you load flash.bin (y/N)?;
if test "$confirm" = y; then
setexpr blkcnt ${filesize} + 0x1ff && setexpr blkcnt
${blkcnt} / 0x200; mmc dev 0 1; mmc write ${loadaddr} 0x0
${blkcnt};
fi