ar71xx: image: seama: fix making factory and sysupgrade image

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
This commit is contained in:
Yousong Zhou 2016-07-09 20:15:58 +08:00 committed by Jo-Philipp Wich
parent d06b68fe83
commit 6d6db4ff7b

View file

@ -437,22 +437,17 @@ TARGET_DEVICES += hiwifi-hc6361
# The pre-filled 64 bytes consist of # The pre-filled 64 bytes consist of
# - 28 bytes seama_header # - 28 bytes seama_header
# - 36 bytes of META data (4-bytes aligned) # - 36 bytes of META data (4-bytes aligned)
#
# And as the 4 bytes jffs2 marker will be erased on first boot, they need to
# be excluded from the calculation of checksum
define Build/seama-factory define Build/seama-factory
( dd if=/dev/zero bs=64 count=1; cat $(word 1,$^) ) >$@.loader.tmp ( dd if=/dev/zero bs=64 count=1; cat $(word 1,$^) ) >$@.loader.tmp
( dd if=$@.loader.tmp bs=64k conv=sync; dd if=$(word 2,$^) ) >$@.tmp.0 ( dd if=$@.loader.tmp bs=64k conv=sync; dd if=$(word 2,$^) ) >$@.tmp.0
tail -c +65 $@.tmp.0 >$@.tmp.1 tail -c +65 $@.tmp.0 >$@.tmp.1
head -c -4 $@.tmp.1 >$@.tmp.2
$(STAGING_DIR_HOST)/bin/seama \ $(STAGING_DIR_HOST)/bin/seama \
-i $@.tmp.2 \ -i $@.tmp.1 \
-m "dev=/dev/mtdblock/1" -m "type=firmware" -m "dev=/dev/mtdblock/1" -m "type=firmware"
$(STAGING_DIR_HOST)/bin/seama \ $(STAGING_DIR_HOST)/bin/seama \
-s $@ \ -s $@ \
-m "signature=$(1)" \ -m "signature=$(1)" \
-i $@.tmp.2.seama -i $@.tmp.1.seama
tail -c 4 $@.tmp.1 >>$@
rm -f $@.loader.tmp $@.tmp.* rm -f $@.loader.tmp $@.tmp.*
endef endef
@ -461,6 +456,7 @@ define Build/seama-sysupgrade
-i $(word 1,$^) \ -i $(word 1,$^) \
-m "dev=/dev/mtdblock/1" -m "type=firmware" -m "dev=/dev/mtdblock/1" -m "type=firmware"
( dd if=$(word 1,$^).seama bs=64k conv=sync; dd if=$(word 2,$^) ) >$@ ( dd if=$(word 1,$^).seama bs=64k conv=sync; dd if=$(word 2,$^) ) >$@
rm -f $(word 1,$^).seama
endef endef
define Build/seama-initramfs define Build/seama-initramfs
@ -470,16 +466,21 @@ define Build/seama-initramfs
mv $@.seama $@ mv $@.seama $@
endef endef
define Build/seama-pad-rootfs
$(STAGING_DIR_HOST)/bin/padjffs2 $(word 2,$^) -c 64 >>$@
endef
define Device/seama define Device/seama
CONSOLE := ttyS0,115200 CONSOLE := ttyS0,115200
KERNEL := kernel-bin | loader-kernel-cmdline | lzma LOADER_TYPE := bin
KERNEL := kernel-bin | lzma | loader-kernel-cmdline | lzma
KERNEL_INITRAMFS := kernel-bin | patch-cmdline | lzma | seama-initramfs KERNEL_INITRAMFS := kernel-bin | patch-cmdline | lzma | seama-initramfs
KERNEL_INITRAMFS_SUFFIX = $$(KERNEL_SUFFIX).seama KERNEL_INITRAMFS_SUFFIX = $$(KERNEL_SUFFIX).seama
IMAGES := sysupgrade.bin factory.bin IMAGES := sysupgrade.bin factory.bin
IMAGE/sysupgrade.bin := seama-sysupgrade $$$$(SEAMA_SIGNATURE) | check-size $$$$(IMAGE_SIZE) IMAGE/sysupgrade.bin := seama-sysupgrade $$$$(SEAMA_SIGNATURE) | seama-pad-rootfs | check-size $$$$(IMAGE_SIZE)
IMAGE/factory.bin := seama-factory $$$$(SEAMA_SIGNATURE) | check-size $$$$(IMAGE_SIZE) IMAGE/factory.bin := seama-factory $$$$(SEAMA_SIGNATURE) | seama-pad-rootfs | check-size $$$$(IMAGE_SIZE)
SEAMA_SIGNATURE := SEAMA_SIGNATURE :=
DEVICE_VARS := SEAMA_SIGNATURE DEVICE_VARS += SEAMA_SIGNATURE
endef endef
define Device/mynet-n600 define Device/mynet-n600