Commit 735b1cfeb2308d9114af1140b703be91b604c09e

Authored by Sjoerd Simons
Committed by Tom Rini
1 parent e86df6ef4f

config_distro_bootcmd: Scan all partitions for boot files

Not all devices use the convention that the boot scripts are on the
first partition. For example on chromebooks it seems common for the
first two partitions to be ChromeOS kernel partitions.

So instead of just the first partition scan all partitions on a device
with a filesystem u-boot can recognize.

Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>

Showing 1 changed file with 11 additions and 3 deletions Side-by-side Diff

include/config_distro_bootcmd.h
... ... @@ -13,7 +13,7 @@
13 13 #define BOOTENV_SHARED_BLKDEV_BODY(devtypel) \
14 14 "if " #devtypel " dev ${devnum}; then " \
15 15 "setenv devtype " #devtypel "; " \
16   - "run scan_dev_for_boot; " \
  16 + "run scan_dev_for_boot_part; " \
17 17 "fi\0"
18 18  
19 19 #define BOOTENV_SHARED_BLKDEV(devtypel) \
... ... @@ -155,7 +155,6 @@
155 155 "boot_prefixes=/ /boot/\0" \
156 156 "boot_scripts=boot.scr.uimg boot.scr\0" \
157 157 BOOTENV_BOOT_TARGETS \
158   - "bootpart=1\0" \
159 158 \
160 159 "boot_extlinux=" \
161 160 "sysboot ${devtype} ${devnum}:${bootpart} any " \
162 161  
... ... @@ -186,10 +185,19 @@
186 185 "done\0" \
187 186 \
188 187 "scan_dev_for_boot=" \
189   - "echo Scanning ${devtype} ${devnum}...; " \
  188 + "echo Scanning ${devtype} ${devnum}:${bootpart}...; " \
190 189 "for prefix in ${boot_prefixes}; do " \
191 190 "run scan_dev_for_extlinux; " \
192 191 "run scan_dev_for_scripts; " \
  192 + "done\0" \
  193 + \
  194 + "scan_dev_for_boot_part=" \
  195 + "part list ${devtype} ${devnum} devplist; " \
  196 + "for bootpart in ${devplist}; do " \
  197 + "if fstype ${devtype} ${devnum}:${bootpart} " \
  198 + "bootfstype; then " \
  199 + "run scan_dev_for_boot; " \
  200 + "fi; " \
193 201 "done\0" \
194 202 \
195 203 BOOT_TARGET_DEVICES(BOOTENV_DEV) \