Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] fs/ubi: add option to use custom volume config file
@ 2013-09-15  3:21 Danomi Manchego
  2013-09-15  4:38 ` Baruch Siach
  2013-09-15 18:00 ` Thomas Petazzoni
  0 siblings, 2 replies; 13+ messages in thread
From: Danomi Manchego @ 2013-09-15  3:21 UTC (permalink / raw)
  To: buildroot

By default, the UBI FS target creates a ubinize configuration
file on-the-fly, for a single volume.  Add an option to specify
a custom config file.

E.g., one might want to deploy a system with a volume for the
built ubifs image, a volume for a future upgrade image, and a
volume for user data.

Signed-off-by: Danomi Manchego <danomimanchego123@gmail.com>
---
 fs/ubifs/Config.in |   12 ++++++++++++
 fs/ubifs/ubi.mk    |   12 +++++++++---
 2 files changed, 21 insertions(+), 3 deletions(-)

diff --git a/fs/ubifs/Config.in b/fs/ubifs/Config.in
index 70ea81e..32ca730 100644
--- a/fs/ubifs/Config.in
+++ b/fs/ubifs/Config.in
@@ -119,6 +119,18 @@ config BR2_TARGET_ROOTFS_UBI_SUBSIZE
 	  The value provided here is passed to the -s/--sub-page-size
 	  option of ubinize.
 
+config BR2_TARGET_ROOTFS_UBI_USE_CUSTOM_CONFIG
+	bool "Use custom config file"
+	help
+	  Select to use a custom volume configuration file.  Otherwise,
+	  a configuration file will be generated automatically.
+
+config BR2_TARGET_ROOTFS_UBI_CUSTOM_CONFIG_FILE
+	string "Configuration file path"
+	depends on BR2_TARGET_ROOTFS_UBI_USE_CUSTOM_CONFIG
+	help
+	  Path to the volume configuration file
+
 config BR2_TARGET_ROOTFS_UBI_OPTS
 	string "Additional ubinize options"
 	help
diff --git a/fs/ubifs/ubi.mk b/fs/ubifs/ubi.mk
index 08c952c..1304bd5 100644
--- a/fs/ubifs/ubi.mk
+++ b/fs/ubifs/ubi.mk
@@ -14,10 +14,16 @@ UBI_UBINIZE_OPTS += $(call qstrip,$(BR2_TARGET_ROOTFS_UBI_OPTS))
 
 ROOTFS_UBI_DEPENDENCIES = rootfs-ubifs
 
+ifeq ($(BR2_TARGET_ROOTFS_UBI_USE_CUSTOM_CONFIG),y)
+UBI_UBINIZE_PREP_CFG = \
+	cp $(BR2_TARGET_ROOTFS_UBI_CUSTOM_CONFIG_FILE) ./ubinize.cfg
+else
+UBI_UBINIZE_PREP_CFG = \
+	cp fs/ubifs/ubinize.cfg . ; echo "image=$@fs" >> ./ubinize.cfg
+endif
+
 define ROOTFS_UBI_CMD
-	cp fs/ubifs/ubinize.cfg . ;\
-	echo "image=$@fs" \
-		>> ./ubinize.cfg ;\
+	$(UBI_UBINIZE_PREP_CFG) ; \
 	$(HOST_DIR)/usr/sbin/ubinize -o $@ $(UBI_UBINIZE_OPTS) ubinize.cfg ;\
 	rm ubinize.cfg
 endef
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2014-01-28 18:22 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-15  3:21 [Buildroot] [PATCH] fs/ubi: add option to use custom volume config file Danomi Manchego
2013-09-15  4:38 ` Baruch Siach
2013-09-15 13:06   ` Danomi Manchego
2013-09-15 18:00 ` Thomas Petazzoni
2013-09-15 18:37   ` Danomi Manchego
2013-09-15 18:53     ` Thomas Petazzoni
2013-09-15 19:08       ` Danomi Manchego
2013-09-15 19:16         ` Thomas Petazzoni
2014-01-27 23:17           ` Ezequiel García
2014-01-27 23:57             ` Danomi Manchego
2014-01-28 16:35             ` Thomas Petazzoni
2014-01-28 16:59               ` Ezequiel García
2014-01-28 18:22             ` Yann E. MORIN

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox