mirror of
https://github.com/u-boot/u-boot.git
synced 2025-05-09 03:21:51 +00:00
bootstd: Only scan bootable partitions
At present all partitions are scanned, whether marked bootable or not. Use only bootable partitions, defaulting to partition 1 if none is found. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
dcffa4428d
commit
f0e358f07d
4 changed files with 50 additions and 3 deletions
|
@ -163,7 +163,15 @@ int bootdev_find_in_blk(struct udevice *dev, struct udevice *blk,
|
|||
*/
|
||||
iter->max_part = MAX_PART_PER_BOOTDEV;
|
||||
|
||||
if (iter->part) {
|
||||
/* If this is the whole disk, check if we have bootable partitions */
|
||||
if (!iter->part) {
|
||||
iter->first_bootable = part_get_bootable(desc);
|
||||
log_debug("checking bootable=%d\n", iter->first_bootable);
|
||||
|
||||
/* if there are bootable partitions, scan only those */
|
||||
} else if (iter->first_bootable ? !info.bootable : iter->part != 1) {
|
||||
return log_msg_ret("boot", -EINVAL);
|
||||
} else {
|
||||
ret = fs_set_blk_dev_with_part(desc, bflow->part);
|
||||
bflow->state = BOOTFLOWST_PART;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue