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
a2558b4f
Unverified
Commit
a2558b4f
authored
Jan 09, 2025
by
wukongdaily
Committed by
GitHub
Jan 09, 2025
Browse files
x86-64机型新增用户预设pppoe拨号功能
parent
d33b0c7e
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
117 additions
and
6 deletions
+117
-6
.github/workflows/build-x86-64-23.05.4.yml
.github/workflows/build-x86-64-23.05.4.yml
+26
-0
.github/workflows/build-x86-64-24.10.yml
.github/workflows/build-x86-64-24.10.yml
+27
-0
files/etc/uci-defaults/99-custom.sh
files/etc/uci-defaults/99-custom.sh
+34
-4
x86-64/24.10/build.sh
x86-64/24.10/build.sh
+15
-1
x86-64/build.sh
x86-64/build.sh
+15
-1
No files found.
.github/workflows/build-x86-64-23.05.4.yml
View file @
a2558b4f
...
...
@@ -16,6 +16,20 @@ on:
options
:
-
'
yes'
-
'
no'
enable_pppoe
:
description
:
"
是否配置PPPoE拨号信息?"
required
:
true
default
:
'
no'
type
:
choice
options
:
-
'
yes'
-
'
no'
pppoe_account
:
description
:
"
宽带账号
(若启用PPPoE)"
required
:
false
pppoe_password
:
description
:
"
宽带密码
(若启用PPPoE)"
required
:
false
jobs
:
build
:
...
...
@@ -28,6 +42,15 @@ jobs:
-
name
:
Set executable permissions
run
:
chmod +x ${{ github.workspace }}/x86-64/build.sh
-
name
:
Validate PPPoE Inputs
run
:
|
if [[ "${{ inputs.enable_pppoe }}" == "yes" ]]; then
if [[ -z "${{ inputs.pppoe_account }}" || -z "${{ inputs.pppoe_password }}" ]]; then
echo "Error: PPPoE account and password must be provided when PPPoE is enabled!"
exit 1
fi
fi
-
name
:
Build ImmortalWrt-x86-64-eif
run
:
|
profiles="${{ github.event.inputs.profile }}"
...
...
@@ -46,6 +69,9 @@ jobs:
-v "${{ github.workspace }}/x86-64/build.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-23.05.4 /bin/bash /home/build/immortalwrt/build.sh
done
...
...
.github/workflows/build-x86-64-24.10.yml
View file @
a2558b4f
...
...
@@ -16,6 +16,20 @@ on:
options
:
-
'
yes'
-
'
no'
enable_pppoe
:
description
:
"
是否配置PPPoE拨号信息?"
required
:
true
default
:
'
no'
type
:
choice
options
:
-
'
yes'
-
'
no'
pppoe_account
:
description
:
"
宽带账号
(若启用PPPoE)"
required
:
false
pppoe_password
:
description
:
"
宽带密码
(若启用PPPoE)"
required
:
false
jobs
:
build
:
...
...
@@ -28,6 +42,16 @@ jobs:
-
name
:
Set executable permissions
run
:
chmod +x ${{ github.workspace }}/x86-64/build.sh
-
name
:
Validate PPPoE Inputs
run
:
|
if [[ "${{ inputs.enable_pppoe }}" == "yes" ]]; then
if [[ -z "${{ inputs.pppoe_account }}" || -z "${{ inputs.pppoe_password }}" ]]; then
echo "Error: PPPoE account and password must be provided when PPPoE is enabled!"
exit 1
fi
fi
-
name
:
Build ImmortalWrt-x86-64-eif
run
:
|
profiles="${{ github.event.inputs.profile }}"
...
...
@@ -45,6 +69,9 @@ jobs:
-v "${{ github.workspace }}/x86-64/24.10/build.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.0-rc3 /bin/bash /home/build/immortalwrt/build.sh
done
...
...
files/etc/uci-defaults/99-custom.sh
View file @
a2558b4f
#!/bin/sh
# 99-custom.sh 就是immortalwrt固件首次启动时运行的脚本 位于固件内的/etc/uci-defaults/99-custom.sh
# Log file for debugging
LOGFILE
=
"/tmp/uci-defaults-log.txt"
echo
"Starting 99-custom.sh at
$(
date
)
"
>>
$LOGFILE
# 设置默认防火墙规则,方便虚拟机首次访问 WebUI
uci
set
firewall.@zone[1].input
=
'ACCEPT'
...
...
@@ -9,7 +12,7 @@ uci set "dhcp.@domain[-1].name=time.android.com"
uci
set
"dhcp.@domain[-1].ip=203.107.6.88"
#
根据
网卡数量
配置网络
#
计算
网卡数量
count
=
0
for
iface
in
/sys/class/net/
*
;
do
iface_name
=
$(
basename
"
$iface
"
)
...
...
@@ -19,11 +22,38 @@ for iface in /sys/class/net/*; do
fi
done
# 检查配置文件pppoe-settings是否存在 该文件由build.sh动态生成
SETTINGS_FILE
=
"/etc/config/pppoe-settings"
if
[
!
-f
"
$SETTINGS_FILE
"
]
;
then
echo
"PPPoE settings file not found. Skipping."
>>
$LOGFILE
else
# 读取pppoe信息($enable_pppoe、$pppoe_account、$pppoe_password)
.
"
$SETTINGS_FILE
"
fi
# 网络设置
if
[
"
$count
"
-eq
1
]
;
then
# 单网口设备 类似于NAS模式 动态获取ip模式 具体ip地址取决于上一级路由器给它分配的ip 也方便后续你使用web页面设置旁路由
# 单网口设备 不支持修改ip 不要在此处修改ip
uci
set
network.lan.proto
=
'dhcp'
elif
[
"
$count
"
-gt
1
]
;
then
# 多网口设备 支持修改为别的ip地址
uci
set
network.lan.ipaddr
=
'192.168.100.1'
echo
"set 192.168.100.1 at
$(
date
)
"
>>
$LOGFILE
# 判断是否启用 PPPoE
echo
"print enable_pppoe value===
$enable_pppoe
"
>>
$LOGFILE
if
[
"
$enable_pppoe
"
=
"yes"
]
;
then
echo
"PPPoE is enabled at
$(
date
)
"
>>
$LOGFILE
# 设置宽带拨号信息
uci
set
network.wan.proto
=
'pppoe'
uci
set
network.wan.username
=
$pppoe_account
uci
set
network.wan.password
=
$pppoe_password
uci
set
network.wan.peerdns
=
'1'
uci
set
network.wan.auto
=
'1'
echo
"PPPoE configuration completed successfully."
>>
$LOGFILE
else
echo
"PPPoE is not enabled. Skipping configuration."
>>
$LOGFILE
fi
fi
# 设置所有网口可访问网页终端
...
...
x86-64/24.10/build.sh
View file @
a2558b4f
#!/bin/bash
# Log file for debugging
LOGFILE
=
"/tmp/uci-defaults-log.txt"
echo
"Starting 99-custom.sh at
$(
date
)
"
>>
$LOGFILE
echo
"编译固件大小为:
$PROFILE
MB"
echo
"Include Docker:
$INCLUDE_DOCKER
"
echo
"Create pppoe-settings"
mkdir
-p
/home/build/immortalwrt/files/etc/config
# 创建pppoe配置文件 yml传入环境变量ENABLE_PPPOE等 写入配置文件 供99-custom.sh读取
cat
<<
EOF
> /home/build/immortalwrt/files/etc/config/pppoe-settings
enable_pppoe=
${
ENABLE_PPPOE
}
pppoe_account=
${
PPPOE_ACCOUNT
}
pppoe_password=
${
PPPOE_PASSWORD
}
EOF
echo
"cat pppoe-settings"
cat
/home/build/immortalwrt/files/etc/config/pppoe-settings
# 输出调试信息
echo
"
$(
date
'+%Y-%m-%d %H:%M:%S'
)
- 开始编译..."
...
...
x86-64/build.sh
View file @
a2558b4f
#!/bin/bash
# Log file for debugging
LOGFILE
=
"/tmp/uci-defaults-log.txt"
echo
"Starting 99-custom.sh at
$(
date
)
"
>>
$LOGFILE
echo
"编译固件大小为:
$PROFILE
MB"
echo
"Include Docker:
$INCLUDE_DOCKER
"
echo
"Create pppoe-settings"
mkdir
-p
/home/build/immortalwrt/files/etc/config
# 创建pppoe配置文件 yml传入环境变量ENABLE_PPPOE等 写入配置文件 供99-custom.sh读取
cat
<<
EOF
> /home/build/immortalwrt/files/etc/config/pppoe-settings
enable_pppoe=
${
ENABLE_PPPOE
}
pppoe_account=
${
PPPOE_ACCOUNT
}
pppoe_password=
${
PPPOE_PASSWORD
}
EOF
echo
"cat pppoe-settings"
cat
/home/build/immortalwrt/files/etc/config/pppoe-settings
# 输出调试信息
echo
"
$(
date
'+%Y-%m-%d %H:%M:%S'
)
- 开始编译..."
...
...
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