kiddin9 3 years ago
parent
commit
e5cfe647c9

+ 1 - 1
.github/workflows/Openwrt-AutoBuild.yml

@@ -71,7 +71,7 @@ jobs:
         if [ ${{matrix.target}} == "x86_64" ]; then
         if [ ${{matrix.target}} == "x86_64" ]; then
             echo "ARCH=linux/amd64" >> $GITHUB_ENV
             echo "ARCH=linux/amd64" >> $GITHUB_ENV
             echo "MTARGET=x86_64" >> $GITHUB_ENV
             echo "MTARGET=x86_64" >> $GITHUB_ENV
-        elif [[ ${{matrix.target}} =~ (armvirt_64|ipq807x|mediatek_mt7622|bcm27xx_bcm2710|ipq60xx_generic|bcm4908_generic|sunxi_cortexa53) ]]; then
+        elif [[ ${{matrix.target}} =~ (armvirt_64|ipq807x|mediatek_mt7622|mediatek_filogic|bcm27xx_bcm2710|ipq60xx_generic|bcm4908_generic|sunxi_cortexa53) ]]; then
             echo "MTARGET=aarch64_cortex-a53" >> $GITHUB_ENV
             echo "MTARGET=aarch64_cortex-a53" >> $GITHUB_ENV
         elif [[ ${{matrix.target}} =~ (ramips_mt7621|ramips_mt7620|ramips_mt76x8) ]]; then
         elif [[ ${{matrix.target}} =~ (ramips_mt7621|ramips_mt7620|ramips_mt76x8) ]]; then
             echo "MTARGET=mipsel_24kc" >> $GITHUB_ENV
             echo "MTARGET=mipsel_24kc" >> $GITHUB_ENV

+ 5 - 0
.github/workflows/repo-dispatcher.yml

@@ -95,6 +95,11 @@ jobs:
           -X POST https://api.github.com/repos/${{ github.repository }}/dispatches \
           -X POST https://api.github.com/repos/${{ github.repository }}/dispatches \
           -H "Accept: application/vnd.github.everest-preview+json" \
           -H "Accept: application/vnd.github.everest-preview+json" \
           -H "Authorization: token ${{ secrets.REPO_TOKEN }}" \
           -H "Authorization: token ${{ secrets.REPO_TOKEN }}" \
+          -d '{"event_type": "mediatek_filogic", "client_payload": {"target": "mediatek_filogic"}}'
+          curl \
+          -X POST https://api.github.com/repos/${{ github.repository }}/dispatches \
+          -H "Accept: application/vnd.github.everest-preview+json" \
+          -H "Authorization: token ${{ secrets.REPO_TOKEN }}" \
           -d '{"event_type": "ramips_mt7621", "client_payload": {"target": "ramips_mt7621"}}'
           -d '{"event_type": "ramips_mt7621", "client_payload": {"target": "ramips_mt7621"}}'
           curl \
           curl \
           -X POST https://api.github.com/repos/${{ github.repository }}/dispatches \
           -X POST https://api.github.com/repos/${{ github.repository }}/dispatches \

+ 33 - 33
devices/common/patches/iptables.patch

