ath79: move seama image recipe to the common Makefile
[openwrt/openwrt.git] / target / linux / ath79 / image / Makefile
index 8328be7667cf8dd675fc5b4571e1a7a61405c378..5647200b4ba04c95c7fb17539a4b8b35652f5d0f 100644 (file)
@@ -7,6 +7,7 @@ DEVICE_VARS += LOADER_FLASH_OFFS LOADER_TYPE
 DEVICE_VARS += LOADER_FLASH_MAX LOADER_KERNEL_MAGIC
 DEVICE_VARS += NETGEAR_BOARD_ID NETGEAR_HW_ID
 DEVICE_VARS += RAS_BOARD RAS_ROOTFS_SIZE RAS_VERSION
+DEVICE_VARS += SEAMA_SIGNATURE SEAMA_MTDBLOCK
 
 define Build/loader-common
        rm -rf $@.src
@@ -87,6 +88,23 @@ define Device/loader-okli-uimage
        lzma | uImage lzma
 endef
 
+define Device/seama
+  KERNEL := kernel-bin | append-dtb | relocate-kernel | lzma
+  KERNEL_INITRAMFS := $$(KERNEL) | seama
+  IMAGES += factory.bin
+  SEAMA_MTDBLOCK := 1
+
+  # 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 | \
+       check-size | append-metadata
+  IMAGE/factory.bin := $$(IMAGE/default) | pad-rootfs -x 64 | seama | \
+       seama-seal | check-size
+  SEAMA_SIGNATURE :=
+endef
+
 include $(SUBTARGET).mk
 
 ifeq ($(SUBTARGET),generic)