aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@nbd.name>2016-07-22 10:53:12 +0200
committerFelix Fietkau <nbd@nbd.name>2016-07-29 10:18:26 +0200
commitc5ca181d12a18ecaff5d89e56a79226bec31f2c0 (patch)
treed161b8135f4a37fff825caf66b8397da7c472515
parent4fed7a60f9eb0dce38c64bed4be8e89279fc4e00 (diff)
downloadupstream-c5ca181d12a18ecaff5d89e56a79226bec31f2c0.tar.gz
upstream-c5ca181d12a18ecaff5d89e56a79226bec31f2c0.tar.bz2
upstream-c5ca181d12a18ecaff5d89e56a79226bec31f2c0.zip
image: add wrapper variable to get the target dir for mkfs commands
Signed-off-by: Felix Fietkau <nbd@nbd.name>
-rw-r--r--include/image.mk18
1 files changed, 10 insertions, 8 deletions
diff --git a/include/image.mk b/include/image.mk
index 812d515940..2ed089d0c7 100644
--- a/include/image.mk
+++ b/include/image.mk
@@ -20,6 +20,8 @@ param_get = $(patsubst $(1)=%,%,$(filter $(1)=%,$(2)))
param_mangle = $(subst $(space),_,$(strip $(1)))
param_unmangle = $(subst _,$(space),$(1))
+mkfs_target_dir = $(TARGET_DIR)
+
KDIR=$(KERNEL_BUILD_DIR)
KDIR_TMP=$(KDIR)/tmp
DTS_DIR:=$(LINUX_DIR)/arch/$(LINUX_KARCH)/boot/dts
@@ -149,18 +151,18 @@ define Image/mkfs/jffs2/sub-raw
$(STAGING_DIR_HOST)/bin/mkfs.jffs2 \
$(2) \
-e $(patsubst %k,%KiB,$(1)) \
- -o $@ -d $(TARGET_DIR) \
+ -o $@ -d $(call mkfs_target_dir,$(3)) \
-v 2>&1 1>/dev/null | awk '/^.+$$$$/'
endef
define Image/mkfs/jffs2/sub
- $(call Image/mkfs/jffs2/sub-raw,$(1),--pad $(2))
+ $(call Image/mkfs/jffs2/sub-raw,$(1),--pad $(2),$(3))
$(call add_jffs2_mark,$@)
endef
define Image/mkfs/jffs2/template
- Image/mkfs/jffs2-$(1) = $$(call Image/mkfs/jffs2/sub,$(1),$(JFFS2OPTS))
- Image/mkfs/jffs2-$(1)-raw = $$(call Image/mkfs/jffs2/sub-raw,$(1),$(JFFS2OPTS))
+ Image/mkfs/jffs2-$(1) = $$(call Image/mkfs/jffs2/sub,$(1),$(JFFS2OPTS),$$(1))
+ Image/mkfs/jffs2-$(1)-raw = $$(call Image/mkfs/jffs2/sub-raw,$(1),$(JFFS2OPTS),$$(1))
endef
@@ -168,7 +170,7 @@ define Image/mkfs/jffs2-nand/template
Image/mkfs/jffs2-nand-$(1) = \
$$(call Image/mkfs/jffs2/sub, \
$(word 2,$(subst -, ,$(1))), \
- $(JFFS2OPTS) --no-cleanmarkers --pagesize=$(word 1,$(subst -, ,$(1))))
+ $(JFFS2OPTS) --no-cleanmarkers --pagesize=$(word 1,$(subst -, ,$(1))),$$(1))
endef
@@ -176,7 +178,7 @@ $(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) $@ \
+ $(STAGING_DIR_HOST)/bin/mksquashfs4 $(call mkfs_target_dir,$(1)) $@ \
-nopad -noappend -root-owned \
-comp $(SQUASHFSCOMP) $(SQUASHFSOPT) \
-processors $(if $(CONFIG_PKG_BUILD_JOBS),$(CONFIG_PKG_BUILD_JOBS),1) \
@@ -220,7 +222,7 @@ define Image/mkfs/ubifs
$(if $(CONFIG_TARGET_UBIFS_COMPRESSION_ZLIB),--force-compr=zlib) \
$(if $(shell echo $(CONFIG_TARGET_UBIFS_JOURNAL_SIZE)),--jrn-size=$(CONFIG_TARGET_UBIFS_JOURNAL_SIZE)) \
--squash-uids \
- -o $@ -d $(TARGET_DIR)
+ -o $@ -d $(call mkfs_target_dir,$(1))
endef
E2SIZE=$(shell echo $$(($(CONFIG_TARGET_ROOTFS_PARTSIZE)*1024*1024)))
@@ -232,7 +234,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)) \
- $@ $(TARGET_DIR)/
+ $@ $(call mkfs_target_dir,$(1))/
endef
define Image/mkfs/prepare/default