From patchwork Thu Mar 7 22:04:40 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yann E. MORIN" X-Patchwork-Id: 225980 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ozlabs.org (Postfix) with ESMTP id 7F2562C037D for ; Fri, 8 Mar 2013 09:06:16 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 5EBC88CBC1; Thu, 7 Mar 2013 22:06:13 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id lxNKUM2j3g8D; Thu, 7 Mar 2013 22:05:56 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id BDCC58CA0E; Thu, 7 Mar 2013 22:05:39 +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 851B68F753 for ; Thu, 7 Mar 2013 22:05:07 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id D62688C34B for ; Thu, 7 Mar 2013 22:04:59 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id omUofG6uzdhD for ; Thu, 7 Mar 2013 22:04:57 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-we0-f169.google.com (mail-we0-f169.google.com [74.125.82.169]) by whitealder.osuosl.org (Postfix) with ESMTPS id DCFD88C341 for ; Thu, 7 Mar 2013 22:04:56 +0000 (UTC) Received: by mail-we0-f169.google.com with SMTP id t11so247586wey.14 for ; Thu, 07 Mar 2013 14:04:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:in-reply-to:references; bh=ndsfZekLIxIV/tAwKHOSvpi5pBzxzpau2RtEdeKQtvU=; b=np+XvPNCeZvMPMwLNSAkpCAykKy9j7EqiHzNIi05iK8GJ4rKJnbRyw932CHBg4SNxJ nzG4rfknqPCmFiF53rxIyFcuVCMJADkmFviBx22Wzm2ChVr6eJdwozMD5kaVNUnKWMhY vXUo0tc3V5NB21izfZ0P36uP715vv6OKzcxfu2J5DlQGbLDP3vP6ybw2J17I+kmLb2ox SGlVMxyA9rpSqImYzeajkvv0hw94pgFppSjGtfXjwubK93jAVr9nQSjonQwDDNBTbv0L 9Zw0zhf6p807VPlzvOJB8jyLU5kdpLsu96tn8HKiQFpAKIu284PtsLZ9JfYL4D803Ykg MRPw== X-Received: by 10.180.81.164 with SMTP id b4mr36634584wiy.34.1362693895114; Thu, 07 Mar 2013 14:04:55 -0800 (PST) Received: from localhost.localdomain (ARennes-555-1-167-217.w2-2.abo.wanadoo.fr. [2.2.22.217]) by mx.google.com with ESMTPS id bj9sm35969125wib.4.2013.03.07.14.04.53 (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 07 Mar 2013 14:04:54 -0800 (PST) From: "Yann E. MORIN" To: buildroot@busybox.net Date: Thu, 7 Mar 2013 23:04:40 +0100 Message-Id: <89f7ec68ff45d56fb1c6e20778032a5a4a1cb004.1362693453.git.yann.morin.1998@free.fr> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: References: In-Reply-To: References: Cc: "Yann E. MORIN" Subject: [Buildroot] [PATCH 3/6] fs: allow image generators to specify file-extension 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 For some filesystems, the generator can output different /versions/ of the filesystem (eg. ext can output ext{2,3,4}). In this case, it can be usefull to have the generated rootfs image with the actual version of the filesystem, rather than the generic name. Add a second parameter to ROOTFS_TARGET, to specify the extension, and default to using the generator name. Thanks to Arnout for the initial idea (my implementation is a bit different than what he suggested): http://lists.busybox.net/pipermail/buildroot/2013-February/067554.html Signed-off-by: "Yann E. MORIN" Cc: Arnout Vandecappelle --- fs/common.mk | 17 +++++++++++++---- 1 files changed, 13 insertions(+), 4 deletions(-) diff --git a/fs/common.mk b/fs/common.mk index 8b5b2f2..9ba9faa 100644 --- a/fs/common.mk +++ b/fs/common.mk @@ -36,13 +36,18 @@ FULL_DEVICE_TABLE = $(BUILD_DIR)/_device_table.txt ROOTFS_DEVICE_TABLES = $(call qstrip,$(BR2_ROOTFS_DEVICE_TABLE)) \ $(call qstrip,$(BR2_ROOTFS_STATIC_DEVICE_TABLE)) +# Internal image generation rules +# Arguments: +# $1: name of the image generator (eg. ext, squashfs, tar...) +# $2: uppercase of $1 +# $3: file-extension of the generated image file define ROOTFS_TARGET_INTERNAL # extra deps ROOTFS_$(2)_DEPENDENCIES += host-fakeroot host-makedevs $$(if $$(BR2_TARGET_ROOTFS_$(2)_LZMA),host-lzma) -$$(BINARIES_DIR)/rootfs.$(1): $$(ROOTFS_$(2)_DEPENDENCIES) - @$$(call MESSAGE,"Generating root filesystem image rootfs.$(1)") +$$(BINARIES_DIR)/rootfs.$(3): $$(ROOTFS_$(2)_DEPENDENCIES) + @$$(call MESSAGE,"Generating root filesystem image rootfs.$(3)") $$(foreach hook,$$(ROOTFS_$(2)_PRE_GEN_HOOKS),$$(call $$(hook))$$(sep)) rm -f $$(FAKEROOT_SCRIPT) rm -f $$(TARGET_DIR_WARNING_FILE) @@ -74,15 +79,19 @@ endif rootfs-$(1)-show-depends: @echo $$(ROOTFS_$(2)_DEPENDENCIES) -rootfs-$(1): $$(BINARIES_DIR)/rootfs.$(1) $$(ROOTFS_$(2)_POST_TARGETS) +rootfs-$(1): $$(BINARIES_DIR)/rootfs.$(3) $$(ROOTFS_$(2)_POST_TARGETS) ifeq ($$(BR2_TARGET_ROOTFS_$(2)),y) TARGETS += rootfs-$(1) endif endef +# Define the way to build a rootfs image (eg. filesystem, tarball...) +# Arguments: +# $1: name of the image generator (eg. ext2, tar...) +# $2: file-extension of the generated image (optional, defaults to $1) define ROOTFS_TARGET -$(call ROOTFS_TARGET_INTERNAL,$(1),$(call UPPERCASE,$(1))) +$(call ROOTFS_TARGET_INTERNAL,$(1),$(call UPPERCASE,$(1)),$(or $(2),$(1))) endef include fs/*/*.mk