优化标签提取逻辑,移除版本前缀并统一处理,更新相关脚本和配置文件

This commit is contained in:
Ing 2025-12-08 16:06:41 +08:00
parent ce9017bae1
commit cdcceea395
7 changed files with 20 additions and 15 deletions

View File

@ -41,11 +41,10 @@ jobs:
TAG=""
for i in {1..3}; do
if [ "${PRERELEASE}" = "true" ]; then
TAG="$(curl -skL --connect-timeout 10 "${REPO}/tags" | grep "/refs/tags/.*\.zip" | sed -E 's/.*\/refs\/tags\/(.*)\.zip.*$/\1/' | sort -rV | head -1)"
TAG="$(curl -skL --connect-timeout 10 "${REPO}/tags" | grep "/refs/tags/.*\.zip" | sed -E 's/.*\/refs\/tags\/(.*)\.zip.*$/\1/' | sort -rV | head -1 | sed 's/^[v|V]//g')"
else
TAG="$(curl -skL --connect-timeout 10 -w "%{url_effective}" -o /dev/null "${REPO}/releases/latest" | awk -F'/' '{print $NF}')"
TAG="$(curl -skL --connect-timeout 10 -w "%{url_effective}" -o /dev/null "${REPO}/releases/latest" | awk -F'/' '{print $NF}' | sed 's/^[v|V]//g')"
fi
[ "${TAG:0:1}" = "v" ] && TAG="${TAG:1}"
rm -f rr-${TAG}.img.zip
STATUS=$(curl -kL --connect-timeout 10 -w "%{http_code}" "${REPO}/releases/download/${TAG}/rr-${TAG}.img.zip" -o "rr-${TAG}.img.zip")
if [ $? -eq 0 ] && [ ${STATUS:-0} -eq 200 ]; then

View File

@ -161,11 +161,10 @@ jobs:
TAG=""
if [ "${PRERELEASE}" = "true" ]; then
TAG="$(curl -skL --connect-timeout 10 "${REPO}/tags" | grep "/refs/tags/.*\.zip" | sed -E 's/.*\/refs\/tags\/(.*)\.zip.*$/\1/' | sort -rV | head -1)"
TAG="$(curl -skL --connect-timeout 10 "${REPO}/tags" | grep "/refs/tags/.*\.zip" | sed -E 's/.*\/refs\/tags\/(.*)\.zip.*$/\1/' | sort -rV | head -1 | sed 's/^[v|V]//g')"
else
TAG="$(curl -skL --connect-timeout 10 -w "%{url_effective}" -o /dev/null "${REPO}/releases/latest" | awk -F'/' '{print $NF}')"
TAG="$(curl -skL --connect-timeout 10 -w "%{url_effective}" -o /dev/null "${REPO}/releases/latest" | awk -F'/' '{print $NF}' | sed 's/^[v|V]//g')"
fi
[ "${TAG:0:1}" = "v" ] && TAG="${TAG:1}"
rm -f rr-${TAG}.img.zip
STATUS=$(curl -kL --connect-timeout 10 -w "%{http_code}" "${REPO}/releases/download/${TAG}/rr-${TAG}.img.zip" -o "rr-${TAG}.img.zip")
if [ $? -ne 0 ] || [ ${STATUS:-0} -ne 200 ]; then

View File

@ -61,6 +61,7 @@ If you cannot connect to the Internet, please build a pre-compiled bootloader th
BOOT: ""
RAM_SIZE: "4G" # >= 4G recommended for DSM
CPU_CORES: "2"
DISK_FMT: "qcow2"
DISK_TYPE: "sata"
DISK_SIZE: "32G" # data disk size
ARGUMENTS: "-device nec-usb-xhci,id=usb0,multifunction=on -drive file=/rr.img,media=disk,format=raw,if=none,id=udisk1 -device usb-storage,bus=usb0.0,port=1,drive=udisk1,bootindex=999,removable=on"

View File

