summaryrefslogtreecommitdiff
path: root/include/image-commands.mk
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@nbd.name>2016-07-30 14:19:11 +0200
committerFelix Fietkau <nbd@nbd.name>2016-07-31 12:25:25 +0200
commit63b525dd6b209af5554a2d053efd4b3ce6f60c9c (patch)
treeb4bf688fa7ce3b9cbbad996dd0d60730eacbede9 /include/image-commands.mk
parent9201e88f518dbe5246aa2f77342175805ef10cdd (diff)
downloadmtk-20170518-63b525dd6b209af5554a2d053efd4b3ce6f60c9c.zip
mtk-20170518-63b525dd6b209af5554a2d053efd4b3ce6f60c9c.tar.gz
mtk-20170518-63b525dd6b209af5554a2d053efd4b3ce6f60c9c.tar.bz2
image: add a helper variable for getting kernel/rootfs from within image Build/* templates
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'include/image-commands.mk')
-rw-r--r--include/image-commands.mk19
1 files changed, 11 insertions, 8 deletions
diff --git a/include/image-commands.mk b/include/image-commands.mk
index f95a68d..790e929 100644
--- a/include/image-commands.mk
+++ b/include/image-commands.mk
@@ -1,5 +1,8 @@
# Build commands that can be called from Device/* templates
+IMAGE_KERNEL = $(word 1,$^)
+IMAGE_ROOTFS = $(word 2,$^)
+
define Build/uImage
mkimage -A $(LINUX_KARCH) \
-O linux -T kernel \
@@ -30,7 +33,7 @@ define Build/tplink-safeloader
-$(STAGING_DIR_HOST)/bin/tplink-safeloader \
-B $(TPLINK_BOARD_NAME) \
-V $(REVISION) \
- -k $(word 1,$^) \
+ -k $(IMAGE_KERNEL) \
-r $@ \
-o $@.new \
-j \
@@ -92,18 +95,18 @@ define Build/patch-cmdline
endef
define Build/append-kernel
- dd if=$(word 1,$^) $(if $(1),bs=$(1) conv=sync) >> $@
+ dd if=$(IMAGE_KERNEL) $(if $(1),bs=$(1) conv=sync) >> $@
endef
define Build/append-rootfs
- dd if=$(word 2,$^) $(if $(1),bs=$(1) conv=sync) >> $@
+ dd if=$(IMAGE_ROOTFS) $(if $(1),bs=$(1) conv=sync) >> $@
endef
define Build/append-ubi
sh $(TOPDIR)/scripts/ubinize-image.sh \
$(if $(UBOOTENV_IN_UBI),--uboot-env) \
- $(if $(KERNEL_IN_UBI),--kernel $(word 1,$^)) \
- $(word 2,$^) \
+ $(if $(KERNEL_IN_UBI),--kernel $(IMAGE_KERNEL)) \
+ $(IMAGE_ROOTFS) \
$@.tmp \
-p $(BLOCKSIZE) -m $(PAGESIZE) \
$(if $(SUBPAGESIZE),-s $(SUBPAGESIZE)) \
@@ -142,7 +145,7 @@ endef
define Build/combined-image
-sh $(TOPDIR)/scripts/combined-image.sh \
- "$(word 1,$^)" \
+ "$(IMAGE_KERNEL)" \
"$@" \
"$@.new"
@mv $@.new $@
@@ -151,7 +154,7 @@ endef
define Build/sysupgrade-tar
sh $(TOPDIR)/scripts/sysupgrade-tar.sh \
--board $(if $(BOARD_NAME),$(BOARD_NAME),$(DEVICE_NAME)) \
- --kernel $(call param_get_default,kernel,$(1),$(word 1,$^)) \
- --rootfs $(call param_get_default,rootfs,$(1),$(word 2,$^)) \
+ --kernel $(call param_get_default,kernel,$(1),$(IMAGE_KERNEL)) \
+ --rootfs $(call param_get_default,rootfs,$(1),$(IMAGE_ROOTFS)) \
$@
endef