From 28e2e4d04af197a0b9522e545ca3d4e140ddb7d1 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Fri, 18 Oct 2024 15:10:00 +0800 Subject: [PATCH 1/3] autocore: fix tempinfo path --- package/lean/autocore/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/lean/autocore/Makefile b/package/lean/autocore/Makefile index 643e203e92a098..37d93b7f20d93e 100644 --- a/package/lean/autocore/Makefile +++ b/package/lean/autocore/Makefile @@ -49,7 +49,7 @@ define Package/autocore-arm/install $(INSTALL_BIN) ./files/arm/sbin/cpuinfo $(1)/sbin/cpuinfo $(INSTALL_BIN) ./files/arm/sbin/ethinfo $(1)/sbin/ethinfo $(INSTALL_BIN) ./files/arm/sbin/usage $(1)/sbin/usage - $(INSTALL_BIN) ./files/arm/tempinfo $(1)/sbin/tempinfo + $(INSTALL_BIN) ./files/arm/sbin/tempinfo $(1)/sbin/tempinfo $(INSTALL_DIR) $(1)/usr/share/rpcd/acl.d $(CP) ./files/luci-mod-status-autocore.json $(1)/usr/share/rpcd/acl.d/ endef From b9910de8d933367e5778f03f671c33a7a347c9c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=96=B5=E4=BA=8C?= <66155308+miaoermua@users.noreply.github.com> Date: Fri, 18 Oct 2024 16:44:42 +0800 Subject: [PATCH 2/3] luci-app-leigod-acc: add scheduled pause (#12404) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Leigod-Acc: Add Scheduled Pause * luci-app-leigod-acc: add scheduled pause --------- Co-authored-by: 喵二 <2860950766@qq.com> --- package/lean/leigod-acc/Makefile | 1 + .../lean/leigod-acc/files/leigod-helper.sh | 51 +++++++++++++++++++ package/lean/luci-app-leigod-acc/Makefile | 2 +- .../luasrc/controller/acc.lua | 33 +++++++++++- .../luasrc/model/cbi/leigod/service.lua | 22 ++++++++ .../luci-app-leigod-acc/po/zh-cn/leigo-acc.po | 17 ++++++- .../root/etc/config/accelerator | 4 ++ 7 files changed, 126 insertions(+), 4 deletions(-) create mode 100644 package/lean/leigod-acc/files/leigod-helper.sh diff --git a/package/lean/leigod-acc/Makefile b/package/lean/leigod-acc/Makefile index 65b57ce24fb0ad..becc1224c1f1b5 100644 --- a/package/lean/leigod-acc/Makefile +++ b/package/lean/leigod-acc/Makefile @@ -51,6 +51,7 @@ define Package/$(PKG_NAME)/install $(INSTALL_BIN) ./files/acc-gw.linux.$(acc-arch) $(1)/usr/sbin/leigod/acc-gw.linux.$(acc-arch) $(INSTALL_BIN) ./files/leigod_uninstall.sh $(1)/usr/sbin/leigod/leigod_uninstall.sh $(INSTALL_BIN) ./files/plugin_common.sh $(1)/usr/sbin/leigod/plugin_common.sh + $(INSTALL_BIN) ./files/leigod-helper.sh $(1)/usr/sbin/leigod/leigod-helper.sh $(INSTALL_BIN) ./files/update_plugin $(1)/usr/sbin/leigod/update_plugin $(INSTALL_DATA) ./files/version $(1)/usr/sbin/leigod/version endef diff --git a/package/lean/leigod-acc/files/leigod-helper.sh b/package/lean/leigod-acc/files/leigod-helper.sh new file mode 100644 index 00000000000000..1dab4ddb232b11 --- /dev/null +++ b/package/lean/leigod-acc/files/leigod-helper.sh @@ -0,0 +1,51 @@ +#!/bin/sh +# https://github.com/isecret/leigod-helper/blob/main/leigod-helper.sh + +USERNAME="${USERNAME:-phone}" +PASSWORD="${PASSWORD:-password}" + +if ! command -v "jq" > /dev/null; then + echo "缺失 jq 依赖"; + exit; +fi + +if command -v md5sum > /dev/null; then + password_hash=$(echo -n "$PASSWORD" | md5sum | awk '{print $1}') +elif command -v md5 > /dev/null; then + password_hash=$(echo -n "$PASSWORD" | md5) +else + echo "缺失 md5 或 md5sum 依赖,请手动安装" + exit 1 +fi + +login=$(curl -Lks -X POST https://webapi.leigod.com/api/auth/login \ + -H 'content-type: application/json' \ + -d "{ + \"account_token\": null, + \"country_code\": 86, + \"lang\": \"zh_CN\", + \"password\": \"$password_hash\", + \"region_code\": 1, + \"src_channel\": \"guanwang\", + \"user_type\": \"0\", + \"username\": \"$USERNAME\" + }") + +login_code=$(echo $login | jq -r ".code" 2>&1) +login_msg=$(echo $login | jq -r ".msg" 2>&1) + +if [ "$login_code" -eq 0 ]; then + account_token=$(echo $login | jq -r ".data.login_info.account_token" 2>&1) + pause=$(curl -Lks -X POST https://webapi.leigod.com/api/user/pause \ + -H 'content-type: application/json' \ + -d "{ + \"account_token\": \"$account_token\", + \"lang\": \"zh_CN\" + }") + pause_code=$(echo $pause | jq -r ".code" 2>&1) + pause_msg=$(echo $pause | jq -r ".msg" 2>&1) + + echo "暂停结果: $pause_msg" +else + echo "登录失败...原因: $login_msg" +fi diff --git a/package/lean/luci-app-leigod-acc/Makefile b/package/lean/luci-app-leigod-acc/Makefile index 1e29281fdad2c6..a586c11e4a0705 100644 --- a/package/lean/luci-app-leigod-acc/Makefile +++ b/package/lean/luci-app-leigod-acc/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk LUCI_TITLE:=Luci for Leigod Game Accelerater LUCI_PKGARCH:=all -LUCI_DEPENDS:=+libpcap +iptables +kmod-ipt-nat +iptables-mod-tproxy +kmod-ipt-tproxy +kmod-tun +kmod-netem +tc-full +kmod-ipt-ipset +ipset +curl +miniupnpd +conntrack +conntrackd +leigod-acc +LUCI_DEPENDS:=+libpcap +iptables +kmod-ipt-nat +iptables-mod-tproxy +kmod-ipt-tproxy +kmod-tun +kmod-netem +tc-full +kmod-ipt-ipset +ipset +curl +miniupnpd +conntrack +conntrackd +leigod-acc +jq PKG_VERSION:=1 PKG_RELEASE:=3 diff --git a/package/lean/luci-app-leigod-acc/luasrc/controller/acc.lua b/package/lean/luci-app-leigod-acc/luasrc/controller/acc.lua index b7c11cdd471387..6d71e89b07246d 100644 --- a/package/lean/luci-app-leigod-acc/luasrc/controller/acc.lua +++ b/package/lean/luci-app-leigod-acc/luasrc/controller/acc.lua @@ -10,6 +10,7 @@ function index() entry({ "admin", "services", "acc", "status" }, call("get_acc_status")).leaf = true entry({ "admin", "services", "acc", "start_acc_service" }, call("start_acc_service")) entry({ "admin", "services", "acc", "stop_acc_service" }, call("stop_acc_service")) + entry({ "admin", "services", "acc", "schedule_pause" }, call("schedule_pause")) end -- get_acc_status get acc status @@ -62,7 +63,7 @@ function start_acc_service() luci.http.write_json(resp) end --- start_acc_service +-- stop_acc_service function stop_acc_service() -- util module local util = require "luci.util" @@ -72,4 +73,32 @@ function stop_acc_service() resp.result = "OK" luci.http.prepare_content("application/json") luci.http.write_json(resp) -end \ No newline at end of file +end + +-- schedule_pause +function schedule_pause() + local util = require "luci.util" + local uci = require "luci.model.uci".cursor() + + local schedule_enabled = uci:get("accelerator", "system", "schedule_enabled") or "0" + local pause_time = uci:get("accelerator", "system", "pause_time") or "01:00" + local username = uci:get("accelerator", "system", "username") or "" + local password = uci:get("accelerator", "system", "password") or "" + + -- Remove existing cron jobs related to leigod-helper.sh + util.exec("sed -i '/\\/usr\\/sbin\\/leigod\\/leigod-helper.sh/d' /etc/crontabs/root") + + if schedule_enabled == "1" then + local hour, minute = pause_time:match("(%d+):(%d+)") + local cron_time = string.format("%s %s * * * USERNAME='%s' PASSWORD='%s' /usr/sbin/leigod/leigod-helper.sh", tonumber(minute), tonumber(hour), username, password) + + -- Add new cron job + local cron_command = string.format('echo "%s" >> /etc/crontabs/root', cron_time) + util.exec(cron_command) + util.exec("/etc/init.d/cron restart") + end + + local resp = { result = "OK" } + luci.http.prepare_content("application/json") + luci.http.write_json(resp) +end diff --git a/package/lean/luci-app-leigod-acc/luasrc/model/cbi/leigod/service.lua b/package/lean/luci-app-leigod-acc/luasrc/model/cbi/leigod/service.lua index d6953d772aa7a9..7a6878b30c3b79 100644 --- a/package/lean/luci-app-leigod-acc/luasrc/model/cbi/leigod/service.lua +++ b/package/lean/luci-app-leigod-acc/luasrc/model/cbi/leigod/service.lua @@ -16,6 +16,28 @@ enable.default = 0 tun = s:option(Flag,"tun" ,translate("Tunnel Mode")) tun.rmempty = false tun.default = 0 +tun.description = translate("Turning Leigod into Tunnel mode can make some proxy plugins available") + +schedule_enabled = s:option(Flag, "schedule_enabled", translate("Scheduled Pause")) +schedule_enabled.rmempty = false +schedule_enabled.default = 0 +schedule_enabled.description = translate("Enable scheduled pause for Leigod Accelerator") + +pause_time = s:option(ListValue, "pause_time", translate("Pause Time")) +pause_time:depends("schedule_enabled", 1) +for i = 0, 23 do + pause_time:value(string.format("%02d:00", i), string.format("%02d:00", i)) +end +pause_time.rmempty = true + +username = s:option(Value, "username", translate("Phone Number")) +username:depends("schedule_enabled", 1) +username.rmempty = true + +password = s:option(Value, "password", translate("Leigod Password")) +password:depends("schedule_enabled", 1) +password.password = true +password.rmempty = true m:section(SimpleSection).template = "leigod/service" diff --git a/package/lean/luci-app-leigod-acc/po/zh-cn/leigo-acc.po b/package/lean/luci-app-leigod-acc/po/zh-cn/leigo-acc.po index caeff7728b1f7e..f07de639366977 100644 --- a/package/lean/luci-app-leigod-acc/po/zh-cn/leigo-acc.po +++ b/package/lean/luci-app-leigod-acc/po/zh-cn/leigo-acc.po @@ -86,11 +86,26 @@ msgstr "未分类设备" msgid "Tunnel Mode" msgstr "TUN 模式" +msgid "Turning Leigod into Tunnel mode can make some proxy plugins available" +msgstr "将雷神加速器设为 TUN 模式可以使一些 proxy 插件可用" + +msgid "Enable scheduled pause for Leigod Accelerator" +msgstr "启用后将在预设时间执行暂停时长操作" + +msgid "Pause Time" +msgstr "设置计划定时暂停的时间" + +msgid "Phone Number" +msgstr "手机号码" + +msgid "Leigod Password" +msgstr "雷神密码" + msgid "PC_Catalog" msgstr "PC 设备" msgid "Game_Catalog" -msgstr "游戏机" +msgstr "游戏主机" msgid "VR_Catalog" msgstr "VR 设备" diff --git a/package/lean/luci-app-leigod-acc/root/etc/config/accelerator b/package/lean/luci-app-leigod-acc/root/etc/config/accelerator index 5cf62be95a175b..270c193c1d6286 100644 --- a/package/lean/luci-app-leigod-acc/root/etc/config/accelerator +++ b/package/lean/luci-app-leigod-acc/root/etc/config/accelerator @@ -5,6 +5,10 @@ config system 'base' option base_url 'https://opapi.nn.com/speed' option enabled '0' option tun '0' + option schedule_enabled '0' + option pause_time '01:00' + option username '' + option password '' config bind 'bind' From eaa043c4cf3cd6f94db2a8f8d88888286fe66bc4 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Fri, 18 Oct 2024 17:33:52 +0800 Subject: [PATCH 3/3] mediatek: Add support for GL.iNet X3000 (Spitz AX) and XE3000 (Puli AX) --- ...mt7981a-glinet-gl-x3000-xe3000-common.dtsi | 273 ++++++++++++++++++ .../mediatek/dts/mt7981a-glinet-gl-x3000.dts | 8 + .../mediatek/dts/mt7981a-glinet-gl-xe3000.dts | 23 ++ .../filogic/base-files/etc/board.d/01_leds | 11 + .../filogic/base-files/etc/board.d/02_network | 2 + .../etc/hotplug.d/ieee80211/11_fix_wifi_mac | 4 +- .../base-files/lib/upgrade/platform.sh | 4 + target/linux/mediatek/image/filogic.mk | 25 ++ 8 files changed, 349 insertions(+), 1 deletion(-) create mode 100644 target/linux/mediatek/dts/mt7981a-glinet-gl-x3000-xe3000-common.dtsi create mode 100644 target/linux/mediatek/dts/mt7981a-glinet-gl-x3000.dts create mode 100644 target/linux/mediatek/dts/mt7981a-glinet-gl-xe3000.dts diff --git a/target/linux/mediatek/dts/mt7981a-glinet-gl-x3000-xe3000-common.dtsi b/target/linux/mediatek/dts/mt7981a-glinet-gl-x3000-xe3000-common.dtsi new file mode 100644 index 00000000000000..4b311dbe21f182 --- /dev/null +++ b/target/linux/mediatek/dts/mt7981a-glinet-gl-x3000-xe3000-common.dtsi @@ -0,0 +1,273 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +/dts-v1/; + +#include "mt7981.dtsi" + +/ { + chosen { + bootargs = "console=ttyS0,115200n8 root=PARTLABEL=rootfs rootwait"; + }; + + aliases { + label-mac-device = &gmac0; + led-boot = &led_power; + led-failsafe = &led_power; + led-running = &led_power; + led-upgrade = &led_power; + }; + + reg_5v: regulator-5v { + compatible = "regulator-fixed"; + regulator-name = "fixed-5V"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + regulator-boot-on; + regulator-always-on; + }; + + fan_5v: regulator-fan-5v { + compatible = "regulator-fixed"; + regulator-name = "fan"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + gpio = <&pio 28 GPIO_ACTIVE_HIGH>; + enable-active-high; + }; + + gpio-keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + linux,code = ; + gpios = <&pio 1 GPIO_ACTIVE_LOW>; + }; + }; + + gpio-export { + compatible = "gpio-export"; + + hub_power { + gpio-export,name = "hub_power"; + gpio-export,output = <1>; + gpios = <&pio 5 GPIO_ACTIVE_HIGH>; + }; + + 5G_power { + gpio-export,name = "5G_power"; + gpio-export,output = <1>; + gpios = <&pio 11 GPIO_ACTIVE_HIGH>; + }; + + 5G_control { + gpio-export,name = "5G_control"; + gpio-export,output = <1>; + gpios = <&pio 9 GPIO_ACTIVE_HIGH>; + }; + + 5G_reset { + gpio-export,name = "5G_reset"; + gpio-export,output = <0>; + gpios = <&pio 10 GPIO_ACTIVE_HIGH>; + }; + }; + + leds { + compatible = "gpio-leds"; + + wifi2g { + label = "green:wifi2g"; + gpios = <&pio 30 GPIO_ACTIVE_LOW>; + }; + + wifi5g { + label = "green:wifi5g"; + gpios = <&pio 38 GPIO_ACTIVE_LOW>; + }; + + 5g_led1 { + label = "green:5g:led1"; + gpios = <&pio 6 GPIO_ACTIVE_LOW>; + }; + + 5g_led2 { + label = "green:5g:led2"; + gpios = <&pio 7 GPIO_ACTIVE_LOW>; + }; + + 5g_led3 { + label = "green:5g:led3"; + gpios = <&pio 8 GPIO_ACTIVE_LOW>; + }; + + 5g_led4 { + label = "green:5g:led4"; + gpios = <&pio 4 GPIO_ACTIVE_HIGH>; + }; + + led_power: power { + label = "green:power"; + gpios = <&pio 39 GPIO_ACTIVE_LOW>; + }; + + wan { + label = "green:wan"; + gpios = <&pio 31 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&uart0 { + status = "okay"; +}; + +&watchdog { + status = "okay"; +}; + +&mmc0 { + pinctrl-names = "default", "state_uhs"; + pinctrl-0 = <&mmc0_pins_default>; + pinctrl-1 = <&mmc0_pins_uhs>; + bus-width = <8>; + max-frequency = <52000000>; + cap-mmc-highspeed; + vmmc-supply = <®_3p3v>; + non-removable; + status = "okay"; + + card@0 { + compatible = "mmc-card"; + reg = <0>; + + block { + compatible = "block-device"; + partitions { + block-partition-env { + partname = "u-boot-env"; + + nvmem-layout { + compatible = "u-boot,env-layout"; + }; + }; + + block-partition-factory { + partname = "factory"; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x1000>; + }; + + macaddr_factory_a: macaddr@a { + compatible = "mac-base"; + reg = <0xa 0x6>; + #nvmem-cell-cells = <1>; + }; + }; + }; + }; + }; + }; +}; + +&mdio_bus { + reset-gpios = <&pio 14 GPIO_ACTIVE_LOW>; + reset-delay-us = <600>; + reset-post-delay-us = <20000>; + + phy5: ethernet-phy@5 { + reg = <5>; + compatible = "ethernet-phy-ieee802.3-c45"; + }; +}; + +ð { + status = "okay"; + + gmac0: mac@0 { + compatible = "mediatek,eth-mac"; + reg = <0>; + phy-mode = "2500base-x"; + phy-handle = <&phy5>; + nvmem-cells = <&macaddr_factory_a 0>; + nvmem-cell-names = "mac-address"; + }; + + gmac1: mac@1 { + compatible = "mediatek,eth-mac"; + reg = <1>; + phy-mode = "gmii"; + phy-handle = <&int_gbe_phy>; + nvmem-cells = <&macaddr_factory_a 1>; + nvmem-cell-names = "mac-address"; + }; +}; + +&pio { + mmc0_pins_default: mmc0-pins-default { + mux { + function = "flash"; + groups = "emmc_8"; + }; + }; + mmc0_pins_uhs: mmc0-pins-uhs { + mux { + function = "flash"; + groups = "emmc_8"; + }; + }; + pcie_pins: pcie-pins { + mux { + function = "pcie"; + groups = "pcie_pereset", "pcie_clk", "pcie_wake"; + }; + }; + pwm0_pin: pwm0-pin-g0 { + mux { + function = "pwm"; + groups = "pwm0_1"; + }; + }; +}; + +&xhci { + phys = <&u2port0 PHY_TYPE_USB2>; + vbus-supply = <®_5v>; + mediatek,u3p-dis-msk = <0x01>; + status = "okay"; +}; + +&usb_phy { + status = "okay"; +}; + +&pcie { + pinctrl-names = "default"; + pinctrl-0 = <&pcie_pins>; + status = "okay"; +}; + +&pwm { + pinctrl-names = "default"; + pinctrl-0 = <&pwm0_pin>; +}; + +&wifi { + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; + status = "okay"; +}; + +&fan { + pwms = <&pwm 0 40000 0>; + fan-supply = <&fan_5v>; + interrupt-parent = <&pio>; + interrupts = <29 IRQ_TYPE_EDGE_RISING>; + status = "okay"; +}; diff --git a/target/linux/mediatek/dts/mt7981a-glinet-gl-x3000.dts b/target/linux/mediatek/dts/mt7981a-glinet-gl-x3000.dts new file mode 100644 index 00000000000000..bee1ecd89a934e --- /dev/null +++ b/target/linux/mediatek/dts/mt7981a-glinet-gl-x3000.dts @@ -0,0 +1,8 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "mt7981a-glinet-gl-x3000-xe3000-common.dtsi" + +/ { + model = "GL.iNet GL-X3000"; + compatible = "glinet,gl-x3000", "mediatek,mt7981"; +}; diff --git a/target/linux/mediatek/dts/mt7981a-glinet-gl-xe3000.dts b/target/linux/mediatek/dts/mt7981a-glinet-gl-xe3000.dts new file mode 100644 index 00000000000000..e14b944bc9726b --- /dev/null +++ b/target/linux/mediatek/dts/mt7981a-glinet-gl-xe3000.dts @@ -0,0 +1,23 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "mt7981a-glinet-gl-x3000-xe3000-common.dtsi" + +/ { + model = "GL.iNet GL-XE3000"; + compatible = "glinet,gl-xe3000", "mediatek,mt7981"; +}; + +&uart1 { + pinctrl-names = "default"; + pinctrl-0 = <&uart1_pins>; + status = "okay"; +}; + +&pio { + uart1_pins: uart1-pins-g1 { + mux { + function = "uart"; + groups = "uart1_3"; + }; + }; +}; diff --git a/target/linux/mediatek/filogic/base-files/etc/board.d/01_leds b/target/linux/mediatek/filogic/base-files/etc/board.d/01_leds index 4a28a92c0e8f31..38a3e8c2679d3f 100644 --- a/target/linux/mediatek/filogic/base-files/etc/board.d/01_leds +++ b/target/linux/mediatek/filogic/base-files/etc/board.d/01_leds @@ -23,6 +23,17 @@ hf,m7986r1*) ucidef_set_led_netdev "led-4" "LAN4" "led-4" "lan4" ucidef_set_led_netdev "led-5" "WWAN" "led-5" "usb0" ;; +glinet,gl-x3000|\ +glinet,gl-xe3000) + ucidef_set_led_default "power" "POWER" "green:power" "1" + ucidef_set_led_netdev "wan" "WAN" "green:wan" "eth0" + ucidef_set_led_netdev "5g_1" "5G_1" "green:5g:led1" "wwan0" + ucidef_set_led_netdev "5g_2" "5G_2" "green:5g:led2" "wwan0" + ucidef_set_led_netdev "5g_3" "5G_3" "green:5g:led3" "wwan0" + ucidef_set_led_netdev "5g_4" "5G_4" "green:5g:led4" "wwan0" + ucidef_set_led_netdev "wlan2g" "WLAN2G" "green:wifi2g" "phy0-ap0" + ucidef_set_led_netdev "wlan5g" "WLAN5G" "green:wifi5g" "phy1-ap0" + ;; imou,lc-hx3001|\ nokia,ea0326gmp) ucidef_set_led_netdev "lan" "LAN" "green:lan" "br-lan" diff --git a/target/linux/mediatek/filogic/base-files/etc/board.d/02_network b/target/linux/mediatek/filogic/base-files/etc/board.d/02_network index 8359400cbb8f11..71324b5488a4b0 100644 --- a/target/linux/mediatek/filogic/base-files/etc/board.d/02_network +++ b/target/linux/mediatek/filogic/base-files/etc/board.d/02_network @@ -36,6 +36,8 @@ mediatek_setup_interfaces() ;; glinet,gl-mt2500|\ glinet,gl-mt3000|\ + glinet,gl-x3000|\ + glinet,gl-xe3000|\ openembed,som7981) ucidef_set_interfaces_lan_wan eth1 eth0 ;; diff --git a/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac b/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac index 8b26a1748d23de..0757ec15b6d66c 100644 --- a/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac +++ b/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac @@ -41,7 +41,9 @@ case "$board" in [ "$PHYNBR" = "0" ] && macaddr_add $addr 1 > /sys${DEVPATH}/macaddress [ "$PHYNBR" = "1" ] && macaddr_setbit_la $(macaddr_add $addr 2) > /sys${DEVPATH}/macaddress ;; - glinet,gl-mt6000) + glinet,gl-mt6000|\ + glinet,gl-x3000|\ + glinet,gl-xe3000) addr=$(mmc_get_mac_binary factory 0x04) [ "$PHYNBR" = "0" ] && echo "$addr" > /sys${DEVPATH}/macaddress [ "$PHYNBR" = "1" ] && macaddr_add $addr 1 > /sys${DEVPATH}/macaddress diff --git a/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh b/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh index ebbb27327717fe..1af0d73eb94a10 100755 --- a/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh +++ b/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh @@ -45,6 +45,8 @@ platform_do_upgrade() { cmcc,rax3000m-emmc|\ glinet,gl-mt2500|\ glinet,gl-mt6000|\ + glinet,gl-x3000|\ + glinet,gl-xe3000|\ hf,m7986r1-emmc|\ jdcloud,re-cs-05) CI_KERNPART="kernel" @@ -98,6 +100,8 @@ platform_copy_config() { cmcc,rax3000m-emmc|\ glinet,gl-mt2500|\ glinet,gl-mt6000|\ + glinet,gl-x3000|\ + glinet,gl-xe3000|\ hf,m7986r1-emmc|\ jdcloud,re-cs-05) emmc_copy_config diff --git a/target/linux/mediatek/image/filogic.mk b/target/linux/mediatek/image/filogic.mk index ea0ce96b5e0a2d..4abef8d0461f6e 100644 --- a/target/linux/mediatek/image/filogic.mk +++ b/target/linux/mediatek/image/filogic.mk @@ -324,6 +324,31 @@ define Device/glinet_gl-mt6000 endef TARGET_DEVICES += glinet_gl-mt6000 +define Device/glinet_gl-x3000-xe3000-common + DEVICE_VENDOR := GL.iNet + DEVICE_DTS_DIR := ../dts + DEVICE_PACKAGES := kmod-mt7981-firmware mt7981-wo-firmware mkf2fs \ + kmod-fs-f2fs kmod-hwmon-pwmfan kmod-usb3 kmod-usb-serial-option \ + kmod-usb-storage kmod-usb-net-qmi-wwan uqmi + IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata +endef + +define Device/glinet_gl-x3000 + DEVICE_MODEL := GL-X3000 + DEVICE_DTS := mt7981a-glinet-gl-x3000 + SUPPORTED_DEVICES := glinet,gl-x3000 + $(call Device/glinet_gl-x3000-xe3000-common) +endef +TARGET_DEVICES += glinet_gl-x3000 + +define Device/glinet_gl-xe3000 + DEVICE_MODEL := GL-XE3000 + DEVICE_DTS := mt7981a-glinet-gl-xe3000 + SUPPORTED_DEVICES := glinet,gl-xe3000 + $(call Device/glinet_gl-x3000-xe3000-common) +endef +TARGET_DEVICES += glinet_gl-xe3000 + define Device/h3c_magic-nx30-pro DEVICE_VENDOR := H3C DEVICE_MODEL := Magic NX30 Pro