aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ramips/image/Makefile
diff options
context:
space:
mode:
authorMathias Kresin <dev@kresin.me>2018-12-29 19:25:00 +0100
committerMathias Kresin <dev@kresin.me>2018-12-30 20:08:12 +0100
commit7c1332d95fbaea2e0a5029947a2b8d3d43c171b4 (patch)
treee8c69566ba38214068e6906ceec07c33c7657298 /target/linux/ramips/image/Makefile
parentd3bf5ff9bc7b55b2a3dab93853b33a0cd2c4ca47 (diff)
downloadupstream-7c1332d95fbaea2e0a5029947a2b8d3d43c171b4.tar.gz
upstream-7c1332d95fbaea2e0a5029947a2b8d3d43c171b4.tar.bz2
upstream-7c1332d95fbaea2e0a5029947a2b8d3d43c171b4.zip
ramips: consolidate seama image build code
Create a common template which has the required image build code defined. Add some new variables to pass individual parts to the seama recipes. Signed-off-by: Mathias Kresin <dev@kresin.me>
Diffstat (limited to 'target/linux/ramips/image/Makefile')
-rw-r--r--target/linux/ramips/image/Makefile23
1 files changed, 21 insertions, 2 deletions
diff --git a/target/linux/ramips/image/Makefile b/target/linux/ramips/image/Makefile
index 5718558e91..3c30702ea7 100644
--- a/target/linux/ramips/image/Makefile
+++ b/target/linux/ramips/image/Makefile
@@ -9,6 +9,7 @@ include $(INCLUDE_DIR)/image.mk
DEVICE_VARS += DTS IMAGE_SIZE NETGEAR_BOARD_ID NETGEAR_HW_ID
DEVICE_VARS += BUFFALO_TAG_PLATFORM BUFFALO_TAG_VERSION BUFFALO_TAG_MINOR
+DEVICE_VARS += SEAMA_SIGNATURE SEAMA_MTDBLOCK
loadaddr-y := 0x80000000
loadaddr-$(CONFIG_TARGET_ramips_rt288x) := 0x88000000
@@ -29,6 +30,21 @@ define Device/Default
IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata | check-size $$$$(IMAGE_SIZE)
endef
+define Device/seama
+ SEAMA_MTDBLOCK := 2
+ IMAGES += factory.bin
+
+ # 64 bytes offset:
+ # - 28 bytes seama_header
+ # - 36 bytes of META data (4-bytes aligned)
+ IMAGE/default := append-kernel | pad-offset $$$$(BLOCKSIZE) 64 | append-rootfs
+ IMAGE/sysupgrade.bin := \
+ $$(IMAGE/default) | seama | pad-rootfs | append-metadata | check-size $$$$(IMAGE_SIZE)
+ IMAGE/factory.bin := \
+ $$(IMAGE/default) | pad-rootfs -x 64 | seama | seama-seal | check-size $$$$(IMAGE_SIZE)
+ SEAMA_SIGNATURE :=
+endef
+
define Build/patch-dtb
$(call Image/BuildDTB,../dts/$(DTS).dts,$@.dtb)
$(STAGING_DIR_HOST)/bin/patch-dtb $@ $@.dtb
@@ -86,12 +102,15 @@ define Build/poray-header
endef
define Build/seama
- $(STAGING_DIR_HOST)/bin/seama -i $@ $(1)
+ $(STAGING_DIR_HOST)/bin/seama -i $@ \
+ -m "dev=/dev/mtdblock/$(SEAMA_MTDBLOCK)" -m "type=firmware"
mv $@.seama $@
endef
define Build/seama-seal
- $(call Build/seama,-s $@.seama $(1))
+ $(STAGING_DIR_HOST)/bin/seama -i $@ -s $@.seama \
+ -m "signature=$(SEAMA_SIGNATURE)"
+ mv $@.seama $@
endef
define Build/wrg-header