summaryrefslogtreecommitdiff
path: root/include/image.mk
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@nbd.name>2016-07-22 01:17:35 +0200
committerFelix Fietkau <nbd@nbd.name>2016-07-29 10:18:26 +0200
commit4fed7a60f9eb0dce38c64bed4be8e89279fc4e00 (patch)
tree0275e6b0303920eeb76fc9f9e25b3217e4789aed /include/image.mk
parent973e6e1d71c161f1df336d9eaed019b013a7927f (diff)
downloadmtk-20170518-4fed7a60f9eb0dce38c64bed4be8e89279fc4e00.zip
mtk-20170518-4fed7a60f9eb0dce38c64bed4be8e89279fc4e00.tar.gz
mtk-20170518-4fed7a60f9eb0dce38c64bed4be8e89279fc4e00.tar.bz2
image: make mkfs template output to $@
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'include/image.mk')
-rw-r--r--include/image.mk28
1 files changed, 18 insertions, 10 deletions
diff --git a/include/image.mk b/include/image.mk
index 9bb2daa..812d515 100644
--- a/include/image.mk
+++ b/include/image.mk
@@ -145,25 +145,29 @@ define Image/BuildDTB
$(RM) $(2).tmp
endef
-define Image/mkfs/jffs2/sub
- $(STAGING_DIR_HOST)/bin/mkfs.jffs2 $(3) --pad -e $(patsubst %k,%KiB,$(1)) -o $(KDIR)/root.jffs2-$(2) -d $(TARGET_DIR) -v 2>&1 1>/dev/null | awk '/^.+$$$$/'
- $(call add_jffs2_mark,$(KDIR)/root.jffs2-$(2))
+define Image/mkfs/jffs2/sub-raw
+ $(STAGING_DIR_HOST)/bin/mkfs.jffs2 \
+ $(2) \
+ -e $(patsubst %k,%KiB,$(1)) \
+ -o $@ -d $(TARGET_DIR) \
+ -v 2>&1 1>/dev/null | awk '/^.+$$$$/'
endef
-define Image/mkfs/jffs2/sub-raw
- $(STAGING_DIR_HOST)/bin/mkfs.jffs2 $(3) -e $(patsubst %k,%KiB,$(1)) -o $(KDIR)/root.jffs2-$(2)-raw -d $(TARGET_DIR) -v 2>&1 1>/dev/null | awk '/^.+$$$$/'
+define Image/mkfs/jffs2/sub
+ $(call Image/mkfs/jffs2/sub-raw,$(1),--pad $(2))
+ $(call add_jffs2_mark,$@)
endef
define Image/mkfs/jffs2/template
- Image/mkfs/jffs2-$(1) = $$(call Image/mkfs/jffs2/sub,$(1),$(1),$(JFFS2OPTS))
- Image/mkfs/jffs2-$(1)-raw = $$(call Image/mkfs/jffs2/sub-raw,$(1),$(1),$(JFFS2OPTS))
+ Image/mkfs/jffs2-$(1) = $$(call Image/mkfs/jffs2/sub,$(1),$(JFFS2OPTS))
+ Image/mkfs/jffs2-$(1)-raw = $$(call Image/mkfs/jffs2/sub-raw,$(1),$(JFFS2OPTS))
endef
define Image/mkfs/jffs2-nand/template
Image/mkfs/jffs2-nand-$(1) = \
$$(call Image/mkfs/jffs2/sub, \
- $(word 2,$(subst -, ,$(1))),nand-$(1), \
+ $(word 2,$(subst -, ,$(1))), \
$(JFFS2OPTS) --no-cleanmarkers --pagesize=$(word 1,$(subst -, ,$(1))))
endef
@@ -172,7 +176,11 @@ $(eval $(foreach S,$(JFFS2_BLOCKSIZE),$(call Image/mkfs/jffs2/template,$(S))))
$(eval $(foreach S,$(NAND_BLOCKSIZE),$(call Image/mkfs/jffs2-nand/template,$(S))))
define Image/mkfs/squashfs
- $(STAGING_DIR_HOST)/bin/mksquashfs4 $(TARGET_DIR) $(KDIR)/root.squashfs -nopad -noappend -root-owned -comp $(SQUASHFSCOMP) $(SQUASHFSOPT) -processors $(if $(CONFIG_PKG_BUILD_JOBS),$(CONFIG_PKG_BUILD_JOBS),1) $(if $(SOURCE_DATE_EPOCH),-fixed-time $(SOURCE_DATE_EPOCH))
+ $(STAGING_DIR_HOST)/bin/mksquashfs4 $(TARGET_DIR) $@ \
+ -nopad -noappend -root-owned \
+ -comp $(SQUASHFSCOMP) $(SQUASHFSOPT) \
+ -processors $(if $(CONFIG_PKG_BUILD_JOBS),$(CONFIG_PKG_BUILD_JOBS),1) \
+ $(if $(SOURCE_DATE_EPOCH),-fixed-time $(SOURCE_DATE_EPOCH))
endef
# $(1): board name
@@ -224,7 +232,7 @@ define Image/mkfs/ext4
-m $(CONFIG_TARGET_EXT4_RESERVED_PCT) \
$(if $(CONFIG_TARGET_EXT4_JOURNAL),,-J) \
$(if $(SOURCE_DATE_EPOCH),-T $(SOURCE_DATE_EPOCH)) \
- $(KDIR)/root.ext4 $(TARGET_DIR)/
+ $@ $(TARGET_DIR)/
endef
define Image/mkfs/prepare/default