Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
mgqnfoqv7k2w
AutoBuildImmortalWrt
Commits
edeca3ec
"...git@developer.sourcefind.cn:yaoyuping/nndetection.git" did not exist on "7246044d8824f7b3f6c243db054b61420212ad05"
Unverified
Commit
edeca3ec
authored
Aug 14, 2025
by
wukongdaily
Committed by
GitHub
Aug 14, 2025
Browse files
24.10 x86 新增在UI上设置路由器管理地址
parent
02701e19
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
51 additions
and
29 deletions
+51
-29
.github/workflows/build-x86-64-24.10.2.yml
.github/workflows/build-x86-64-24.10.2.yml
+38
-22
files/etc/uci-defaults/99-custom.sh
files/etc/uci-defaults/99-custom.sh
+12
-7
glinet/99-custom.sh
glinet/99-custom.sh
+1
-0
No files found.
.github/workflows/build-x86-64-24.10.2.yml
View file @
edeca3ec
...
@@ -3,6 +3,10 @@ name: build-x86-64-immortalwrt-24.10.2
...
@@ -3,6 +3,10 @@ name: build-x86-64-immortalwrt-24.10.2
on
:
on
:
workflow_dispatch
:
workflow_dispatch
:
inputs
:
inputs
:
custom_router_ip
:
description
:
"
请设置路由器的管理地址(仅对多网口路由器有效)
格式:192.168.x.1
或
10.x.x.1"
required
:
true
default
:
"
192.168.100.1"
profile
:
profile
:
description
:
'
请输入要编译固件大小
单位(MB)'
description
:
'
请输入要编译固件大小
单位(MB)'
required
:
true
required
:
true
...
@@ -42,7 +46,13 @@ jobs:
...
@@ -42,7 +46,13 @@ jobs:
-
name
:
Set executable permissions
-
name
:
Set executable permissions
run
:
chmod +x ${{ github.workspace }}/x86-64/build24.sh
run
:
chmod +x ${{ github.workspace }}/x86-64/build24.sh
-
name
:
Save Custom Router IP into OpenWrt files
run
:
|
mkdir -p "${{ github.workspace }}/custom"
echo "${{ github.event.inputs.custom_router_ip }}" > "${{ github.workspace }}/custom/custom_router_ip.txt"
echo "您设置的路由器管理地址是:${{ github.event.inputs.custom_router_ip }}"
# 后续步骤会将该文件映射到路由器/etc/config/custom_router_ip.txt 以便用于开机脚本99-custom.sh读取用户设置的ip
-
name
:
Validate PPPoE Inputs
-
name
:
Validate PPPoE Inputs
run
:
|
run
:
|
if [[ "${{ inputs.enable_pppoe }}" == "yes" ]]; then
if [[ "${{ inputs.enable_pppoe }}" == "yes" ]]; then
...
@@ -54,42 +64,48 @@ jobs:
...
@@ -54,42 +64,48 @@ jobs:
-
name
:
Build ImmortalWrt-x86-64-efi
-
name
:
Build ImmortalWrt-x86-64-efi
run
:
|
run
:
|
profile
s
="${{ github.event.inputs.profile }}"
profile="${{ github.event.inputs.profile }}"
include_docker="${{ github.event.inputs.include_docker }}"
include_docker="${{ github.event.inputs.include_docker }}"
IFS=',' read -r -a profile_array <<< "$profiles"
echo "Building for profile: $profile"
docker run --rm -i \
--user root \
-v "${{ github.workspace }}/bin:/home/build/immortalwrt/bin" \
-v "${{ github.workspace }}/files:/home/build/immortalwrt/files" \
-v "${{ github.workspace }}/custom:/home/build/immortalwrt/files/etc/config" \
-v "${{ github.workspace }}/x86-64/imm.config:/home/build/immortalwrt/.config" \
-v "${{ github.workspace }}/shell:/home/build/immortalwrt/shell" \
-v "${{ github.workspace }}/x86-64/build24.sh:/home/build/immortalwrt/build.sh" \
-e PROFILE=$profile \
-e INCLUDE_DOCKER=$include_docker \
-e ENABLE_PPPOE=${{ inputs.enable_pppoe }} \
-e PPPOE_ACCOUNT=${{ inputs.pppoe_account }} \
-e PPPOE_PASSWORD=${{ inputs.pppoe_password }} \
immortalwrt/imagebuilder:x86-64-openwrt-24.10.2 /bin/bash /home/build/immortalwrt/build.sh
for profile in "${profile_array[@]}"; do
echo "Building for profile: $profile"
docker run --rm -i \
--user root \
-v "${{ github.workspace }}/bin:/home/build/immortalwrt/bin" \
-v "${{ github.workspace }}/files:/home/build/immortalwrt/files" \
-v "${{ github.workspace }}/x86-64/imm.config:/home/build/immortalwrt/.config" \
-v "${{ github.workspace }}/shell:/home/build/immortalwrt/shell" \
-v "${{ github.workspace }}/x86-64/build24.sh:/home/build/immortalwrt/build.sh" \
-e PROFILE=$profile \
-e INCLUDE_DOCKER=$include_docker \
-e ENABLE_PPPOE=${{ inputs.enable_pppoe }} \
-e PPPOE_ACCOUNT=${{ inputs.pppoe_account }} \
-e PPPOE_PASSWORD=${{ inputs.pppoe_password }} \
immortalwrt/imagebuilder:x86-64-openwrt-24.10.2 /bin/bash /home/build/immortalwrt/build.sh
done
-
name
:
Create info
-
name
:
Create info
run
:
|
run
:
|
cat > router-info.md <<EOF
# 📡 路由器后台信息
- 🏠 **后台地址**: ${{ github.event.inputs.custom_router_ip }}
- 👤 **用户名**: root
- 🔑 **密码**: 无
EOF
if [ "${{ github.event.inputs.include_docker }}" == "yes" ]; then
if [ "${{ github.event.inputs.include_docker }}" == "yes" ]; then
extra_content="#### 默认带docker"
extra_content="#### 默认带docker"
echo -e "\n $extra_content" >> ${{ github.workspace }}/info.md
echo -e "\n $extra_content" >> ${{ github.workspace }}/
router-
info.md
else
else
echo -e "NO docker"
echo -e "NO docker"
fi
fi
-
name
:
Upload ImmortWrt as release assets
-
name
:
Upload ImmortWrt as release assets
uses
:
softprops/action-gh-release@v2.2.1
uses
:
softprops/action-gh-release@v2.2.1
with
:
with
:
tag_name
:
Autobuild-x86-64
tag_name
:
Autobuild-x86-64
body_path
:
${{ github.workspace }}/info.md
body_path
:
${{ github.workspace }}/
router-
info.md
files
:
|
files
:
|
${{ github.workspace }}/bin/targets/x86/64/*squashfs-combined-efi.img.gz
${{ github.workspace }}/bin/targets/x86/64/*squashfs-combined-efi.img.gz
token
:
${{ secrets.GITHUB_TOKEN }}
token
:
${{ secrets.GITHUB_TOKEN }}
...
...
files/etc/uci-defaults/99-custom.sh
View file @
edeca3ec
#!/bin/sh
#!/bin/sh
# 99-custom.sh 就是immortalwrt固件首次启动时运行的脚本 位于固件内的/etc/uci-defaults/99-custom.sh
# 99-custom.sh 就是immortalwrt固件首次启动时运行的脚本 位于固件内的/etc/uci-defaults/99-custom.sh
# Log file for debugging
# Log file for debugging
LOGFILE
=
"/
tmp
/uci-defaults-log.txt"
LOGFILE
=
"/
etc/config
/uci-defaults-log.txt"
echo
"Starting 99-custom.sh at
$(
date
)
"
>>
$LOGFILE
echo
"Starting 99-custom.sh at
$(
date
)
"
>>
$LOGFILE
# 设置默认防火墙规则,方便虚拟机首次访问 WebUI
# 设置默认防火墙规则,方便虚拟机首次访问 WebUI
uci
set
firewall.@zone[1].input
=
'ACCEPT'
uci
set
firewall.@zone[1].input
=
'ACCEPT'
...
@@ -74,13 +74,18 @@ elif [ "$count" -gt 1 ]; then
...
@@ -74,13 +74,18 @@ elif [ "$count" -gt 1 ]; then
fi
fi
# LAN口设置静态IP
# LAN口设置静态IP
uci
set
network.lan.proto
=
'static'
uci
set
network.lan.proto
=
'static'
# 多网口设备 支持修改为别的ip地址,别的地址应该是网关地址,形如192.168.xx.1 项目说明里都强调过。
# 多网口设备 支持修改为别的管理后台地址 在Github Action 的UI上自行输入即可 默认192.168.100.1
# 大家不能胡乱修改哦 比如有人修改为192.168.100.55 这是错误的理解 这个项目不能提前设置旁路地址
# 旁路的设置分2类情况,情况一是单网口的设备,默认是DHCP模式,ip应该在上一级路由器里查看。之后进入web页在设置旁路。
# 情况二旁路由如果是多网口设备,也应当用网关访问网页后,在自行在web网页里设置。总之大家不能直接在代码里修改旁路网关。千万不要徒增bug啦。
uci
set
network.lan.ipaddr
=
'192.168.100.1'
uci
set
network.lan.netmask
=
'255.255.255.0'
uci
set
network.lan.netmask
=
'255.255.255.0'
echo
"set 192.168.100.1 at
$(
date
)
"
>>
$LOGFILE
# 设置路由器管理后台地址
IP_VALUE_FILE
=
"/etc/config/custom_router_ip.txt"
if
[
-f
"
$IP_VALUE_FILE
"
]
;
then
CUSTOM_IP
=
$(
cat
"
$IP_VALUE_FILE
"
)
# 设置路由器的管理后台地址
uci
set
network.lan.ipaddr
=
$CUSTOM_IP
echo
"custom router ip is
$CUSTOM_IP
"
>>
$LOGFILE
fi
# 判断是否启用 PPPoE
# 判断是否启用 PPPoE
echo
"print enable_pppoe value===
$enable_pppoe
"
>>
$LOGFILE
echo
"print enable_pppoe value===
$enable_pppoe
"
>>
$LOGFILE
if
[
"
$enable_pppoe
"
=
"yes"
]
;
then
if
[
"
$enable_pppoe
"
=
"yes"
]
;
then
...
...
glinet/99-custom.sh
View file @
edeca3ec
...
@@ -18,6 +18,7 @@ else
...
@@ -18,6 +18,7 @@ else
.
"
$SETTINGS_FILE
"
.
"
$SETTINGS_FILE
"
fi
fi
# 设置路由器管理后台地址
IP_VALUE_FILE
=
"/etc/config/custom_router_ip.txt"
IP_VALUE_FILE
=
"/etc/config/custom_router_ip.txt"
if
[
-f
"
$IP_VALUE_FILE
"
]
;
then
if
[
-f
"
$IP_VALUE_FILE
"
]
;
then
CUSTOM_IP
=
$(
cat
"
$IP_VALUE_FILE
"
)
CUSTOM_IP
=
$(
cat
"
$IP_VALUE_FILE
"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment