From b23fd657f4ca146f0bbe02d509acc8f185708582 Mon Sep 17 00:00:00 2001 From: James <> Date: Thu, 19 Jan 2017 00:02:12 +0000 Subject: make original firmware compatible updates, and make sysupgrade work --- do-work/Edimax-v2/config | 40 ++++++++++--- do-work/Edimax-v2/embr6478acv2 | 130 +++++++++++++++++------------------------ do-work/Edimax-v2/endstop | 77 ------------------------ do-work/Edimax-v2/series | 1 - 4 files changed, 85 insertions(+), 163 deletions(-) diff --git a/do-work/Edimax-v2/config b/do-work/Edimax-v2/config index 50a8c03..e82abec 100644 --- a/do-work/Edimax-v2/config +++ b/do-work/Edimax-v2/config @@ -1,9 +1,9 @@ diff --git a/.config b/.config new file mode 100644 -index 0000000..ec486f5 +index 0000000..407db64 --- /dev/null +++ b/.config -@@ -0,0 +1,4177 @@ +@@ -0,0 +1,4199 @@ +# +# Automatically generated file; DO NOT EDIT. +# LEDE Configuration @@ -1496,7 +1496,7 @@ index 0000000..ec486f5 +# CONFIG_PACKAGE_kmod-md-mod is not set +# CONFIG_PACKAGE_kmod-nbd is not set +# CONFIG_PACKAGE_kmod-scsi-cdrom is not set -+# CONFIG_PACKAGE_kmod-scsi-core is not set ++CONFIG_PACKAGE_kmod-scsi-core=m +# CONFIG_PACKAGE_kmod-scsi-generic is not set +# CONFIG_PACKAGE_kmod-scsi-tape is not set + @@ -1577,7 +1577,7 @@ index 0000000..ec486f5 +# CONFIG_PACKAGE_kmod-fs-reiserfs is not set +# CONFIG_PACKAGE_kmod-fs-squashfs is not set +# CONFIG_PACKAGE_kmod-fs-udf is not set -+# CONFIG_PACKAGE_kmod-fs-vfat is not set ++CONFIG_PACKAGE_kmod-fs-vfat=m +# CONFIG_PACKAGE_kmod-fs-xfs is not set +# CONFIG_PACKAGE_kmod-fuse is not set + @@ -1645,7 +1645,7 @@ index 0000000..ec486f5 +CONFIG_PACKAGE_kmod-nls-base=m +# CONFIG_PACKAGE_kmod-nls-cp1250 is not set +# CONFIG_PACKAGE_kmod-nls-cp1251 is not set -+# CONFIG_PACKAGE_kmod-nls-cp437 is not set ++CONFIG_PACKAGE_kmod-nls-cp437=m +# CONFIG_PACKAGE_kmod-nls-cp775 is not set +# CONFIG_PACKAGE_kmod-nls-cp850 is not set +# CONFIG_PACKAGE_kmod-nls-cp852 is not set @@ -1653,10 +1653,10 @@ index 0000000..ec486f5 +# CONFIG_PACKAGE_kmod-nls-cp864 is not set +# CONFIG_PACKAGE_kmod-nls-cp866 is not set +# CONFIG_PACKAGE_kmod-nls-cp932 is not set -+# CONFIG_PACKAGE_kmod-nls-iso8859-1 is not set ++CONFIG_PACKAGE_kmod-nls-iso8859-1=m +# CONFIG_PACKAGE_kmod-nls-iso8859-13 is not set +# CONFIG_PACKAGE_kmod-nls-iso8859-15 is not set -+# CONFIG_PACKAGE_kmod-nls-iso8859-2 is not set ++CONFIG_PACKAGE_kmod-nls-iso8859-2=m +# CONFIG_PACKAGE_kmod-nls-iso8859-6 is not set +# CONFIG_PACKAGE_kmod-nls-iso8859-8 is not set +# CONFIG_PACKAGE_kmod-nls-koi8r is not set @@ -1912,8 +1912,30 @@ index 0000000..ec486f5 +# CONFIG_PACKAGE_kmod-usb-ohci is not set +# CONFIG_PACKAGE_kmod-usb-ohci-pci is not set +# CONFIG_PACKAGE_kmod-usb-printer is not set -+# CONFIG_PACKAGE_kmod-usb-serial is not set -+# CONFIG_PACKAGE_kmod-usb-storage is not set ++CONFIG_PACKAGE_kmod-usb-serial=m ++# CONFIG_PACKAGE_kmod-usb-serial-ark3116 is not set ++# CONFIG_PACKAGE_kmod-usb-serial-belkin is not set ++CONFIG_PACKAGE_kmod-usb-serial-ch341=m ++CONFIG_PACKAGE_kmod-usb-serial-cp210x=m ++# CONFIG_PACKAGE_kmod-usb-serial-cypress-m8 is not set ++# CONFIG_PACKAGE_kmod-usb-serial-dmx_usb_module is not set ++CONFIG_PACKAGE_kmod-usb-serial-ftdi=m ++# CONFIG_PACKAGE_kmod-usb-serial-garmin is not set ++# CONFIG_PACKAGE_kmod-usb-serial-ipw is not set ++# CONFIG_PACKAGE_kmod-usb-serial-keyspan is not set ++# CONFIG_PACKAGE_kmod-usb-serial-mct is not set ++CONFIG_PACKAGE_kmod-usb-serial-mos7720=m ++CONFIG_PACKAGE_kmod-usb-serial-option=m ++# CONFIG_PACKAGE_kmod-usb-serial-oti6858 is not set ++CONFIG_PACKAGE_kmod-usb-serial-pl2303=m ++CONFIG_PACKAGE_kmod-usb-serial-qualcomm=m ++CONFIG_PACKAGE_kmod-usb-serial-sierrawireless=m ++CONFIG_PACKAGE_kmod-usb-serial-simple=m ++CONFIG_PACKAGE_kmod-usb-serial-ti-usb=m ++# CONFIG_PACKAGE_kmod-usb-serial-visor is not set ++CONFIG_PACKAGE_kmod-usb-serial-wwan=m ++# CONFIG_PACKAGE_kmod-usb-serial-xr_usb_serial_common is not set ++CONFIG_PACKAGE_kmod-usb-storage=m +# CONFIG_PACKAGE_kmod-usb-storage-extras is not set +# CONFIG_PACKAGE_kmod-usb-uhci is not set +# CONFIG_PACKAGE_kmod-usb-wdm is not set diff --git a/do-work/Edimax-v2/embr6478acv2 b/do-work/Edimax-v2/embr6478acv2 index 4bbe3e9..0bcd3eb 100644 --- a/do-work/Edimax-v2/embr6478acv2 +++ b/do-work/Edimax-v2/embr6478acv2 @@ -11,6 +11,34 @@ index 51cd8f3..8ede6c4 100644 MAINTAINER:=John Crispin KERNEL_PATCHVER:=4.4 +diff --git a/target/linux/ramips/base-files/lib/ramips.sh b/target/linux/ramips/base-files/lib/ramips.sh +index eda300b..8c27cad 100755 +--- a/target/linux/ramips/base-files/lib/ramips.sh ++++ b/target/linux/ramips/base-files/lib/ramips.sh +@@ -571,6 +571,9 @@ ramips_board_detect() { + *"YK1") + name="youku-yk1" + ;; ++ *"BR-6478ACV2") ++ name="br-6478ac-v2" ++ ;; + *) + name="generic" + ;; +diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh b/target/linux/ramips/base-files/lib/upgrade/platform.sh +index 0ef2308..e84fcef 100755 +--- a/target/linux/ramips/base-files/lib/upgrade/platform.sh ++++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh +@@ -183,7 +183,8 @@ platform_check_image() { + } + return 0 + ;; +- br-6475nd) ++ br-6475nd|\ ++ br-6478ac-v2) + [ "$magic" != "43535953" ] && { + echo "Invalid image type." + return 1 diff --git a/target/linux/ramips/dts/BR-6478AC-V2.dts b/target/linux/ramips/dts/BR-6478AC-V2.dts index ac870cc..ce1054f 100644 --- a/target/linux/ramips/dts/BR-6478AC-V2.dts @@ -88,23 +116,42 @@ index d165ec5..8a256bd 100644 include $(INCLUDE_DIR)/image.mk diff --git a/target/linux/ramips/image/mt7620.mk b/target/linux/ramips/image/mt7620.mk -index d508fd9..ce953dd 100644 +index d508fd9..ee4b220 100644 --- a/target/linux/ramips/image/mt7620.mk +++ b/target/linux/ramips/image/mt7620.mk -@@ -2,6 +2,12 @@ +@@ -2,11 +2,22 @@ # MT7620A Profiles # + -+define Build/edmx-header -+ $(STAGING_DIR_HOST)/bin/mkedmximg < $@ > $@.new && mv $@.new $@ -+endef ++#define Build/edmx-header ++# $(STAGING_DIR_HOST)/bin/mkedmximg < $@ > $@.new && mv $@.new $@ ++#endef + + define Build/tplink-header $(STAGING_DIR_HOST)/bin/mktplinkfw2 -a 0x4 -V "ver. 2.0" -B $(1) \ -o $@.new -k $@ && mv $@.new $@ -@@ -416,18 +422,12 @@ define Device/br-6478ac-v2 + endef + ++ ++define Build/edimax-header ++ $(STAGING_DIR_HOST)/bin/mkedimaximg -i $@ -o $@.new -s CSYS $(1) && mv $@.new $@ ++endef ++ + define Build/pad-kernel-ex2700 + cp $@ $@.tmp && dd if=/dev/zero bs=64 count=1 >> $@.tmp \ + && dd if=$@.tmp of=$@.new bs=64k conv=sync && truncate -s -64 $@.new \ +@@ -400,7 +411,7 @@ define Device/dch-m225 + IMAGE/sysupgrade.bin := \ + append-kernel | pad-offset $$$$(BLOCKSIZE) 64 | append-rootfs | \ + seama -m "dev=/dev/mtdblock/2" -m "type=firmware" | \ +- pad-rootfs | check-size $$$$(IMAGE_SIZE) ++ Pad-rootfs | check-size $$$$(IMAGE_SIZE) + IMAGE/factory.bin := \ + append-kernel | pad-offset $$$$(BLOCKSIZE) 64 | \ + append-rootfs | pad-rootfs -x 64 | \ +@@ -416,18 +427,8 @@ define Device/br-6478ac-v2 DTS := BR-6478AC-V2 DEVICE_TITLE := Edimax BR-6478AC-V2 BLOCKSIZE := 4k @@ -120,11 +167,7 @@ index d508fd9..ce953dd 100644 - seama -m "dev=/dev/mtdblock/2" -m "type=firmware" | \ - seama-seal -m "signature=wapn22_dlink.2013gui_dap1320b" | \ - check-size $$$$(IMAGE_SIZE) -+ IMAGES += factory.bin rawfs.bin kernel.bin -+ IMAGE/rawfs.bin := append-rootfs -+ IMAGE/kernel.bin := append-kernel | pad-offset $$$$(BLOCKSIZE) 20 | edmx-header -+ IMAGE/sysupgrade.bin := append-kernel | pad-offset $$$$(BLOCKSIZE) 20 | edmx-header | append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE) -+ IMAGE/factory.bin := append-kernel | pad-offset $$$$(BLOCKSIZE) 20 | edmx-header | append-rootfs | pad-rootfs -x 64 | check-size $$$$(IMAGE_SIZE) ++ IMAGE/sysupgrade.bin := append-kernel | pad-offset $$$$(BLOCKSIZE) 20 | append-rootfs | pad-rootfs -x 20 | check-size $$$$(IMAGE_SIZE) | edimax-header -m RN68 -f 0x70000 -S 0x1100000 DEVICE_PACKAGES := kmod-mt76 endef TARGET_DEVICES += br-6478ac-v2 @@ -242,68 +285,3 @@ index 0000000..59c7b5e + } + + static int -diff --git a/tools/firmware-utils/Makefile b/tools/firmware-utils/Makefile -index 803ada4..d55d914 100644 ---- a/tools/firmware-utils/Makefile -+++ b/tools/firmware-utils/Makefile -@@ -72,6 +72,7 @@ define Host/Compile - $(call cc,mkheader_gemtek,-lz) - $(call cc,mkrtn56uimg, -lz) - $(call cc,dgn3500sum) -+ $(call cc,mkedmximg) - $(call cc,edimax_fw_header, -Wall) - $(call cc,mkmerakifw sha1, -Wall) - $(call cc,mkmerakifw-old, -Wall) -diff --git a/tools/firmware-utils/src/mkedmximg.c b/tools/firmware-utils/src/mkedmximg.c -new file mode 100644 -index 0000000..d420cc1 ---- /dev/null -+++ b/tools/firmware-utils/src/mkedmximg.c -@@ -0,0 +1,47 @@ -+#include -+#include -+#include -+ -+char buf[8*1024*1024]; -+ -+ -+struct header { -+uint32_t csys; -+uint32_t thing1; -+uint32_t thing2; -+uint32_t board_sig; -+uint32_t len; -+}; -+ -+ -+ -+ -+int main(int argc,char *argv[]) -+{ -+size_t len; -+struct header h; -+uint32_t crc; -+ -+ -+len=read(0,buf,sizeof(buf)); -+ -+h.csys='SYSC'; -+h.thing1=0x01100000; -+h.thing2=0x00070000; -+h.board_sig='86NR'; -+h.len=len; -+ -+ -+write(1,&h,sizeof(h)); -+write(1,buf,len); -+//write(1,&crc,sizeof(crc)); -+ -+return 0; -+} -+ -+ -+ -+ -+ -+ -+ diff --git a/do-work/Edimax-v2/endstop b/do-work/Edimax-v2/endstop index 2056b94..e69de29 100644 --- a/do-work/Edimax-v2/endstop +++ b/do-work/Edimax-v2/endstop @@ -1,77 +0,0 @@ -diff --git a/.config b/.config -index ec486f5..407db64 100644 ---- a/.config -+++ b/.config -@@ -1490,7 +1490,7 @@ CONFIG_PACKAGE_rt2800-pci-firmware=y - # CONFIG_PACKAGE_kmod-md-mod is not set - # CONFIG_PACKAGE_kmod-nbd is not set - # CONFIG_PACKAGE_kmod-scsi-cdrom is not set --# CONFIG_PACKAGE_kmod-scsi-core is not set -+CONFIG_PACKAGE_kmod-scsi-core=m - # CONFIG_PACKAGE_kmod-scsi-generic is not set - # CONFIG_PACKAGE_kmod-scsi-tape is not set - -@@ -1571,7 +1571,7 @@ CONFIG_PACKAGE_rt2800-pci-firmware=y - # CONFIG_PACKAGE_kmod-fs-reiserfs is not set - # CONFIG_PACKAGE_kmod-fs-squashfs is not set - # CONFIG_PACKAGE_kmod-fs-udf is not set --# CONFIG_PACKAGE_kmod-fs-vfat is not set -+CONFIG_PACKAGE_kmod-fs-vfat=m - # CONFIG_PACKAGE_kmod-fs-xfs is not set - # CONFIG_PACKAGE_kmod-fuse is not set - -@@ -1639,7 +1639,7 @@ CONFIG_PACKAGE_kmod-lib-crc-itu-t=y - CONFIG_PACKAGE_kmod-nls-base=m - # CONFIG_PACKAGE_kmod-nls-cp1250 is not set - # CONFIG_PACKAGE_kmod-nls-cp1251 is not set --# CONFIG_PACKAGE_kmod-nls-cp437 is not set -+CONFIG_PACKAGE_kmod-nls-cp437=m - # CONFIG_PACKAGE_kmod-nls-cp775 is not set - # CONFIG_PACKAGE_kmod-nls-cp850 is not set - # CONFIG_PACKAGE_kmod-nls-cp852 is not set -@@ -1647,10 +1647,10 @@ CONFIG_PACKAGE_kmod-nls-base=m - # CONFIG_PACKAGE_kmod-nls-cp864 is not set - # CONFIG_PACKAGE_kmod-nls-cp866 is not set - # CONFIG_PACKAGE_kmod-nls-cp932 is not set --# CONFIG_PACKAGE_kmod-nls-iso8859-1 is not set -+CONFIG_PACKAGE_kmod-nls-iso8859-1=m - # CONFIG_PACKAGE_kmod-nls-iso8859-13 is not set - # CONFIG_PACKAGE_kmod-nls-iso8859-15 is not set --# CONFIG_PACKAGE_kmod-nls-iso8859-2 is not set -+CONFIG_PACKAGE_kmod-nls-iso8859-2=m - # CONFIG_PACKAGE_kmod-nls-iso8859-6 is not set - # CONFIG_PACKAGE_kmod-nls-iso8859-8 is not set - # CONFIG_PACKAGE_kmod-nls-koi8r is not set -@@ -1906,8 +1906,30 @@ CONFIG_PACKAGE_kmod-usb-core=m - # CONFIG_PACKAGE_kmod-usb-ohci is not set - # CONFIG_PACKAGE_kmod-usb-ohci-pci is not set - # CONFIG_PACKAGE_kmod-usb-printer is not set --# CONFIG_PACKAGE_kmod-usb-serial is not set --# CONFIG_PACKAGE_kmod-usb-storage is not set -+CONFIG_PACKAGE_kmod-usb-serial=m -+# CONFIG_PACKAGE_kmod-usb-serial-ark3116 is not set -+# CONFIG_PACKAGE_kmod-usb-serial-belkin is not set -+CONFIG_PACKAGE_kmod-usb-serial-ch341=m -+CONFIG_PACKAGE_kmod-usb-serial-cp210x=m -+# CONFIG_PACKAGE_kmod-usb-serial-cypress-m8 is not set -+# CONFIG_PACKAGE_kmod-usb-serial-dmx_usb_module is not set -+CONFIG_PACKAGE_kmod-usb-serial-ftdi=m -+# CONFIG_PACKAGE_kmod-usb-serial-garmin is not set -+# CONFIG_PACKAGE_kmod-usb-serial-ipw is not set -+# CONFIG_PACKAGE_kmod-usb-serial-keyspan is not set -+# CONFIG_PACKAGE_kmod-usb-serial-mct is not set -+CONFIG_PACKAGE_kmod-usb-serial-mos7720=m -+CONFIG_PACKAGE_kmod-usb-serial-option=m -+# CONFIG_PACKAGE_kmod-usb-serial-oti6858 is not set -+CONFIG_PACKAGE_kmod-usb-serial-pl2303=m -+CONFIG_PACKAGE_kmod-usb-serial-qualcomm=m -+CONFIG_PACKAGE_kmod-usb-serial-sierrawireless=m -+CONFIG_PACKAGE_kmod-usb-serial-simple=m -+CONFIG_PACKAGE_kmod-usb-serial-ti-usb=m -+# CONFIG_PACKAGE_kmod-usb-serial-visor is not set -+CONFIG_PACKAGE_kmod-usb-serial-wwan=m -+# CONFIG_PACKAGE_kmod-usb-serial-xr_usb_serial_common is not set -+CONFIG_PACKAGE_kmod-usb-storage=m - # CONFIG_PACKAGE_kmod-usb-storage-extras is not set - # CONFIG_PACKAGE_kmod-usb-uhci is not set - # CONFIG_PACKAGE_kmod-usb-wdm is not set diff --git a/do-work/Edimax-v2/series b/do-work/Edimax-v2/series index 98e61ff..ba06421 100644 --- a/do-work/Edimax-v2/series +++ b/do-work/Edimax-v2/series @@ -2,5 +2,4 @@ feeds feeds-install embr6478acv2 config -regdomain endstop -- cgit v1.2.3