@@ -1,34 +1,34 @@
---- a/package/network/utils/iptables/Makefile
-+++ b/package/network/utils/iptables/Makefile
-@@ -111,7 +111,6 @@ define Package/arptables-nft
- $(call Package/iptables/Default)
-   DEPENDS:=+kmod-nft-arp +xtables-nft +kmod-arptables
-   TITLE:=ARP firewall administration tool nft
--  PROVIDES:=arptables
-   ALTERNATIVES:=\
-     300:/usr/sbin/arptables:/usr/sbin/xtables-nft-multi \
-     300:/usr/sbin/arptables-restore:/usr/sbin/xtables-nft-multi \
-@@ -122,7 +121,6 @@ define Package/ebtables-nft
- $(call Package/iptables/Default)
-   DEPENDS:=+kmod-nft-bridge +xtables-nft +kmod-ebtables
-   TITLE:=Bridge firewall administration tool nft
--  PROVIDES:=ebtables
-   ALTERNATIVES:=\
-     300:/usr/sbin/ebtables:/usr/sbin/xtables-nft-multi \
-     300:/usr/sbin/ebtables-restore:/usr/sbin/xtables-nft-multi \
-@@ -133,7 +131,6 @@ define Package/iptables-nft
- $(call Package/iptables/Default)
-   TITLE:=IP firewall administration tool nft
-   DEPENDS:=+kmod-ipt-core +xtables-nft
--  PROVIDES:=iptables
-   ALTERNATIVES:=\
-     300:/usr/sbin/iptables:/usr/sbin/xtables-nft-multi \
-     300:/usr/sbin/iptables-restore:/usr/sbin/xtables-nft-multi \
-@@ -486,7 +483,6 @@ define Package/ip6tables-nft
- $(call Package/iptables/Default)
-   DEPENDS:=@IPV6 +kmod-ip6tables +xtables-nft
-   TITLE:=IP firewall administration tool nft
--  PROVIDES:=ip6tables
-   ALTERNATIVES:=\
-     300:/usr/sbin/ip6tables:/usr/sbin/xtables-nft-multi \
+--- a/package/network/utils/iptables/Makefile
++++ b/package/network/utils/iptables/Makefile
+@@ -111,7 +111,6 @@ define Package/arptables-nft
+ $(call Package/iptables/Default)
+   DEPENDS:=+kmod-nft-arp +xtables-nft +kmod-arptables
+   TITLE:=ARP firewall administration tool nft
+-  PROVIDES:=arptables
+   ALTERNATIVES:=\
+     300:/usr/sbin/arptables:/usr/sbin/xtables-nft-multi \
+     300:/usr/sbin/arptables-restore:/usr/sbin/xtables-nft-multi \
+@@ -122,7 +121,6 @@ define Package/ebtables-nft
+ $(call Package/iptables/Default)
+   DEPENDS:=+kmod-nft-bridge +xtables-nft +kmod-ebtables
+   TITLE:=Bridge firewall administration tool nft
+-  PROVIDES:=ebtables
+   ALTERNATIVES:=\
+     300:/usr/sbin/ebtables:/usr/sbin/xtables-nft-multi \
+     300:/usr/sbin/ebtables-restore:/usr/sbin/xtables-nft-multi \
+@@ -133,7 +131,6 @@ define Package/iptables-nft
+ $(call Package/iptables/Default)
+   TITLE:=IP firewall administration tool nft
+   DEPENDS:=+kmod-ipt-core +xtables-nft
+-  PROVIDES:=iptables
+   ALTERNATIVES:=\
+     300:/usr/sbin/iptables:/usr/sbin/xtables-nft-multi \
+     300:/usr/sbin/iptables-restore:/usr/sbin/xtables-nft-multi \
+@@ -486,7 +483,6 @@ define Package/ip6tables-nft
+ $(call Package/iptables/Default)
+   DEPENDS:=@IPV6 +kmod-ip6tables +xtables-nft
+   TITLE:=IP firewall administration tool nft
+-  PROVIDES:=ip6tables
+   ALTERNATIVES:=\
+     300:/usr/sbin/ip6tables:/usr/sbin/xtables-nft-multi \
      300:/usr/sbin/ip6tables-restore:/usr/sbin/xtables-nft-multi \
      300:/usr/sbin/ip6tables-restore:/usr/sbin/xtables-nft-multi \

+ 52 - 0
devices/common/patches/luci_mk.patch

