build: remove duplicate mksercomfw image recipe
[openwrt/staging/mkresin.git] / include / image-commands.mk
index f7e6ba6aa6e730992fef12a0476b36a912626072..169c1919e7b56c02ff1ea46c97715e84141b342c 100644 (file)
@@ -49,17 +49,29 @@ define Build/eva-image
        mv $@.new $@
 endef
 
-define Build/make-ras
+define Build/seama
+       $(STAGING_DIR_HOST)/bin/seama -i $@ \
+               -m "dev=/dev/mtdblock/$(SEAMA_MTDBLOCK)" -m "type=firmware"
+       mv $@.seama $@
+endef
+
+define Build/seama-seal
+       $(STAGING_DIR_HOST)/bin/seama -i $@ -s $@.seama \
+               -m "signature=$(SEAMA_SIGNATURE)"
+       mv $@.seama $@
+endef
+
+define Build/zyxel-ras-image
        let \
                newsize="$(subst k,* 1024,$(RAS_ROOTFS_SIZE))"; \
-               $(TOPDIR)/scripts/make-ras.sh \
-                       --board $(RAS_BOARD) \
-                       --version $(RAS_VERSION) \
-                       --kernel $(call param_get_default,kernel,$(1),$(IMAGE_KERNEL)) \
-                       --rootfs $@ \
-                       --rootfssize $$newsize \
-                       $@.new
-       @mv $@.new $@
+               $(STAGING_DIR_HOST)/bin/mkrasimage \
+                       -b $(RAS_BOARD) \
+                       -v $(RAS_VERSION) \
+                       -r $@ \
+                       -s $$newsize \
+                       -o $@.new \
+                       $(if $(findstring separate-kernel,$(word 1,$(1))),-k $(IMAGE_KERNEL)) \
+               && mv $@.new $@
 endef
 
 define Build/netgear-chk
@@ -90,6 +102,10 @@ define Build/append-squashfs-fakeroot-be
        cat $@.fakesquashfs >> $@
 endef
 
+define Build/append-string
+       echo -n $(1) >> $@
+endef
+
 # append a fake/empty uImage header, to fool bootloaders rootfs integrity check
 # for example
 define Build/append-uImage-fakehdr
@@ -228,6 +244,11 @@ define Build/pad-offset
        mv $@.new $@
 endef
 
+define Build/xor-image
+       $(STAGING_DIR_HOST)/bin/xorimage -i $@ -o $@.xor $(1)
+       mv $@.xor $@
+endef
+
 define Build/check-size
        @[ $$(($(subst k,* 1024,$(subst m, * 1024k,$(1))))) -ge "$$(stat -c%s $@)" ] || { \
                echo "WARNING: Image file $@ is too big" >&2; \
@@ -256,6 +277,11 @@ define Build/openmesh-image
                "$(call param_get_default,rootfs,$(1),$@)" "rootfs"
 endef
 
+define Build/senao-header
+       $(STAGING_DIR_HOST)/bin/mksenaofw $(1) -e $@ -o $@.new
+       mv $@.new $@
+endef
+
 define Build/sysupgrade-tar
        sh $(TOPDIR)/scripts/sysupgrade-tar.sh \
                --board $(if $(BOARD_NAME),$(BOARD_NAME),$(DEVICE_NAME)) \
@@ -309,7 +335,7 @@ metadata_json = \
 
 define Build/append-metadata
        $(if $(SUPPORTED_DEVICES),-echo $(call metadata_json,$(SUPPORTED_DEVICES)) | fwtool -I - $@)
-       [ ! -s "$(BUILD_KEY)" -o ! -s "$(BUILD_KEY).ucert" ] || { \
+       [ ! -s "$(BUILD_KEY)" -o ! -s "$(BUILD_KEY).ucert" -o ! -s "$@" ] || { \
                cp "$(BUILD_KEY).ucert" "$@.ucert" ;\
                usign -S -m "$@" -s "$(BUILD_KEY)" -x "$@.sig" ;\
                ucert -A -c "$@.ucert" -x "$@.sig" ;\