Skip to content

Commit db192ff

Browse files
committed
feat(wifi, build): Add Wi-Fi configs for new devices and refactor installation
Add default Wi-Fi configurations for Qihoo 360V6 and Linksys MX4X00 series devices. This provides out-of-the-box Wi-Fi support for these new hardware platforms. Refactor the installation of the `992_set-wifi-uci.sh` script by moving it from target-specific `uci-defaults` directories (qualcommax, filogic) to the general `package/base-files/files/etc/uci-defaults` path. This simplifies the build script and ensures consistent application across all targets. Introduce a new `check_default_settings` function to clone the `default-settings` package from the immortalwrt repository if it is not already present, ensuring essential default configurations are available. Adjust file permissions for `990_set_argon_primary` and `991_custom_settings` to `544`. The `install_opkg_distfeeds` function call has also been reordered in the main build process for better logical flow.
1 parent 58ee530 commit db192ff

File tree

2 files changed

+48
-15
lines changed

2 files changed

+48
-15
lines changed

patches/992_set-wifi-uci.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,17 @@ redmi_ax6_wifi_cfg() {
6464
configure_wifi 1 1 HE20 21 'Redmi_AX6' '12345678'
6565
}
6666

67+
qihoo_360v6_wifi_cfg() {
68+
configure_wifi 0 1 HE80 20 'Qihoo_360V6' '12345678'
69+
configure_wifi 1 149 HE20 20 'Qihoo_360V6_5G' '12345678'
70+
}
71+
72+
linksys_mx4x00_wifi_cfg() {
73+
configure_wifi 0 1 EHT20 22 'Linksys_MX4X00' '12345678'
74+
configure_wifi 1 149 EHT80 21 'Linksys_MX4X00_5G1' '12345678'
75+
configure_wifi 2 44 EHT80 21 'Linksys_MX4X00_5G2' '12345678'
76+
}
77+
6778
case "${board_name}" in
6879
jdcloud,ax1800-pro | \
6980
jdcloud,re-ss-01)
@@ -87,6 +98,14 @@ redmi,ax6 | \
8798
redmi,ax6-stock)
8899
redmi_ax6_wifi_cfg
89100
;;
101+
qihoo,360v6)
102+
qihoo_360v6_wifi_cfg
103+
;;
104+
linksys,mx4200v1 | \
105+
linksys,mx4200v2 | \
106+
linksys,mx4300)
107+
linksys_mx4x00_wifi_cfg
108+
;;
90109
*)
91110
exit 0
92111
;;

update.sh

Lines changed: 29 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,30 @@ install_fullconenat() {
198198
fi
199199
}
200200

201+
check_default_settings() {
202+
local settings_dir="$BUILD_DIR/package/emortal/default-settings"
203+
if [ ! -d "$settings_dir" ]; then
204+
echo "目录 $settings_dir 不存在,正在从 immortalwrt 仓库克隆..."
205+
local tmp_dir
206+
tmp_dir=$(mktemp -d)
207+
if git clone --depth 1 --filter=blob:none --sparse https://github.com/immortalwrt/immortalwrt.git "$tmp_dir"; then
208+
pushd "$tmp_dir" > /dev/null
209+
git sparse-checkout set package/emortal/default-settings
210+
# 确保目标父目录存在
211+
mkdir -p "$(dirname "$settings_dir")"
212+
# 移动 default-settings 目录
213+
mv package/emortal/default-settings "$settings_dir"
214+
popd > /dev/null
215+
rm -rf "$tmp_dir"
216+
echo "default-settings 克隆并移动成功。"
217+
else
218+
echo "错误:克隆 immortalwrt 仓库失败" >&2
219+
rm -rf "$tmp_dir"
220+
exit 1
221+
fi
222+
fi
223+
}
224+
201225
install_feeds() {
202226
./scripts/feeds update -i
203227
for dir in $BUILD_DIR/feeds/*; do
@@ -219,8 +243,9 @@ fix_default_set() {
219243
find "$BUILD_DIR/feeds/luci/collections/" -type f -name "Makefile" -exec sed -i "s/luci-theme-bootstrap/luci-theme-$THEME_SET/g" {} \;
220244
fi
221245

222-
install -Dm755 "$BASE_PATH/patches/990_set_argon_primary" "$BUILD_DIR/package/base-files/files/etc/uci-defaults/990_set_argon_primary"
223-
install -Dm755 "$BASE_PATH/patches/991_custom_settings" "$BUILD_DIR/package/base-files/files/etc/uci-defaults/991_custom_settings"
246+
install -Dm544 "$BASE_PATH/patches/990_set_argon_primary" "$BUILD_DIR/package/base-files/files/etc/uci-defaults/990_set_argon_primary"
247+
install -Dm544 "$BASE_PATH/patches/991_custom_settings" "$BUILD_DIR/package/base-files/files/etc/uci-defaults/991_custom_settings"
248+
install -Dm544 "$BASE_PATH/patches/992_set-wifi-uci.sh" "$BUILD_DIR/package/base-files/files/etc/uci-defaults/992_set-wifi-uci.sh"
224249

225250
if [ -f "$BUILD_DIR/package/emortal/autocore/files/tempinfo" ]; then
226251
if [ -f "$BASE_PATH/patches/tempinfo" ]; then
@@ -251,17 +276,6 @@ fix_mk_def_depends() {
251276
fi
252277
}
253278

254-
add_wifi_default_set() {
255-
local qualcommax_uci_dir="$BUILD_DIR/target/linux/qualcommax/base-files/etc/uci-defaults"
256-
local filogic_uci_dir="$BUILD_DIR/target/linux/mediatek/filogic/base-files/etc/uci-defaults"
257-
if [ -d "$qualcommax_uci_dir" ]; then
258-
install -Dm755 "$BASE_PATH/patches/992_set-wifi-uci.sh" "$qualcommax_uci_dir/992_set-wifi-uci.sh"
259-
fi
260-
if [ -d "$filogic_uci_dir" ]; then
261-
install -Dm755 "$BASE_PATH/patches/992_set-wifi-uci.sh" "$filogic_uci_dir/992_set-wifi-uci.sh"
262-
fi
263-
}
264-
265279
update_default_lan_addr() {
266280
local CFG_PATH="$BUILD_DIR/package/base-files/files/bin/config_generate"
267281
if [ -f $CFG_PATH ]; then
@@ -1030,7 +1044,6 @@ main() {
10301044
update_golang
10311045
change_dnsmasq2full
10321046
fix_mk_def_depends
1033-
add_wifi_default_set
10341047
update_default_lan_addr
10351048
remove_something_nss_kmod
10361049
update_affinity_script
@@ -1041,7 +1054,6 @@ main() {
10411054
add_ax6600_led
10421055
set_custom_task
10431056
apply_passwall_tweaks
1044-
install_opkg_distfeeds
10451057
update_nss_pbuf_performance
10461058
set_build_signature
10471059
update_nss_diag
@@ -1063,6 +1075,8 @@ main() {
10631075
update_uwsgi_limit_as
10641076
update_argon
10651077
update_nginx_ubus_module # 更新 nginx-mod-ubus 模块
1078+
check_default_settings
1079+
install_opkg_distfeeds
10661080
install_feeds
10671081
fix_easytier_lua
10681082
update_adguardhome

0 commit comments

Comments
 (0)