ar71xx: fix seama factory type image generation.

Currently JFFS2 end-of-filesystem marker 0xdeadc0de is included the
computation of image's MD5 checksum as part of the seama header.  But
OpenWrt will erase blocks including and after the marker thus
invalidating the checksum after the first boot.

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>

SVN-Revision: 42915
This commit is contained in:
John Crispin 2014-10-14 12:21:41 +00:00
parent 24a0269b71
commit 70def60b04

View file

@ -673,13 +673,15 @@ define Image/Build/Seama
-rm -f $(KDIR_TMP)/image-$(2).tmp -rm -f $(KDIR_TMP)/image-$(2).tmp
$(call CatFiles,$(KDIR_TMP)/loader-$(2).bin.lzma,$$$$(($(6) - 64)),$(KDIR)/root.$(1),$(7),$(KDIR_TMP)/image-$(2).tmp) $(call CatFiles,$(KDIR_TMP)/loader-$(2).bin.lzma,$$$$(($(6) - 64)),$(KDIR)/root.$(1),$(7),$(KDIR_TMP)/image-$(2).tmp)
[ -e "$(KDIR_TMP)/image-$(2).tmp" ] && { \ [ -e "$(KDIR_TMP)/image-$(2).tmp" ] && { \
head -c -4 "$(KDIR_TMP)/image-$(2).tmp" > "$(KDIR_TMP)/image-$(2).no-jffs2mark.tmp"; \
$(STAGING_DIR_HOST)/bin/seama \ $(STAGING_DIR_HOST)/bin/seama \
-i $(KDIR_TMP)/image-$(2).tmp \ -i $(KDIR_TMP)/image-$(2).no-jffs2mark.tmp \
-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 $(call imgname,$(1),$(2))-factory.bin \ -s $(call imgname,$(1),$(2))-factory.bin \
-m "signature=$(5)" \ -m "signature=$(5)" \
-i $(KDIR_TMP)/image-$(2).tmp.seama; \ -i $(KDIR_TMP)/image-$(2).no-jffs2mark.tmp.seama; \
tail -c 4 "$(KDIR_TMP)/image-$(2).tmp" >> $(call imgname,$(1),$(2))-factory.bin; \
} }
cat $(KDIR_TMP)/loader-$(2).bin.lzma > $(KDIR_TMP)/image-$(2)-sysupgrade.tmp cat $(KDIR_TMP)/loader-$(2).bin.lzma > $(KDIR_TMP)/image-$(2)-sysupgrade.tmp
$(STAGING_DIR_HOST)/bin/seama \ $(STAGING_DIR_HOST)/bin/seama \