ath79: add support for EnGenius EWS511AP
[openwrt/openwrt.git] / include / image-commands.mk
index 63539bad0808c01fed3811f70b3857a33385c346..c5b64c751d9cc9ac20537807976f5d32fa0f18b4 100644 (file)
@@ -44,23 +44,23 @@ define Build/buffalo-dhp-image
        mv $@.new $@
 endef
 
-# blow up binary to given size and put a given string at its end:
-# cameo-factory <size[k]> <string>
-define Build/cameo-factory
-       factory_stamp=$(word 2,$(1)); \
-       ((reduced_size=$(subst k,*1024,$(word 1,$(1)))-$${#factory_stamp})); \
-       ( \
-               dd if=$@ bs=$$reduced_size conv=sync; \
-               echo -n $$factory_stamp; \
-       ) > $@.new && \
-       mv $@.new $@
-endef
-
 define Build/eva-image
        $(STAGING_DIR_HOST)/bin/lzma2eva $(KERNEL_LOADADDR) $(KERNEL_LOADADDR) $@ $@.new
        mv $@.new $@
 endef
 
+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))"; \
@@ -102,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
@@ -250,6 +254,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; \