@@ -0,0 +1,52 @@
+--- a/feeds/luci/luci.mk
++++ b/feeds/luci/luci.mk
+@@ -82,7 +82,7 @@ define findrev
+       set -- $$(git log -1 --format="%ct %h" --abbrev=7 -- $(if $(1),. ':(exclude)po',po)); \
+       if [ -n "$$1" ]; then
+         secs="$$(($$1 % 86400))"; \
+-        yday="$$(date --utc --date="@$$1" "+%y.%j")"; \
++        yday="$$(date --utc --date="@$$(($$1 + 365*24*60*60))" "+%y.%j")"; \
+         printf 'git-%s.%05d-%s' "$$yday" "$$secs" "$$2"; \
+       else \
+         echo "unknown"; \
+@@ -206,9 +206,14 @@ define Package/$(PKG_NAME)/install
+ 	  $(call Build/Install/Default) \
+ 	  $(CP) $(PKG_INSTALL_DIR)/* $(1)/; \
+ 	else true; fi
++	$(INSTALL_DIR) $(1)$(LUCI_LIBRARYDIR)/i18n
++	$(foreach po,$(wildcard ${CURDIR}/po/zh_Hans/*.po), \
++		po2lmo $(po) \
++		$(1)$(LUCI_LIBRARYDIR)/i18n/$(basename $(notdir $(po))).zh-cn.lmo;)
+ endef
+ 
+ ifndef Package/$(PKG_NAME)/postinst
++ifneq ($(wildcard ${CURDIR}/htdocs/luci-static/resources/view),)
+ define Package/$(PKG_NAME)/postinst
+ [ -n "$${IPKG_INSTROOT}" ] || { \
+ 	rm -f /tmp/luci-indexcache
+@@ -217,7 +222,18 @@ define Package/$(PKG_NAME)/postinst
+ 	exit 0
+ }
+ endef
++else
++define Package/$(PKG_NAME)/postinst
++[ -n "$${IPKG_INSTROOT}" ] || {$(foreach script,$(LUCI_DEFAULTS),
++	(. /etc/uci-defaults/$(script)) && rm -f /etc/uci-defaults/$(script))
++	rm -f /tmp/luci-indexcache
++	rm -rf /tmp/luci-modulecache/
++	exit 0
++}
++endef
+ endif
++endif
++
+ 
+ # some generic macros that can be used by all packages
+ ifeq ($(LUCI_MINIFY_JS),1)
+@@ -333,5 +349,5 @@ define LuciTranslation
+ 
+ endef
+ 
+-$(foreach lang,$(LUCI_LANGUAGES),$(if $(LUCI_LANG.$(lang)),$(eval $(call LuciTranslation,$(firstword $(LUCI_LC_ALIAS.$(lang)) $(lang)),$(lang)))))
++# $(foreach lang,$(LUCI_LANGUAGES),$(if $(LUCI_LANG.$(lang)),$(eval $(call LuciTranslation,$(firstword $(LUCI_LC_ALIAS.$(lang)) $(lang)),$(lang)))))
+ $(foreach pkg,$(LUCI_BUILD_PACKAGES),$(eval $(call BuildPackage,$(pkg))))

+ 0 - 13
devices/common/patches/zh-cn.patch

@@ -1,13 +0,0 @@
---- a/feeds/luci/luci.mk
-+++ b/feeds/luci/luci.mk
-@@ -206,6 +206,10 @@ define Package/$(PKG_NAME)/install
- 	  $(call Build/Install/Default) \
- 	  $(CP) $(PKG_INSTALL_DIR)/* $(1)/; \
- 	else true; fi
-+	$(INSTALL_DIR) $(1)$(LUCI_LIBRARYDIR)/i18n
-+	$(foreach po,$(wildcard ${CURDIR}/po/zh_Hans/*.po), \
-+		po2lmo $(po) \
-+		$(1)$(LUCI_LIBRARYDIR)/i18n/$(basename $(notdir $(po))).zh-cn.lmo;)
- endef
- 
- ifndef Package/$(PKG_NAME)/postinst

+ 7 - 0
devices/mediatek_filogic/.config

@@ -0,0 +1,7 @@
+
+CONFIG_TARGET_mediatek=y
+CONFIG_TARGET_mediatek_filogic=y
+CONFIG_TARGET_MULTI_PROFILE=y
+CONFIG_TARGET_DEVICE_mediatek_filogic_DEVICE_xiaomi_redmi-router-ax6000=y
+
+CONFIG_PACKAGE_luci-ssl=y # uhttpd服务

+ 8 - 0
devices/mediatek_filogic/diy.sh

@@ -0,0 +1,8 @@
+#!/bin/bash
+
+shopt -s extglob
+
+SHELL_FOLDER=$(dirname $(readlink -f "$0"))
+bash $SHELL_FOLDER/../common/kernel_5.15.sh
+
+curl -sfL https://github.com/coolsnowwolf/lede/raw/master/target/linux/mediatek/dts/mt7986a-xiaomi-redmi-router-ax6000.dts -o target/linux/mediatek/dts/mt7986a-xiaomi-redmi-router-ax6000.dts

+ 63 - 0
devices/mediatek_filogic/patches/redmi-ax6000.patch

@@ -0,0 +1,63 @@
+--- a/target/linux/mediatek/filogic/base-files/etc/board.d/02_network
++++ b/target/linux/mediatek/filogic/base-files/etc/board.d/02_network
+@@ -16,15 +16,38 @@ mediatek_setup_interfaces()
+ 		ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4 sfp2" "eth1 wan"
+ 		ucidef_set_interface_macaddr "wan" "$(macaddr_add $(cat /sys/class/net/eth0/address) 1)"
+ 		;;
++	xiaomi,redmi-router-ax6000)
++		ucidef_set_interfaces_lan_wan "lan1 lan2 lan3" wan
++		;;
+ 	*)
+ 		ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" wan
+ 		;;
+ 	esac
+ }
+ 
++mediatek_setup_macs()
++{
++	local board="$1"
++	local lan_mac=""
++	local wan_mac=""
++	local label_mac=""
++
++	case $board in
++	xiaomi,redmi-router-ax6000)
++		wan_mac=$(mtd_get_mac_ascii Bdata ethaddr_wan)
++		label_mac=$wan_mac
++		;;
++	esac
++
++	[ -n "$lan_mac" ] && ucidef_set_interface_macaddr "lan" $lan_mac
++	[ -n "$wan_mac" ] && ucidef_set_interface_macaddr "wan" $wan_mac
++	[ -n "$label_mac" ] && ucidef_set_label_macaddr $label_mac
++}
++
+ board_config_update
+ board=$(board_name)
+ mediatek_setup_interfaces $board
++mediatek_setup_macs $board
+ board_config_flush
+ 
+ exit 0
+
+--- a/target/linux/mediatek/image/filogic.mk
++++ b/target/linux/mediatek/image/filogic.mk
+@@ -125,3 +125,18 @@ define Device/mediatek_mt7986b-rfb
+   IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
+ endef
+ TARGET_DEVICES += mediatek_mt7986b-rfb
++
++define Device/xiaomi_redmi-router-ax6000
++  DEVICE_VENDOR := Xiaomi
++  DEVICE_MODEL := Redmi Router AX6000
++  DEVICE_DTS := mt7986a-xiaomi-redmi-router-ax6000
++  DEVICE_DTS_DIR := ../dts
++  KERNEL_LOADADDR := 0x48000000
++  UBINIZE_OPTS := -E 5
++  BLOCKSIZE := 128k
++  PAGESIZE := 2048
++  KERNEL_IN_UBI := 1
++  KERNEL_SIZE := 4096k
++  IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
++endef
++TARGET_DEVICES += xiaomi_redmi-router-ax6000

+ 2 - 0
devices/rockchip_armv8/diy.sh

@@ -20,6 +20,8 @@ sed -i "s/#TARGET_DEVICES += hinlink_opc-h68k/TARGET_DEVICES += hinlink_opc-h68k
 
 
 mv -f tmp/r8125 feeds/kiddin9/
 mv -f tmp/r8125 feeds/kiddin9/
 
 
+rm -rf target/linux/rockchip/armv8/base-files/etc/uci-defaults/13_opkg_update
+
 sed -i -e 's,kmod-r8168,kmod-r8169,g' target/linux/rockchip/image/armv8.mk
 sed -i -e 's,kmod-r8168,kmod-r8169,g' target/linux/rockchip/image/armv8.mk
 
 
 sed -i 's/DEFAULT_PACKAGES +=/DEFAULT_PACKAGES += fdisk lsblk kmod-drm-rockchip kmod-gpu-lima/' target/linux/rockchip/Makefile
 sed -i 's/DEFAULT_PACKAGES +=/DEFAULT_PACKAGES += fdisk lsblk kmod-drm-rockchip kmod-gpu-lima/' target/linux/rockchip/Makefile

+ 0 - 58
devices/rockchip_armv8/patches/fix.patch

@@ -1,58 +0,0 @@
---- a/target/linux/rockchip/armv8/base-files/etc/board.d/01_leds
-+++ b/target/linux/rockchip/armv8/base-files/etc/board.d/01_leds
-@@ -17,7 +17,6 @@ xunlong,orangepi-r1-plus-lts)
- 	ucidef_set_led_netdev "lan" "LAN" "$boardname:green:lan" "eth1"
- 	;;
- friendlyarm,nanopi-r4s|\
--friendlyarm,nanopi-r4se|\
- sharevdi,guangmiao-g4c)
- 	ucidef_set_led_netdev "wan" "WAN" "green:wan" "eth0"
- 	ucidef_set_led_netdev "lan" "LAN" "green:lan" "eth1"
-@@ -25,10 +24,14 @@ sharevdi,guangmiao-g4c)
- firefly,rk3568-roc-pc)
- 	ucidef_set_led_timer "health" "health" "firefly:yellow:user" "200" "800"
- 	;;
-+friendlyarm,nanopi-r4se)
-+	ucidef_set_led_netdev "wan" "WAN" "wan_led" "eth0"
-+	ucidef_set_led_netdev "lan" "LAN" "lan_led" "eth1"
-+	;;
- friendlyarm,nanopi-r5s)
--	ucidef_set_led_netdev "wan" "WAN" "green:wan" "eth0"
--	ucidef_set_led_netdev "lan1" "LAN1" "green:lan1" "eth1"
--	ucidef_set_led_netdev "lan2" "LAN2" "green:lan2" "eth2"
-+	ucidef_set_led_netdev "wan" "WAN" "wan_led" "eth0" "link"
-+	ucidef_set_led_netdev "lan1" "LAN1" "lan1_led" "eth1" "link"
-+	ucidef_set_led_netdev "lan2" "LAN2" "lan2_led" "eth2" "link"
- 	;;
- hinlink,opc-h68k)
- 	ucidef_set_led_netdev "wan" "WAN" "blue:net" "eth0"
-
---- a/target/linux/rockchip/image/Makefile
-+++ b/target/linux/rockchip/image/Makefile
-@@ -75,4 +75,26 @@ endef
- 
- include $(SUBTARGET).mk
- 
-+define Image/Build
-+	if [ $(PROFILE_SANITIZED) == "friendlyarm_nanopi-r5s" ]; then \
-+		export IMG_PREFIX="$(IMG_PREFIX)$(if $(PROFILE_SANITIZED),-$(PROFILE_SANITIZED))"; \
-+		export BIN_DIR=$(BIN_DIR); \
-+		export TOPDIR=$(TOPDIR); \
-+		cd /www/wwwroot/op.supes.top/bcache/rockchip/armv8/r5s_packit; \
-+		. ../modify_packit.sh; \
-+		./build.sh sd-img; \
-+		[ "$(MORE)" == "eflasher" ] && ./build.sh emmc-img; \
-+		rm -rf $(BIN_DIR)/*r5s-squashfs-sysupgrade.img.gz $(BIN_DIR)/images-for-eflasher; \
-+	elif [ $(PROFILE_SANITIZED) == "friendlyarm_nanopi-r4se" ]; then \
-+		export IMG_PREFIX="$(IMG_PREFIX)$(if $(PROFILE_SANITIZED),-$(PROFILE_SANITIZED))"; \
-+		export BIN_DIR=$(BIN_DIR); \
-+		export TOPDIR=$(TOPDIR); \
-+		cd /www/wwwroot/op.supes.top/bcache/rockchip/armv8/r4se_packit; \
-+		. ../modify_packit.sh; \
-+		./build.sh sd-img; \
-+		[ "$(MORE)" == "eflasher" ] && ./build.sh emmc-img; \
-+		rm -rf $(BIN_DIR)/*r4se-squashfs-sysupgrade.img.gz $(BIN_DIR)/images-for-eflasher; \
-+	fi
-+endef
-+
- $(eval $(call BuildImage))