Unverified Commit 606f0c6c authored by wukongdaily's avatar wukongdaily Committed by GitHub
Browse files

新增 斐讯N1的工作流 采用onpub打包

parent a4eaac84
name: build-N1
on:
workflow_dispatch:
inputs:
include_docker:
description: |
是否编译 Docker 插件
required: true
default: 'no'
type: choice
options:
- 'yes'
- 'no'
rootfs_partsize:
description: '设置软件包大小 单位(MB) 最大数值10240'
required: true
default: '1024'
openwrt_kernel:
description: "选择构建的内核 (带减号的代表主备双内核)"
required: false
default: "5.15.y_6.1.y"
type: choice
options:
- 5.4.y
- 5.10.y
- 5.15.y
- 6.1.y
- 6.6.y
- 6.12.y
- 5.4.y_5.10.y
- 5.15.y_6.1.y
- 6.1.y_6.12.y
- 6.1.y_6.6.y
- 6.6.y_6.12.y
jobs:
build:
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set executable permissions
run: chmod +x ${{ github.workspace }}/n1/build.sh
- name: Debug workspace contents
run: ls -R
- name: Copy banner
run: |
cp n1/99-banner.sh files/etc/uci-defaults/
- name: Building N1 ImmortalWrt
run: |
profiles="generic"
include_docker="${{ github.event.inputs.include_docker }}"
rootfs_partsize="${{ github.event.inputs.rootfs_partsize }}"
IFS=',' read -r -a profile_array <<< "$profiles"
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/etc/uci-defaults:/home/build/immortalwrt/files/etc/uci-defaults" \
-v "${{ github.workspace }}/arch/arch.conf:/home/build/immortalwrt/files/etc/opkg/arch.conf" \
-v "${{ github.workspace }}/shell:/home/build/immortalwrt/shell" \
-v "${{ github.workspace }}/n1/banner:/home/build/immortalwrt/files/mnt/banner" \
-v "${{ github.workspace }}/n1/imm.config:/home/build/immortalwrt/.config" \
-v "${{ github.workspace }}/n1/build.sh:/home/build/immortalwrt/build.sh" \
-e PROFILE=$profile \
-e INCLUDE_DOCKER=$include_docker \
-e ROOTFS_PARTSIZE=$rootfs_partsize \
immortalwrt/imagebuilder:armsr-armv8-openwrt-24.10.2 /bin/bash /home/build/immortalwrt/build.sh
done
- name: 检查rootfs是否存在
run: ls -lh ${{ github.workspace }}/bin/targets/armsr/armv8/
- name: 查找rootfs.tar.gz所在路径
id: find_rootfs
run: |
ROOTFS_FILE=$(find bin/targets/armsr/armv8/ -type f -name "*rootfs.tar.gz" | head -n1)
echo "✅ Found: $ROOTFS_FILE"
if [ ! -f "$ROOTFS_FILE" ]; then
echo "❌ 找不到 rootfs.tar.gz 文件"
exit 1
fi
echo "file=$ROOTFS_FILE" >> $GITHUB_OUTPUT
- name: Package armsr-armv8 as ImmortalWrt for N1
uses: ophub/amlogic-s9xxx-openwrt@main
with:
openwrt_path: ${{ steps.find_rootfs.outputs.file }}
openwrt_board: s905d
openwrt_kernel: ${{ inputs.openwrt_kernel }}
builder_name: "wukongdaily"
auto_kernel: true
- name: Rename .img.gz file
id: rename
run: |
FILE=$(ls ${{ env.PACKAGED_OUTPUTPATH }}/*.img.gz | head -n1)
echo "Image file is: $FILE"
FILENAME=$(basename "$FILE")
echo "FILENAME=$FILENAME" >> $GITHUB_ENV
mv "$FILE" "${{ env.PACKAGED_OUTPUTPATH }}/immortalwrt-24.10.2-phicomm-n1-squashfs-sysupgrade.img.gz"
- name: Upload firmware to GitHub Releases
uses: softprops/action-gh-release@v2.2.1
with:
tag_name: phicomm-n1
name: ImmortalWrt for Phicomm N1
body_path: ${{ github.workspace }}/n1/info.md
files: |
${{ env.PACKAGED_OUTPUTPATH }}/*.img.gz
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
\ No newline at end of file
...@@ -13,7 +13,8 @@ ...@@ -13,7 +13,8 @@
> 6、新增用户预设置pppoe拨号功能<br> > 6、新增用户预设置pppoe拨号功能<br>
> 7、新增树莓派①②③④⑤<br> > 7、新增树莓派①②③④⑤<br>
> 8、新增第三方软件包的集成功能 https://github.com/wukongdaily/AutoBuildImmortalWrt/discussions/209 <br> > 8、新增第三方软件包的集成功能 https://github.com/wukongdaily/AutoBuildImmortalWrt/discussions/209 <br>
> 9、MT2500 和 MT6000 支持第三方插件的按需集成 > 9、MT2500 和 MT6000 支持第三方插件的按需集成
> 10、新增:斐讯N1 的工作流<br>
## 如何查询imm仓库内有哪些插件 ## 如何查询imm仓库内有哪些插件
...@@ -58,6 +59,7 @@ https://www.youtube.com/watch?v=7i6BQeitUtE ...@@ -58,6 +59,7 @@ https://www.youtube.com/watch?v=7i6BQeitUtE
https://wkdaily.cpolar.cn/15 https://wkdaily.cpolar.cn/15
# 🌟鸣谢 # 🌟鸣谢
### https://github.com/immortalwrt ### https://github.com/immortalwrt
### https://github.com/ophub/amlogic-s9xxx-openwrt
### https://github.com/sirpdboy ### https://github.com/sirpdboy
### https://github.com/wukongdaily/ib-overlay ### https://github.com/wukongdaily/ib-overlay
......
#!/bin/sh
cp /mnt/banner /etc/banner
rm /mnt/banner
\ No newline at end of file
.___ __ .__
| | _____ _____ ____________/ |______ | |
| |/ \ / \ / _ \_ __ \ __\__ \ | |
| | Y Y \ Y Y ( <_> ) | \/| | / __ \| |__
|___|__|_| /__|_| /\____/|__| |__| (____ /____/
\/ \/ BE FREE AND UNAFRAID \/
-----------------------------------------------------
ImmortalWrt 24.10.2, r33247-467867283bb9
-----------------------------------------------------
\ No newline at end of file
#!/bin/bash
# Log file for debugging
source shell/custom-packages.sh
echo "第三方软件包: $CUSTOM_PACKAGES"
LOGFILE="/tmp/uci-defaults-log.txt"
echo "Starting 99-custom.sh at $(date)" >> $LOGFILE
# yml 传入的路由器型号 PROFILE
echo "Building for profile: $PROFILE"
# yml 传入的固件大小 ROOTFS_PARTSIZE
echo "Building for ROOTFS_PARTSIZE: $ROOTFS_PARTSIZE"
if [ -z "$CUSTOM_PACKAGES" ]; then
echo "⚪️ 未选择 任何第三方软件包"
else
# 下载 run 文件仓库
echo "🔄 正在同步第三方软件仓库 Cloning run file repo..."
git clone --depth=1 https://github.com/wukongdaily/store.git /tmp/store-run-repo
# 拷贝 run/arm64 下所有 run 文件和ipk文件 到 extra-packages 目录
mkdir -p /home/build/immortalwrt/extra-packages
cp -r /tmp/store-run-repo/run/arm64/* /home/build/immortalwrt/extra-packages/
echo "✅ Run files copied to extra-packages:"
ls -lh /home/build/immortalwrt/extra-packages/*.run
# 解压并拷贝ipk到packages目录
sh shell/prepare-packages.sh
ls -lah /home/build/immortalwrt/packages/
# 添加架构优先级信息
sed -i '1i\
arch aarch64_generic 10\n\
arch aarch64_cortex-a53 15' repositories.conf
fi
# 输出调试信息
echo "$(date '+%Y-%m-%d %H:%M:%S') - 开始构建arm64的rootfs.tar.gz"
# 定义所需安装的包列表 下列插件你都可以自行删减
PACKAGES=""
PACKAGES="$PACKAGES curl fdisk"
PACKAGES="$PACKAGES luci-i18n-diskman-zh-cn"
PACKAGES="$PACKAGES luci-i18n-package-manager-zh-cn"
PACKAGES="$PACKAGES luci-i18n-firewall-zh-cn"
# 服务——FileBrowser 用户名admin 密码admin
PACKAGES="$PACKAGES luci-i18n-filebrowser-go-zh-cn"
PACKAGES="$PACKAGES luci-theme-argon"
PACKAGES="$PACKAGES luci-app-argon-config"
PACKAGES="$PACKAGES luci-i18n-argon-config-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"
# 判断是否需要编译 Docker 插件
if [ "$INCLUDE_DOCKER" = "yes" ]; then
PACKAGES="$PACKAGES luci-i18n-dockerman-zh-cn"
echo "✅ 已选择docker : luci-i18n-dockerman-zh-cn"
fi
# 斐讯N1 无线
PACKAGES="$PACKAGES kmod-brcmfmac wpad-basic-mbedtls iw iwinfo"
PACKAGES="$PACKAGES perlbase-base perlbase-file perlbase-time perlbase-utf8 perlbase-xsloader"
# 晶晨宝盒
PACKAGES="$PACKAGES luci-app-amlogic luci-i18n-amlogic-zh-cn"
# ======== shell/custom-packages.sh =======
# 合并imm仓库以外的第三方插件
PACKAGES="$PACKAGES $CUSTOM_PACKAGES"
# 若构建openclash 则添加内核
if echo "$PACKAGES" | grep -q "luci-app-openclash"; then
echo "✅ 已选择 luci-app-openclash,添加 openclash core"
mkdir -p files/etc/openclash/core
# Download clash_meta
META_URL="https://raw.githubusercontent.com/vernesong/OpenClash/core/master/meta/clash-linux-arm64.tar.gz"
wget -qO- $META_URL | tar xOvz > files/etc/openclash/core/clash_meta
chmod +x files/etc/openclash/core/clash_meta
# Download GeoIP and GeoSite
wget -q https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geoip.dat -O files/etc/openclash/GeoIP.dat
wget -q https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geosite.dat -O files/etc/openclash/GeoSite.dat
else
echo "⚪️ 未选择 luci-app-openclash"
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" ROOTFS_PARTSIZE=$ROOTFS_PARTSIZE
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."
\ No newline at end of file
This diff is collapsed.
#### ImmortalWrt for 斐讯N1
#### luci版本 24.10.2
#### 后台地址 `没有没有没有,需查询` 详见下文
#### 用户名 `root` 密码:无
#### 默认软件包大小 1GB
#### 内核版本:根据用户选择
##### 斐讯N1为单网口设备 网线接上路由器 启动后默认是自动获取ip的模式 请在上级路由器的dhcp列表中查询具体的局域网ip
##### 若后续想设置其他ip或者旁路 请在web页面自行设置即可 总之 这个逻辑就是默认让它有网 和 普通电脑、NAS 无异
##### 若release中下载吃力 可在国内加速站下载 https://wkdaily.cpolar.top/archives/1
[![Github](https://img.shields.io/badge/Release文件可在国内加速站下载-FC7C0D?logo=github&logoColor=fff&labelColor=000&style=for-the-badge)](https://wkdaily.cpolar.top/archives/1)
\ No newline at end of file
...@@ -36,3 +36,6 @@ CUSTOM_PACKAGES="$CUSTOM_PACKAGES luci-app-store" ...@@ -36,3 +36,6 @@ CUSTOM_PACKAGES="$CUSTOM_PACKAGES luci-app-store"
# 应用过滤 openappfilter.com # 应用过滤 openappfilter.com
#CUSTOM_PACKAGES="$CUSTOM_PACKAGES luci-app-appfilter" #CUSTOM_PACKAGES="$CUSTOM_PACKAGES luci-app-appfilter"
#CUSTOM_PACKAGES="$CUSTOM_PACKAGES luci-i18n-appfilter-zh-cn" #CUSTOM_PACKAGES="$CUSTOM_PACKAGES luci-i18n-appfilter-zh-cn"
# 设置向导 by sirpdboy
#CUSTOM_PACKAGES="$CUSTOM_PACKAGES luci-app-netwizard"
#CUSTOM_PACKAGES="$CUSTOM_PACKAGES luci-i18n-netwizard-zh-cn"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment