[OpenWrt-Devel] [PATCH v3] ramips: build factory images for Netgear EX2700

John Crispin blogic at openwrt.org
Wed Feb 17 01:46:38 EST 2016


Hi

see below

On 16/02/2016 23:35, Joseph C. Lehner wrote:
> This patch adds support for building factory and sysupgrade images
> for the Netgear EX2700 that don't require modification of u-boot
> environment variables.
> 
> The bootloader on this device expects the kernel partition to end
> on a 64k block boundary. The last 64 byte of the kernel partition
> must contain a valid uImage header - in the stock firmware, this is
> the uImage header of the root filesystem. For this patch, we're using
> the uImage header of a 0 byte partition (ex2700-fakeroot.uImage).
> 
> Signed-off-by: Joseph C. Lehner <joseph.c.lehner at gmail.com>
> 
> ---
> 
> Changes for v3:
> * Fix maximum image size
> 
> Changes for v2:
> * Move fakeroot uImage header to separate file
> 
> diff --git a/target/linux/ramips/image/Makefile b/target/linux/ramips/image/Makefile
> index a42f8b9..c65cb27 100644
> --- a/target/linux/ramips/image/Makefile
> +++ b/target/linux/ramips/image/Makefile
> @@ -912,8 +912,36 @@ endif
>  # MT7620A Profiles
>  #
> 
> +# $(1): (ignored)
> +# $(2): Board name (small caps)
> +# $(3): DTS file name without extension
> +# $(4): Erase block size
> +# $(5): DNI hardware id
> +# $(6): Maximum image size
> +define BuildFirmware/Netgear/squashfs
> +	$(call PatchKernelLzmaDtb,$(2),$(3))
> +	$(eval kernelsize=$(shell wc -c < $(KDIR)/vmlinux-$(2).bin.lzma))
> +	# Round (kernelsize + 2*64) to erase blocks, avoiding parens
> +	$(eval kernelsize=$(shell expr 2 \* 64 + $(kernelsize)))
> +	$(eval kernelsize=$(shell expr 1 + $(kernelsize) / $(4)))
> +	$(eval kernelsize=$(shell expr $(4) \* $(kernelsize)))
> +	dd if=$(KDIR)/vmlinux-$(2).bin.lzma \
> +		of=$(KDIR)/vmlinux-$(2).bin.lzma.tmp \
> +		bs=$$$$(($(kernelsize)-2*64)) count=1 conv=sync
> +
> +	$(call MkImage,lzma,$(KDIR)/vmlinux-$(2).bin.lzma.tmp,$(KDIR)/vmlinux-$(2).uImage)
> +	cat ex2700-fakeroot.uImage >> $(KDIR)/vmlinux-$(2).uImage
> +	$(call MkImageSysupgrade/squashfs,squashfs,$(2),$(6))
> +
> +	$(STAGING_DIR_HOST)/bin/mkdniimg \
> +		-B $(3) -H $(5) -v OpenWrt \
> +		-i $(call imgname,squashfs,$(2))-sysupgrade.bin \
> +		-o $(call imgname,squashfs,$(2))-factory.bin
> +endef
> +
>  Image/Build/Profile/E1700=$(call BuildFirmware/UMedia/$(1),$(1),e1700,E1700,0x013326)
> -Image/Build/Profile/EX2700=$(call BuildFirmware/Default4M/$(1),$(1),ex2700,EX2700)
> +ex2700_mtd_size=3866624
> +Image/Build/Profile/EX2700=$(call
> BuildFirmware/Netgear/$(1),$(1),ex2700,EX2700,65536,29764623+4+0+32+2x2+0,$(ex2700_mtd_size))

patch is line wrapper right here. after fixing this manually it still
failed to apply.

	John

>  Image/Build/Profile/MT7620a=$(call BuildFirmware/Default8M/$(1),$(1),mt7620a,MT7620a)
>  Image/Build/Profile/MT7620a_MT7610e=$(call
> BuildFirmware/Default8M/$(1),$(1),mt7620a_mt7610e,MT7620a_MT7610e)
>  Image/Build/Profile/MT7620a_MT7530=$(call
> BuildFirmware/Default8M/$(1),$(1),mt7620a_mt7530,MT7620a_MT7530)
> diff --git a/target/linux/ramips/image/ex2700-fakeroot.uImage
> b/target/linux/ramips/image/ex2700-fakeroot.uImage
> new file mode 100644
> index 0000000000000000000000000000000000000000..340f736141e84e425fe66b372eef80b217146df5
> GIT binary patch
> literal 64
> ocmY#ql?+qLV?W4%1+cQRGx!&z=7krPD5NE3rxxYsm!K;H01lrBPXGV_
> 
> literal 0
> HcmV?d00001
> 
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list