-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3a4a218
commit 34bc424
Showing
2 changed files
with
63 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
#!/bin/bash | ||
# 该文件实际为imagebuilder容器内的build.sh | ||
# yml 传入的路由器型号 PROFILE | ||
echo "Building for profile: $PROFILE" | ||
echo "Include Docker: $INCLUDE_DOCKER" | ||
echo "Create pppoe-settings" | ||
mkdir -p /home/build/immortalwrt/files/etc/config | ||
|
||
# 创建pppoe配置文件 yml传入pppoe变量————>pppoe-settings文件 | ||
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') - Starting build process..." | ||
|
||
|
||
# 定义所需安装的包列表 下列插件你都可以自行删减 | ||
PACKAGES="" | ||
PACKAGES="$PACKAGES curl" | ||
PACKAGES="$PACKAGES luci-i18n-firewall-zh-cn" | ||
PACKAGES="$PACKAGES luci-i18n-filebrowser-zh-cn" | ||
PACKAGES="$PACKAGES luci-app-argon-config" | ||
PACKAGES="$PACKAGES luci-i18n-argon-config-zh-cn" | ||
PACKAGES="$PACKAGES luci-i18n-diskman-zh-cn" | ||
#24.10.0 | ||
PACKAGES="$PACKAGES luci-i18n-package-manager-zh-cn" | ||
PACKAGES="$PACKAGES luci-i18n-ttyd-zh-cn" | ||
PACKAGES="$PACKAGES luci-i18n-passwall-zh-cn" | ||
PACKAGES="$PACKAGES luci-app-openclash" | ||
PACKAGES="$PACKAGES luci-i18n-homeproxy-zh-cn" | ||
PACKAGES="$PACKAGES openssh-sftp-server" | ||
# 增加几个必备组件 方便用户安装iStore | ||
PACKAGES="$PACKAGES fdisk" | ||
PACKAGES="$PACKAGES script-utils" | ||
PACKAGES="$PACKAGES luci-i18n-samba4-zh-cn" | ||
|
||
|
||
# 判断是否需要编译 Docker 插件 | ||
if [ "$INCLUDE_DOCKER" = "yes" ]; then | ||
PACKAGES="$PACKAGES luci-i18n-dockerman-zh-cn" | ||
echo "Adding package: luci-i18n-dockerman-zh-cn" | ||
fi | ||
|
||
|
||
# 构建镜像 | ||
echo "$(date '+%Y-%m-%d %H:%M:%S') - Building image with the following packages:" | ||
echo "$PACKAGES" | ||
|
||
make image PROFILE=$PROFILE PACKAGES="$PACKAGES" FILES="/home/build/immortalwrt/files" | ||
|
||
if [ $? -ne 0 ]; then | ||
echo "$(date '+%Y-%m-%d %H:%M:%S') - Error: Build failed!" | ||
exit 1 | ||
fi | ||
|
||
echo "$(date '+%Y-%m-%d %H:%M:%S') - Build completed successfully." |