X-Git-Url: http://git.openwrt.org/?p=openwrt%2Fopenwrt.git;a=blobdiff_plain;f=target%2Flinux%2Far71xx%2Fimage%2Fgeneric.mk;h=158d5662fe40e2de34a49ec89cd5f3b3f524db27;hp=949fadb07cf9bdaf1608ca3e9a2d1b4e558c823a;hb=c00fb14329aebfcd927c22f1858a88ae49a58a16;hpb=3a3cd0ac4376657eccfe30fc2fdcc91acddb8f1d;ds=sidebyside diff --git a/target/linux/ar71xx/image/generic.mk b/target/linux/ar71xx/image/generic.mk index 949fadb07c..158d5662fe 100644 --- a/target/linux/ar71xx/image/generic.mk +++ b/target/linux/ar71xx/image/generic.mk @@ -1,4 +1,4 @@ -DEVICE_VARS += DAP_SIGNATURE SEAMA_SIGNATURE +DEVICE_VARS += DAP_SIGNATURE NETGEAR_BOARD_ID NETGEAR_HW_ID NETGEAR_KERNEL_MAGIC SEAMA_SIGNATURE define Build/mkbuffaloimg $(STAGING_DIR_HOST)/bin/mkbuffaloimg -B $(BOARDNAME) \ @@ -16,6 +16,42 @@ define Build/mkwrggimg mv $@.imghdr $@ endef +define Build/netgear-squashfs + rm -rf $@.fs $@.squashfs + mkdir -p $@.fs/image + cp $@ $@.fs/image/uImage + $(STAGING_DIR_HOST)/bin/mksquashfs-lzma \ + $@.fs $@.squashfs \ + -noappend -root-owned -be -b 65536 \ + $(if $(SOURCE_DATE_EPOCH),-fixed-time $(SOURCE_DATE_EPOCH)) + + dd if=/dev/zero bs=1k count=1 >> $@.squashfs + mkimage \ + -A mips -O linux -T filesystem -C none \ + -M $(NETGEAR_KERNEL_MAGIC) \ + -a 0xbf070000 -e 0xbf070000 \ + -n 'MIPS OpenWrt Linux-$(LINUX_VERSION)' \ + -d $@.squashfs $@ + rm -rf $@.squashfs $@.fs +endef + +define Build/netgear-uImage + $(call Build/uImage,$(1) -M $(NETGEAR_KERNEL_MAGIC)) +endef + +define Build/relocate-kernel + rm -rf $@.relocate + $(CP) ../../generic/image/relocate $@.relocate + $(MAKE) -j1 -C $@.relocate KERNEL_ADDR=$(KERNEL_LOADADDR) CROSS_COMPILE=$(TARGET_CROSS) + ( \ + dd if=$@.relocate/loader.bin bs=32 conv=sync && \ + perl -e '@s = stat("$@"); print pack("N", @s[7])' && \ + cat "$@" \ + ) > "$@.new" + mv "$@.new" "$@" + rm -rf $@.relocate +endef + define Build/seama $(STAGING_DIR_HOST)/bin/seama -i $@ $(if $(1),$(1),-m "dev=/dev/mtdblock/1" -m "type=firmware") mv $@.seama $@