Skip to content
Snippets Groups Projects
Commit 59d03cb3 authored by Sjoerd Simons's avatar Sjoerd Simons Committed by Tom Rini
Browse files

config_distro_bootcmd.h: Use a private variable for bootpart


Hush has an oddity where using ${var} causes var to resolved in the the global
address space (iotw the environment) first and only afterwards will the local
variable space be searched.

This causes odd side-effects when iterating over the boot partitions
using ${bootpart} if the environment also has a bootpart variable (e.g. for
the various TI boards). Fix this by using the hopefully more unique
${distro_bootpart} instead of ${bootpart}.

Signed-off-by: default avatarSjoerd Simons <sjoerd.simons@collabora.co.uk>
Acked-by: default avatarStephen Warren <swarren@wwwdotorg.org>
parent 2da87ab3
No related branches found
No related tags found
No related merge requests found
...@@ -191,11 +191,12 @@ ...@@ -191,11 +191,12 @@
BOOTENV_BOOT_TARGETS \ BOOTENV_BOOT_TARGETS \
\ \
"boot_extlinux=" \ "boot_extlinux=" \
"sysboot ${devtype} ${devnum}:${bootpart} any " \ "sysboot ${devtype} ${devnum}:${distro_bootpart} any " \
"${scriptaddr} ${prefix}extlinux/extlinux.conf\0" \ "${scriptaddr} ${prefix}extlinux/extlinux.conf\0" \
\ \
"scan_dev_for_extlinux=" \ "scan_dev_for_extlinux=" \
"if test -e ${devtype} ${devnum}:${bootpart} " \ "if test -e ${devtype} " \
"${devnum}:${distro_bootpart} " \
"${prefix}extlinux/extlinux.conf; then " \ "${prefix}extlinux/extlinux.conf; then " \
"echo Found ${prefix}extlinux/extlinux.conf; " \ "echo Found ${prefix}extlinux/extlinux.conf; " \
"run boot_extlinux; " \ "run boot_extlinux; " \
...@@ -203,13 +204,14 @@ ...@@ -203,13 +204,14 @@
"fi\0" \ "fi\0" \
\ \
"boot_a_script=" \ "boot_a_script=" \
"load ${devtype} ${devnum}:${bootpart} " \ "load ${devtype} ${devnum}:${distro_bootpart} " \
"${scriptaddr} ${prefix}${script}; " \ "${scriptaddr} ${prefix}${script}; " \
"source ${scriptaddr}\0" \ "source ${scriptaddr}\0" \
\ \
"scan_dev_for_scripts=" \ "scan_dev_for_scripts=" \
"for script in ${boot_scripts}; do " \ "for script in ${boot_scripts}; do " \
"if test -e ${devtype} ${devnum}:${bootpart} " \ "if test -e ${devtype} " \
"${devnum}:${distro_bootpart} " \
"${prefix}${script}; then " \ "${prefix}${script}; then " \
"echo Found U-Boot script " \ "echo Found U-Boot script " \
"${prefix}${script}; " \ "${prefix}${script}; " \
...@@ -219,7 +221,8 @@ ...@@ -219,7 +221,8 @@
"done\0" \ "done\0" \
\ \
"scan_dev_for_boot=" \ "scan_dev_for_boot=" \
"echo Scanning ${devtype} ${devnum}:${bootpart}...; " \ "echo Scanning ${devtype} " \
"${devnum}:${distro_bootpart}...; " \
"for prefix in ${boot_prefixes}; do " \ "for prefix in ${boot_prefixes}; do " \
"run scan_dev_for_extlinux; " \ "run scan_dev_for_extlinux; " \
"run scan_dev_for_scripts; " \ "run scan_dev_for_scripts; " \
...@@ -228,8 +231,9 @@ ...@@ -228,8 +231,9 @@
"scan_dev_for_boot_part=" \ "scan_dev_for_boot_part=" \
"part list ${devtype} ${devnum} -bootable devplist; " \ "part list ${devtype} ${devnum} -bootable devplist; " \
"env exists devplist || setenv devplist 1; " \ "env exists devplist || setenv devplist 1; " \
"for bootpart in ${devplist}; do " \ "for distro_bootpart in ${devplist}; do " \
"if fstype ${devtype} ${devnum}:${bootpart} " \ "if fstype ${devtype} " \
"${devnum}:${distro_bootpart} " \
"bootfstype; then " \ "bootfstype; then " \
"run scan_dev_for_boot; " \ "run scan_dev_for_boot; " \
"fi; " \ "fi; " \
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment