All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 34/44] jffs2: convert to ROOTFS_TARGET infrastructure
Date: Fri,  9 Apr 2010 11:07:12 +0200	[thread overview]
Message-ID: <bd36a7273a6fa2d21589a1ab6e99bb231e0e868e.1270803901.git.thomas.petazzoni@free-electrons.com> (raw)
In-Reply-To: <cover.1270803901.git.thomas.petazzoni@free-electrons.com>

We also remove the BR2_TARGET_ROOTFS_JFFS2_OUTPUT option, that could
be used to specify an alternate name for the generated image file.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 target/jffs2/Config.in    |    4 ---
 target/jffs2/jffs2root.mk |   57 ++++++++++++--------------------------------
 2 files changed, 16 insertions(+), 45 deletions(-)

diff --git a/target/jffs2/Config.in b/target/jffs2/Config.in
index a216a27..b787ec9 100644
--- a/target/jffs2/Config.in
+++ b/target/jffs2/Config.in
@@ -114,8 +114,4 @@ config BR2_TARGET_ROOTFS_JFFS2_SUMMARY
 	  A summarised image can be mounted faster if support is
 	  enabled in the kernel (CONFIG_JFFS2_SUMMARY)
 
-config BR2_TARGET_ROOTFS_JFFS2_OUTPUT
-	string "Output File"
-	default "$(IMAGE).jffs2"
-
 endif
diff --git a/target/jffs2/jffs2root.mk b/target/jffs2/jffs2root.mk
index eea0e3a..a0a563d 100644
--- a/target/jffs2/jffs2root.mk
+++ b/target/jffs2/jffs2root.mk
@@ -32,55 +32,30 @@ JFFS2_OPTS += -n
 SUMTOOL_OPTS += -n
 endif
 
-JFFS2_TARGET := $(call qstrip,$(BR2_TARGET_ROOTFS_JFFS2_OUTPUT))
 ifneq ($(TARGET_DEVICE_TABLE),)
 JFFS2_OPTS += -D $(TARGET_DEVICE_TABLE)
 endif
 
+ROOTFS_JFFS2_DEPENDENCIES = host-mtd
 
-#
-# mtd-host is a dependency which builds a local copy of mkfs.jffs2 if it is needed.
-# the actual build is done from package/mtd/mtd.mk and it sets the
-# value of MKFS_JFFS2 to either the previously installed copy or the one
-# just built.
-#
-$(JFFS2_TARGET): host-fakeroot host-mtd makedevs
-	# Use fakeroot to pretend all target binaries are owned by root
-	rm -f $(BUILD_DIR)/_fakeroot.$(notdir $(JFFS2_TARGET))
-	touch $(BUILD_DIR)/.fakeroot.00000
-	cat $(BUILD_DIR)/.fakeroot* > $(BUILD_DIR)/_fakeroot.$(notdir $(JFFS2_TARGET))
-	echo "chown -R 0:0 $(TARGET_DIR)" >> $(BUILD_DIR)/_fakeroot.$(notdir $(JFFS2_TARGET))
-ifneq ($(TARGET_DEVICE_TABLE),)
-	# Use fakeroot to pretend to create all needed device nodes
-	echo "$(HOST_DIR)/usr/bin/makedevs -d $(TARGET_DEVICE_TABLE) $(TARGET_DIR)" \
-		>> $(BUILD_DIR)/_fakeroot.$(notdir $(JFFS2_TARGET))
-endif
-	# Use fakeroot so mkfs.jffs2 believes the previous fakery
 ifneq ($(BR2_TARGET_ROOTFS_JFFS2_SUMMARY),)
-	echo "$(MKFS_JFFS2) $(JFFS2_OPTS) -d $(TARGET_DIR) -o $(JFFS2_TARGET).nosummary && " \
-		"$(SUMTOOL) $(SUMTOOL_OPTS) -i $(JFFS2_TARGET).nosummary -o $(JFFS2_TARGET) && " \
-		"rm $(JFFS2_TARGET).nosummary" \
-		>> $(BUILD_DIR)/_fakeroot.$(notdir $(JFFS2_TARGET))
+define ROOTFS_JFFS2_CMD
+	$(MKFS_JFFS2) $(JFFS2_OPTS) -d $(TARGET_DIR) -o $$@.nosummary && \
+	$(SUMTOOL) $(SUMTOOL_OPTS) -i $$@.nosummary -o $$@ && \
+	rm $$@.nosummary
+endef
 else
-	echo "$(MKFS_JFFS2) $(JFFS2_OPTS) -d $(TARGET_DIR) -o $(JFFS2_TARGET)" \
-		>> $(BUILD_DIR)/_fakeroot.$(notdir $(JFFS2_TARGET))
-endif
-	chmod a+x $(BUILD_DIR)/_fakeroot.$(notdir $(JFFS2_TARGET))
-	$(HOST_DIR)/usr/bin/fakeroot -- $(BUILD_DIR)/_fakeroot.$(notdir $(JFFS2_TARGET))
-	- at rm -f $(BUILD_DIR)/_fakeroot.$(notdir $(JFFS2_TARGET))
-	@ls -l $(JFFS2_TARGET)
-ifeq ($(BR2_JFFS2_TARGET_SREC),y)
-	$(TARGET_CROSS)objcopy -I binary -O srec --adjust-vma 0xa1000000 $(JFFS2_TARGET) $(JFFS2_TARGET).srec
-	@ls -l $(JFFS2_TARGET).srec
+define ROOTFS_JFFS2_CMD
+	$(MKFS_JFFS2) $(JFFS2_OPTS) -d $(TARGET_DIR) -o $$@
+endef
 endif
 
-jffs2root: $(JFFS2_TARGET)
+define JFFS2_GEN_SREC
+	$(TARGET_CROSS)objcopy -I binary -O srec --adjust-vma 0xa1000000 $$@ $$@.srec
+endef
 
-#############################################################
-#
-# Toplevel Makefile options
-#
-#############################################################
-ifeq ($(BR2_TARGET_ROOTFS_JFFS2),y)
-TARGETS+=jffs2root
+ifeq ($(BR2_JFFS2_TARGET_SREC),y)
+ROOTFS_JFFS2_POST_GEN_HOOKS += JFFS2_GEN_SREC
 endif
+
+$(eval $(call ROOTFS_TARGET,jffs2))
\ No newline at end of file
-- 
1.6.3.3

  parent reply	other threads:[~2010-04-09  9:07 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-09  9:06 [Buildroot] [pull request] Pull request for branch fs-cleanup Thomas Petazzoni
2010-04-09  9:06 ` [Buildroot] [PATCH 01/44] genromfs: add new package Thomas Petazzoni
2010-04-09  9:06 ` [Buildroot] [PATCH 02/44] genext2fs: " Thomas Petazzoni
2010-04-09  9:06 ` [Buildroot] [PATCH 03/44] cramfs: " Thomas Petazzoni
2010-04-09  9:06 ` [Buildroot] [PATCH 04/44] squashfs: " Thomas Petazzoni
2010-04-09  9:06 ` [Buildroot] [PATCH 05/44] libcap: " Thomas Petazzoni
2010-04-09  9:06 ` [Buildroot] [PATCH 06/44] bzip2: convert to gentargets, add host package, bump version Thomas Petazzoni
2010-04-09  9:06 ` [Buildroot] [PATCH 07/44] cmake: new package Thomas Petazzoni
2010-04-09  9:06 ` [Buildroot] [PATCH 08/44] cdrkit: " Thomas Petazzoni
2010-04-09  9:06 ` [Buildroot] [PATCH 09/44] e2fsprogs: add support for host package Thomas Petazzoni
2010-04-09  9:06 ` [Buildroot] [PATCH 10/44] mtd: convert to gentargets, add " Thomas Petazzoni
2010-04-09  9:06 ` [Buildroot] [PATCH 11/44] cloop: new package Thomas Petazzoni
2010-04-09  9:06 ` [Buildroot] [PATCH 12/44] lzma: convert the host package to the autotools infrastructure Thomas Petazzoni
2010-04-09  9:06 ` [Buildroot] [PATCH 13/44] target/cloop: cleanup Thomas Petazzoni
2010-04-09  9:06 ` [Buildroot] [PATCH 14/44] target/cpio: cleanup Thomas Petazzoni
2010-04-09  9:06 ` [Buildroot] [PATCH 15/44] target/cramfs: cleanup Thomas Petazzoni
2010-04-09  9:06 ` [Buildroot] [PATCH 16/44] target/ext2: cleanup Thomas Petazzoni
2010-04-09  9:06 ` [Buildroot] [PATCH 17/44] target/iso9660: cleanup Thomas Petazzoni
2010-04-09  9:06 ` [Buildroot] [PATCH 18/44] target/jffs2: cleanup Thomas Petazzoni
2010-04-09  9:06 ` [Buildroot] [PATCH 19/44] target/romfs: cleanup Thomas Petazzoni
2010-04-09  9:06 ` [Buildroot] [PATCH 20/44] target/squashfs: cleanup, remove support for 3.x Thomas Petazzoni
2010-04-09  9:06 ` [Buildroot] [PATCH 21/44] target/tar: cleanup Thomas Petazzoni
2010-04-09  9:07 ` [Buildroot] [PATCH 22/44] target/ubifs: cleanup, unbroken Thomas Petazzoni
2010-04-09  9:07 ` [Buildroot] [PATCH 23/44] fakeroot: convert to the autotools infrastructure Thomas Petazzoni
2010-04-09  9:07 ` [Buildroot] [PATCH 24/44] fakeroot: remove all references to BR2_HOST_FAKEROOT Thomas Petazzoni
2010-04-09  9:07 ` [Buildroot] [PATCH 25/44] target/: remove the COPYTO mess Thomas Petazzoni
2010-04-09  9:07 ` [Buildroot] [PATCH 26/44] target: Add new infrastructure for filesystem generation Thomas Petazzoni
2010-04-09  9:07 ` [Buildroot] [PATCH 27/44] cloop: convert to ROOTFS_TARGET infrastructure Thomas Petazzoni
2010-04-09  9:07 ` [Buildroot] [PATCH 28/44] cpio: " Thomas Petazzoni
2010-04-09  9:07 ` [Buildroot] [PATCH 29/44] cramfs: " Thomas Petazzoni
2010-04-09  9:07 ` [Buildroot] [PATCH 30/44] romfs: " Thomas Petazzoni
2010-04-09  9:07 ` [Buildroot] [PATCH 31/44] tar: " Thomas Petazzoni
2010-04-09  9:07 ` [Buildroot] [PATCH 32/44] squashfs: " Thomas Petazzoni
2010-04-09  9:07 ` [Buildroot] [PATCH 33/44] ext2: " Thomas Petazzoni
2010-04-09  9:07 ` Thomas Petazzoni [this message]
2010-04-09  9:07 ` [Buildroot] [PATCH 35/44] ubifs: " Thomas Petazzoni
2010-04-09  9:07 ` [Buildroot] [PATCH 36/44] initramfs: " Thomas Petazzoni
2010-04-09  9:07 ` [Buildroot] [PATCH 37/44] busybox initramfs: do not use the IMAGE variable Thomas Petazzoni
2010-04-09  9:07 ` [Buildroot] [PATCH 38/44] target/common: do not use IMAGE Thomas Petazzoni
2010-04-09  9:07 ` [Buildroot] [PATCH 39/44] iso9660: rework in a similar way to ROOTFS_TARGET Thomas Petazzoni
2010-04-09  9:07 ` [Buildroot] [PATCH 40/44] Remove IMAGE and related configuration options Thomas Petazzoni
2010-04-09  9:07 ` [Buildroot] [PATCH 41/44] Move all filesystem generation code to fs/ Thomas Petazzoni
2010-04-09  9:07 ` [Buildroot] [PATCH 42/44] Coherent naming for .mk files in fs/ Thomas Petazzoni
2010-04-09  9:07 ` [Buildroot] [PATCH 43/44] Update defconfigs after fs cleanup Thomas Petazzoni
2010-04-09  9:07 ` [Buildroot] [PATCH 44/44] fs/*/Config.in: remove useless configuration comments Thomas Petazzoni
2010-04-09  9:20 ` [Buildroot] [pull request] Pull request for branch fs-cleanup Peter Korsgaard
2010-04-09 12:54   ` Thomas Petazzoni
2010-04-09 14:19 ` Peter Korsgaard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bd36a7273a6fa2d21589a1ab6e99bb231e0e868e.1270803901.git.thomas.petazzoni@free-electrons.com \
    --to=thomas.petazzoni@free-electrons.com \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.