diff options
author | Ahmad Fatoum <a.fatoum@pengutronix.de> | 2023-06-07 14:07:08 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2023-06-12 14:59:54 +0200 |
commit | 2100ff42b745daeca914c270b150205f18593e1e (patch) | |
tree | 7937024277dd3b5b06a52c906477bd5c80db247f /common/partitions/dos.c | |
parent | 76cb48c89147763ceb634d69141a28c9261254cb (diff) | |
download | barebox-2100ff42b745daeca914c270b150205f18593e1e.tar.gz barebox-2100ff42b745daeca914c270b150205f18593e1e.tar.xz |
common: partitions: record whether disk is GPT or MBR partitioned
Currently, the only way to differentiate between a GPT disk and a MBR
one is to check whether the cdev's device has a guid (=> GPT) or a
nt_signature (=> MBR) device parameter. We already have a flag parameter
though, so let's record this info there for easy retrieval.
We intentionally don't use the struct cdev::filetype member, because
we don't want to change behavior of file_detect_type().
Reviewed-by: Marco Felsch <m.felsch@pengutronix.de>
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20230607120714.3083182-14-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'common/partitions/dos.c')
-rw-r--r-- | common/partitions/dos.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/common/partitions/dos.c b/common/partitions/dos.c index ad60c0b27b..7472824b00 100644 --- a/common/partitions/dos.c +++ b/common/partitions/dos.c @@ -185,6 +185,8 @@ static void dos_partition(void *buf, struct block_device *blk, if (signature) sprintf(blk->cdev.diskuuid, "%08x", signature); + blk->cdev.flags |= DEVFS_IS_MBR_PARTITIONED; + table = (struct partition_entry *)&buffer[446]; for (i = 0; i < 4; i++) { |