summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2022-01-25 11:33:19 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2022-01-25 11:41:12 +0100
commit84ea37e4580cabc2a49edc4e2c62b45a752771fc (patch)
tree21017f31f5325e13cd962a2687ceb597bc1ffe32
parent38dd0a5579e15bee6d890d3a232da29574a49083 (diff)
downloadbarebox-84ea37e4580cabc2a49edc4e2c62b45a752771fc.tar.gz
barebox-84ea37e4580cabc2a49edc4e2c62b45a752771fc.tar.xz
dos-partitions: Fix extended partitions
extended partitions are currently registered with their full size which means they overlap with the logical partitions therein. Since 7f9f45b9bf ("devfs: Do not create overlapping partitions") we no longer register overlapping partitions, so the logical partitions are no longer accessible. Fix this by reducing the size of the extended partition to two blocks (1kiB) which is the same as Linux does. Fixes: 7f9f45b9bf ("devfs: Do not create overlapping partitions") Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Reported-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
-rw-r--r--common/partitions/dos.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/common/partitions/dos.c b/common/partitions/dos.c
index 6c76aac371..597d7bf9bc 100644
--- a/common/partitions/dos.c
+++ b/common/partitions/dos.c
@@ -200,6 +200,8 @@ static void dos_partition(void *buf, struct block_device *blk,
pd->used_entries++;
if (is_extended_partition(&pentry)) {
+ pd->parts[n].size = 2;
+
if (!extended_partition)
extended_partition = &pd->parts[n];
else