#!/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 # ============= 同步第三方插件库============== # 下载 run 文件仓库 echo "🔄 Cloning run file repo..." git clone --depth=1 https://github.com/wukongdaily/store.git /tmp/store-run-repo # 拷贝 run/x86 下所有 run 文件和ipk文件 到 extra-packages 目录 mkdir -p /home/build/immortalwrt/extra-packages cp -r /tmp/store-run-repo/run/x86/* /home/build/immortalwrt/extra-packages/ echo "✅ Run files copied to extra-packages:" ls -lh /home/build/immortalwrt/extra-packages/*.run # 解压并拷贝ipk到packages目录 sh prepare-packages.sh ls -lah /home/build/immortalwrt/packages/ # 输出调试信息 echo "$(date '+%Y-%m-%d %H:%M:%S') - 开始构建固件..." # ============= imm仓库内的插件============== # 定义所需安装的包列表 下列插件你都可以自行删减 PACKAGES="" PACKAGES="$PACKAGES curl" PACKAGES="$PACKAGES luci-i18n-diskman-zh-cn" PACKAGES="$PACKAGES luci-i18n-firewall-zh-cn" PACKAGES="$PACKAGES luci-app-argon-config" PACKAGES="$PACKAGES luci-i18n-argon-config-zh-cn" #24.10 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" PACKAGES="$PACKAGES luci-i18n-samba4-zh-cn" # 文件管理器 PACKAGES="$PACKAGES luci-i18n-filemanager-zh-cn" # 静态文件服务器dufs(推荐) PACKAGES="$PACKAGES luci-i18n-dufs-zh-cn" # ============= imm仓库外的第三方插件============== # istore商店 PACKAGES="$PACKAGES luci-app-store" # 首页和网络向导 PACKAGES="$PACKAGES luci-i18n-quickstart-zh-cn" # 去广告adghome PACKAGES="$PACKAGES luci-app-adguardhome" # 代理相关 PACKAGES="$PACKAGES luci-app-ssr-plus" PACKAGES="$PACKAGES luci-app-passwall2" PACKAGES="$PACKAGES luci-i18n-nikki-zh-cn" # VPN PACKAGES="$PACKAGES luci-app-tailscale" PACKAGES="$PACKAGES luci-i18n-tailscale-zh-cn" # 分区扩容 by sirpdboy PACKAGES="$PACKAGES luci-app-partexp" PACKAGES="$PACKAGES luci-i18n-partexp-zh-cn" # 酷猫主题 by sirpdboy PACKAGES="$PACKAGES luci-theme-kucat" # 网络测速 by sirpdboy PACKAGES="$PACKAGES luci-app-netspeedtest" PACKAGES="$PACKAGES luci-i18n-netspeedtest-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="generic" PACKAGES="$PACKAGES" FILES="/home/build/immortalwrt/files" ROOTFS_PARTSIZE=$PROFILE 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."