@ -113,7 +113,7 @@ printf "%s \033[1;36m%s\033[0m\n" "$(TEXT "MEM: ")" "${MEM}"
if readConfigMap "addons" "${USER_CONFIG_FILE}" | grep -q nvmesystem; then
[ -z "$(ls /dev/nvme* | grep -vE "${LOADER_DISK}[0-9]?$" 2>/dev/null)" ] && printf "\033[1;33m*** %s ***\033[0m\n" "$(TEXT "Notice: Please insert at least one m.2 disk for system installation.")"
else
[ -z "$(ls /dev/sd* | grep -vE "${LOADER_DISK}[0-9]?$" 2>/dev/null)" ] && printf "\033[1;33m*** %s ***\033[0m\n" "$(TEXT "Notice: Please insert at least one sata disk for system installation.")"
[ -z "$(ls /dev/sd* | grep -vE "${LOADER_DISK}[0-9]?$" 2>/dev/null)" ] && printf "\033[1;33m*** %s ***\033[0m\n" "$(TEXT "Notice: Please insert at least one sata disk for system installation.")"
fi
if checkBIOS_VT_d && [ "$(echo "${KVER:-4}" | cut -d'.' -f1)" -lt 5 ]; then
@ -164,6 +164,15 @@ fi
CMDLINE['skip_vender_mac_interfaces']="$(seq -s, 0 $((${CMDLINE['netif_num']:-1} - 1)))"
ETHX="$(find /sys/class/net/ -mindepth 1 -maxdepth 1 ! -name lo -exec basename {} \; | sort)"
for N in ${ETHX}; do
MAC="$(cat "/sys/class/net/${N}/address" 2>/dev/null)" || MAC="00:00:00:00:00:00"
BUS="$(ethtool -i "${N}" 2>/dev/null | grep "bus-info" | cut -d' ' -f2)" || BUS="0000:00:00.0"
if [ ! "${MAC}" = "00:00:00:00:00:00" ] && [ ! "${BUS}" = "0000:00:00.0" ]; then
CMDLINE["R${BUS}"]="${MAC}"
fi
done
# set fixed cmdline
if grep -q "force_junior" /proc/cmdline; then
CMDLINE['force_junior']=""

View File

@ -3550,11 +3550,10 @@ function downloadExts() {
TAG=""
if [ "${PRERELEASE}" = "true" ]; then
# TAG="$(curl -skL --connect-timeout 10 "${PROXY}${3}/tags" | pup 'a[class="Link--muted"] attr{href}' | grep ".zip" | head -1)"
TAG="$(curl -skL --connect-timeout 10 "${PROXY}${3}/tags" | grep "/refs/tags/.*\.zip" | sed -E 's/.*\/refs\/tags\/(.*)\.zip.*$/\1/' | sort -rV | head -1)"
TAG="$(curl -skL --connect-timeout 10 "${PROXY}${3}/tags" | grep "/refs/tags/.*\.zip" | sed -E 's/.*\/refs\/tags\/(.*)\.zip.*$/\1/' | sort -rV | head -1 | sed 's/^[v|V]//g')"
else
TAG="$(curl -skL --connect-timeout 10 -w "%{url_effective}" -o /dev/null "${PROXY}${3}/releases/latest" | awk -F'/' '{print $NF}')"
TAG="$(curl -skL --connect-timeout 10 -w "%{url_effective}" -o /dev/null "${PROXY}${3}/releases/latest" | awk -F'/' '{print $NF}' | sed 's/^[v|V]//g')"
fi
[ "${TAG:0:1}" = "v" ] && TAG="${TAG:1}"
if [ "${TAG:-latest}" = "latest" ]; then
MSG="$(printf "%s\n%s:\n%s\n" "$(TEXT "Error checking new version.")" "$(TEXT "Error")" "Tag is ${TAG}")"
DIALOG --title "${T}" \

View File

@ -158,7 +158,7 @@ echo "Create addons.sh" >"${LOG_FILE}"
chmod +x "${RAMDISK_PATH}/addons/addons.sh"
# This order cannot be changed.
for ADDON in "redpill" "revert" "misc" "eudev" "disks" "localrss" "notify" "wol"; do
for ADDON in "redpill" "revert" "misc" "eudev" "netfix" "disks" "localrss" "notify" "wol"; do
PARAMS=""
if [ "${ADDON}" = "disks" ]; then
[ -f "${USER_UP_PATH}/model.dts" ] && cp -f "${USER_UP_PATH}/model.dts" "${RAMDISK_PATH}/addons/model.dts"

View File

@ -71,8 +71,7 @@ while true; do
shift 2
;;
--tag)
TAG="$2"
[ "${TAG:0:1}" = "v" ] && TAG="${TAG:1}"
TAG="$(echo "$2" | sed 's/^[v|V]//g')"
shift 2
;;
--img)
@ -97,8 +96,7 @@ if ! command -v qm >/dev/null 2>&1; then
fi
if [ -z "$TAG" ]; then
TAG="$(curl -skL --connect-timeout 10 -w "%{url_effective}" -o /dev/null "${REPO}/releases/latest" | awk -F'/' '{print $NF}')"
[ "${TAG:0:1}" = "v" ] && TAG="${TAG:1}"
TAG="$(curl -skL --connect-timeout 10 -w "%{url_effective}" -o /dev/null "${REPO}/releases/latest" | awk -F'/' '{print $NF}' | sed 's/^[v|V]//g')"
fi
if [ -n "${IMG}" ] && [ -f "${IMG}" ]; then