From patchwork Sun Sep 15 03:21:35 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Danomi Manchego X-Patchwork-Id: 274999 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from fraxinus.osuosl.org (fraxinus.osuosl.org [140.211.166.137]) by ozlabs.org (Postfix) with ESMTP id B17342C0107 for ; Sun, 15 Sep 2013 13:29:26 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 7E62D8B1D4; Sun, 15 Sep 2013 03:29:25 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id W-zRiY27XWmb; Sun, 15 Sep 2013 03:29:24 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 56E2A8BE25; Sun, 15 Sep 2013 03:22:29 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 037C91BF9C4 for ; Sun, 15 Sep 2013 03:22:28 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id E3C9A830C8 for ; Sun, 15 Sep 2013 03:22:27 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id hmr598jiIVYo for ; Sun, 15 Sep 2013 03:22:27 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from qmta15.westchester.pa.mail.comcast.net (qmta15.westchester.pa.mail.comcast.net [76.96.59.228]) by whitealder.osuosl.org (Postfix) with ESMTP id 1A67782809 for ; Sun, 15 Sep 2013 03:22:27 +0000 (UTC) Received: from omta09.westchester.pa.mail.comcast.net ([76.96.62.20]) by qmta15.westchester.pa.mail.comcast.net with comcast id RFEi1m0010SCNGk5FFNSRv; Sun, 15 Sep 2013 03:22:26 +0000 Received: from localhost.localdomain ([68.37.48.40]) by omta09.westchester.pa.mail.comcast.net with comcast id RFMd1m00u0s1VyU3VFNSWl; Sun, 15 Sep 2013 03:22:26 +0000 From: Danomi Manchego To: buildroot@busybox.net Date: Sat, 14 Sep 2013 23:21:35 -0400 Message-Id: <1379215295-1805-1-git-send-email-danomimanchego123@gmail.com> X-Mailer: git-send-email 1.7.9.5 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=q20121106; t=1379215346; bh=TFnAPJ3iarqs6EAroA/k6+1CBftt8Mx/kzw1wn62T40=; h=Received:Received:From:To:Subject:Date:Message-Id; b=AKJT6SrN9WkRfGyf+7Xys4K1MPQg1t8DBf+yU220Omt7XlxikbT/moNmjETHZb+hN wuXnovJHIGtSPxwxTLSurk7DXEP7h88xA41fPDGx9wM95zzqVYf0KdfPdBse8Od7DN UmNxjc7uCoSq1q+YIPTFCxNZxPXah+wPPAmuuenV7aJjGXI4rtULUU1EnFhoAStVPR UQNK44YBa9XtaDQbNA5WoQPvHjF9PegawMAQ0+1vi8Gw+JhTK5V4ebnwhvAaOhai4S Xzz1Bq+nQdMJSOvx1+powpYX+6kfujmolcqkdCBf8RHtmLTsMx9j5seZu3yO1J56GP ytdheXRO4Mnqg== Subject: [Buildroot] [PATCH] fs/ubi: add option to use custom volume config file X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: buildroot-bounces@busybox.net 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 --- 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