diff options
author | Simon Glass <sjg@chromium.org> | 2023-01-17 10:47:41 -0700 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2023-01-23 18:11:40 -0500 |
commit | dcffa4428d0359fd09348fc05cf5b5ce2db38c5f (patch) | |
tree | 4768322f3c36e6a8537b5df083ab68b44b2fd071 /test/boot/bootflow.c | |
parent | 4146c823fc27c1a4e06d1d25e0a2d4644948a5fc (diff) |
part: Add a function to find the first bootable partition
If a disk has a bootable partition we are expected to use it to locate the
boot files. Add a function to find it.
To test this, update mmc1 to have two paritions, fixing up other tests
accordingly.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'test/boot/bootflow.c')
-rw-r--r-- | test/boot/bootflow.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/test/boot/bootflow.c b/test/boot/bootflow.c index 12976005e4..38ffe8fa9b 100644 --- a/test/boot/bootflow.c +++ b/test/boot/bootflow.c @@ -315,15 +315,15 @@ static int bootflow_iter(struct unit_test_state *uts) ut_asserteq(BOOTFLOWST_FS, bflow.state); bootflow_free(&bflow); - /* Then more to partition 2 which doesn't exist */ - ut_asserteq(-ENOENT, bootflow_scan_next(&iter, &bflow)); + /* Then more to partition 2 which exists but is not bootable */ + ut_asserteq(-EPERM, bootflow_scan_next(&iter, &bflow)); ut_asserteq(2, iter.num_methods); ut_asserteq(0, iter.cur_method); ut_asserteq(2, iter.part); ut_asserteq(0x1e, iter.max_part); ut_asserteq_str("syslinux", iter.method->name); ut_asserteq(0, bflow.err); - ut_asserteq(BOOTFLOWST_MEDIA, bflow.state); + ut_asserteq(BOOTFLOWST_PART, bflow.state); bootflow_free(&bflow); bootflow_iter_uninit(&iter); |