Skip to contentSkip to conversation

mtd: ubi: block: add option to enable scanning for partitions

PATCH Superseded Daniel Golle 2 participants 2 messages Nov 8, 2022 – Nov 10, 2022

Subsystems (4)

v4 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

PATCH v4 5/5 mtd: ubi: block: add option to enable scanning for partitions

Add Kconfig option CONFIG_MTD_UBI_BLOCK_PARTITIONS and enable block partition parsers on ubiblock devices in case it is selected.

---
 drivers/mtd/ubi/Kconfig | 10 ++++++++++
 drivers/mtd/ubi/block.c |  5 ++++-
 2 files changed, 14 insertions(+), 1 deletion(-)
drivers/mtd/ubi/Kconfig +10 -0
index 2ed77b7b3fcb..491330e42ab2 100644
@@ -104,4 +104,14 @@ config MTD_UBI_BLOCK
 
 	   If in doubt, say "N".
 
+config MTD_UBI_BLOCK_PARTITIONS
+	bool "Scan UBI block devices for partitions"
+	default y if FIT_PARTITION
+	depends on MTD_UBI_BLOCK
+	help
+	  Scan UBI block devices for partitions (ie. MBR, GPT, uImage.FIT, ...).
+
+	  Unless your UBI volumes contain sub-partitions mapped using a partition
+	  table, say no.
+
 endif # MTD_UBI
drivers/mtd/ubi/block.c +4 -1
index 75eaecc8639f..d9baa99ca093 100644
@@ -430,7 +430,10 @@ int ubiblock_create(struct ubi_volume_info *vi)
 		ret = -ENODEV;
 		goto out_cleanup_disk;
 	}
-	gd->flags |= GENHD_FL_NO_PART;
+
+	if (!IS_ENABLED(CONFIG_MTD_UBI_BLOCK_PARTITIONS))
+		gd->flags |= GENHD_FL_NO_PART;
+
 	gd->private_data = dev;
 	sprintf(gd->disk_name, "ubiblock%d_%d", dev->ubi_num, dev->vol_id);
 	set_capacity(gd, disk_capacity);
Signature · 1 line
2.38.1
#1 lore raw

Daniel,

----- Ursprüngliche Mail -----

Quoted 4 lines

Von: "Daniel Golle" <[email protected]>

Add Kconfig option CONFIG_MTD_UBI_BLOCK_PARTITIONS and enable block partition parsers on ubiblock devices in case it is selected.

I think we should stick with one Kconfig at most.
Not both CONFIG_MTD_UBI_BLOCK_PARTITIONS and CONFIG_MTD_BLOCK_PARTITION.

Thanks,
//richard