Merge pull request #13 from QuickWrt/next-dav

Next dav
This commit is contained in:
2025-10-24 16:00:42 +08:00
committed by GitHub
2 changed files with 8 additions and 13 deletions

View File

@@ -22,7 +22,7 @@ jobs:
run: | run: |
latest_tag=$(git tag --list "v*" | sort -V | tail -n1) latest_tag=$(git tag --list "v*" | sort -V | tail -n1)
if [ -z "$latest_tag" ]; then if [ -z "$latest_tag" ]; then
next_tag="v2.0" next_tag="v3.0"
else else
base=${latest_tag#v} base=${latest_tag#v}
major=$(echo $base | cut -d. -f1) major=$(echo $base | cut -d. -f1)

View File

@@ -17,7 +17,7 @@ readonly RESET='\033[0m'
# 全局常量定义 # 全局常量定义
# ============================================================================= # =============================================================================
readonly SCRIPT_NAME="OpenWRT 构建系统" readonly SCRIPT_NAME="OpenWRT 构建系统"
readonly SCRIPT_VERSION="2.0.0" readonly SCRIPT_VERSION="2.0.1"
readonly AUTHOR="OPPEN321" readonly AUTHOR="OPPEN321"
readonly BLOG="www.kejizero.online" readonly BLOG="www.kejizero.online"
readonly MIRROR="https://raw.githubusercontent.com/QuickWrt/QuickWrt/refs/heads/master" readonly MIRROR="https://raw.githubusercontent.com/QuickWrt/QuickWrt/refs/heads/master"
@@ -406,7 +406,7 @@ download_prebuilt_toolchain() {
fi fi
echo -e "${BLUE_COLOR}├─ 下载工具链文件...${RESET}" echo -e "${BLUE_COLOR}├─ 下载工具链文件...${RESET}"
local TOOLCHAIN_URL="https://github.com/QuickWrt/QuickWrt/releases/download/openwrt-24.10" local TOOLCHAIN_URL="https://github.com/QuickWrt/ZeroWrt/releases/download/Toolchain-Cache"
local toolchain_file="toolchain_musl_${TOOLCHAIN_ARCH}_gcc-13.tar.zst" local toolchain_file="toolchain_musl_${TOOLCHAIN_ARCH}_gcc-13.tar.zst"
if curl -L "${TOOLCHAIN_URL}/${toolchain_file}" -o toolchain.tar.zst ${CURL_OPTIONS}; then if curl -L "${TOOLCHAIN_URL}/${toolchain_file}" -o toolchain.tar.zst ${CURL_OPTIONS}; then
@@ -556,14 +556,13 @@ setup_kmod_package_name() {
# 打包和生成OTA文件 # 打包和生成OTA文件
package_and_generate_ota() { package_and_generate_ota() {
local architecture="$1" local architecture="$1"
local version="$2"
print_info "开始打包和生成OTA文件..." print_info "开始打包和生成OTA文件..."
if [ "$architecture" = "x86_64" ]; then if [ "$architecture" = "x86_64" ]; then
process_x86_64 "$version" process_x86_64
elif [ "$architecture" = "rockchip" ]; then elif [ "$architecture" = "rockchip" ]; then
process_rockchip "$version" process_rockchip
else else
print_warning "未知架构: $architecture跳过打包和OTA生成" print_warning "未知架构: $architecture跳过打包和OTA生成"
fi fi
@@ -573,7 +572,6 @@ package_and_generate_ota() {
# 处理 x86_64 架构 # 处理 x86_64 架构
process_x86_64() { process_x86_64() {
local version="$1"
print_info "处理 x86_64 架构的打包..." print_info "处理 x86_64 架构的打包..."
@@ -612,7 +610,6 @@ process_x86_64() {
# 生成 x86_64 OTA JSON # 生成 x86_64 OTA JSON
generate_x86_64_ota_json() { generate_x86_64_ota_json() {
local version="$1"
print_info "生成 x86_64 OTA JSON 文件..." print_info "生成 x86_64 OTA JSON 文件..."
@@ -621,7 +618,7 @@ generate_x86_64_ota_json() {
echo -e "${BLUE_COLOR}├─ 计算 SHA256 校验和...${RESET}" echo -e "${BLUE_COLOR}├─ 计算 SHA256 校验和...${RESET}"
local OTA_URL="https://github.com/QuickWrt/ZeroWrt/releases/download" local OTA_URL="https://github.com/QuickWrt/ZeroWrt/releases/download"
local VERSION_NUMBER=$(echo "$version" | sed 's/v//g') local VERSION_NUMBER=$(echo "$$tag_version" | sed 's/v//g')
local SHA256=$(sha256sum bin/targets/x86/64*/*-generic-squashfs-combined-efi.img.gz | awk '{print $1}') local SHA256=$(sha256sum bin/targets/x86/64*/*-generic-squashfs-combined-efi.img.gz | awk '{print $1}')
echo -e "${BLUE_COLOR}├─ 生成 JSON 文件...${RESET}" echo -e "${BLUE_COLOR}├─ 生成 JSON 文件...${RESET}"
@@ -647,7 +644,6 @@ EOF
# 处理 rockchip 架构 # 处理 rockchip 架构
process_rockchip() { process_rockchip() {
local version="$1"
print_info "处理 rockchip 架构的打包..." print_info "处理 rockchip 架构的打包..."
@@ -686,7 +682,6 @@ process_rockchip() {
# 生成 rockchip OTA JSON # 生成 rockchip OTA JSON
generate_rockchip_ota_json() { generate_rockchip_ota_json() {
local version="$1"
print_info "生成 rockchip OTA JSON 文件..." print_info "生成 rockchip OTA JSON 文件..."
@@ -695,7 +690,7 @@ generate_rockchip_ota_json() {
echo -e "${BLUE_COLOR}├─ 计算各设备的 SHA256 校验和...${RESET}" echo -e "${BLUE_COLOR}├─ 计算各设备的 SHA256 校验和...${RESET}"
local OTA_URL="https://github.com/QuickWrt/ZeroWrt/releases/download" local OTA_URL="https://github.com/QuickWrt/ZeroWrt/releases/download"
local VERSION_NUMBER=$(echo "$version" | sed 's/v//g') local VERSION_NUMBER=$(echo "$$tag_version" | sed 's/v//g')
# 计算各个设备的SHA256 # 计算各个设备的SHA256
local SHA256_armsom_sige3=$(sha256sum bin/targets/rockchip/armv8*/zerowrt-$VERSION_NUMBER-rockchip-armv8-armsom_sige3-squashfs-sysupgrade.img.gz | awk '{print $1}') local SHA256_armsom_sige3=$(sha256sum bin/targets/rockchip/armv8*/zerowrt-$VERSION_NUMBER-rockchip-armv8-armsom_sige3-squashfs-sysupgrade.img.gz | awk '{print $1}')
@@ -940,7 +935,7 @@ main() {
if [[ "$BUILD_MODE" != "toolchain-only" ]]; then if [[ "$BUILD_MODE" != "toolchain-only" ]]; then
setup_kmod_package_name setup_kmod_package_name
package_and_generate_ota "$architecture" "$version" package_and_generate_ota "$architecture"
fi fi
# 计算总耗时 # 计算总耗时