From 04291ee0aba6d731bd66bcae5080e126d6c0411b Mon Sep 17 00:00:00 2001 From: Alexander Gendin Date: Mon, 9 Oct 2023 01:24:36 +0000 Subject: cmd: mbr: Allow 4 MBR partitions without need for extended Current code allows up to 3 MBR partitions without extended one. If more than 3 partitions are required, then extended partition(s) must be used. This commit allows up to 4 primary MBR partitions without the need for extended partition. Add mbr test unit. In order to run the test manually, mmc6.img file of size 12 MiB or greater is required in the same directory as u-boot. Test also runs automatically via ./test/py/test.py tool. Running mbr test is only supported in sandbox mode. Signed-off-by: Alex Gendin [ And due to some further changes for testing ] Signed-off-by: Simon Glass --- disk/part_dos.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'disk') diff --git a/disk/part_dos.c b/disk/part_dos.c index 33374384373..567ead7511d 100644 --- a/disk/part_dos.c +++ b/disk/part_dos.c @@ -466,7 +466,7 @@ int layout_mbr_partitions(struct disk_partition *p, int count, ext = &p[i]; } - if (count < 4) + if (count <= 4) return 0; if (!ext) { -- cgit v1.2.3