mirror of
https://github.com/RROrg/rr.git
synced 2025-12-08 21:19:43 +08:00
优化标签提取逻辑,移除版本前缀并统一处理,更新相关脚本和配置文件
This commit is contained in:
parent
ce9017bae1
commit
cdcceea395
5
.github/workflows/data.yml
vendored
5
.github/workflows/data.yml
vendored
@ -41,11 +41,10 @@ jobs:
|
|||||||
TAG=""
|
TAG=""
|
||||||
for i in {1..3}; do
|
for i in {1..3}; do
|
||||||
if [ "${PRERELEASE}" = "true" ]; then
|
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
|
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
|
fi
|
||||||
[ "${TAG:0:1}" = "v" ] && TAG="${TAG:1}"
|
|
||||||
rm -f rr-${TAG}.img.zip
|
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")
|
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
|
if [ $? -eq 0 ] && [ ${STATUS:-0} -eq 200 ]; then
|
||||||
|
|||||||
5
.github/workflows/issues.yml
vendored
5
.github/workflows/issues.yml
vendored
@ -161,11 +161,10 @@ jobs:
|
|||||||
|
|
||||||
TAG=""
|
TAG=""
|
||||||
if [ "${PRERELEASE}" = "true" ]; then
|
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
|
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
|
fi
|
||||||
[ "${TAG:0:1}" = "v" ] && TAG="${TAG:1}"
|
|
||||||
rm -f rr-${TAG}.img.zip
|
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")
|
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
|
if [ $? -ne 0 ] || [ ${STATUS:-0} -ne 200 ]; then
|
||||||
|
|||||||
@ -61,6 +61,7 @@ If you cannot connect to the Internet, please build a pre-compiled bootloader th
|
|||||||
BOOT: ""
|
BOOT: ""
|
||||||
RAM_SIZE: "4G" # >= 4G recommended for DSM
|
RAM_SIZE: "4G" # >= 4G recommended for DSM
|
||||||
CPU_CORES: "2"
|
CPU_CORES: "2"
|
||||||
|
DISK_FMT: "qcow2"
|
||||||
DISK_TYPE: "sata"
|
DISK_TYPE: "sata"
|
||||||
DISK_SIZE: "32G" # data disk size
|
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"
|
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"
|
||||||
|
|||||||
@ -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
|
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.")"
|
[ -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
|
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
|
fi
|
||||||
|
|
||||||
if checkBIOS_VT_d && [ "$(echo "${KVER:-4}" | cut -d'.' -f1)" -lt 5 ]; then
|
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)))"
|
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
|
# set fixed cmdline
|
||||||
if grep -q "force_junior" /proc/cmdline; then
|
if grep -q "force_junior" /proc/cmdline; then
|
||||||
CMDLINE['force_junior']=""
|
CMDLINE['force_junior']=""
|
||||||
|
|||||||
@ -3550,11 +3550,10 @@ function downloadExts() {
|
|||||||
TAG=""
|
TAG=""
|
||||||
if [ "${PRERELEASE}" = "true" ]; then
|
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" | 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
|
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
|
fi
|
||||||
[ "${TAG:0:1}" = "v" ] && TAG="${TAG:1}"
|
|
||||||
if [ "${TAG:-latest}" = "latest" ]; then
|
if [ "${TAG:-latest}" = "latest" ]; then
|
||||||
MSG="$(printf "%s\n%s:\n%s\n" "$(TEXT "Error checking new version.")" "$(TEXT "Error")" "Tag is ${TAG}")"
|
MSG="$(printf "%s\n%s:\n%s\n" "$(TEXT "Error checking new version.")" "$(TEXT "Error")" "Tag is ${TAG}")"
|
||||||
DIALOG --title "${T}" \
|
DIALOG --title "${T}" \
|
||||||
|
|||||||
@ -158,7 +158,7 @@ echo "Create addons.sh" >"${LOG_FILE}"
|
|||||||
chmod +x "${RAMDISK_PATH}/addons/addons.sh"
|
chmod +x "${RAMDISK_PATH}/addons/addons.sh"
|
||||||
|
|
||||||
# This order cannot be changed.
|
# 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=""
|
PARAMS=""
|
||||||
if [ "${ADDON}" = "disks" ]; then
|
if [ "${ADDON}" = "disks" ]; then
|
||||||
[ -f "${USER_UP_PATH}/model.dts" ] && cp -f "${USER_UP_PATH}/model.dts" "${RAMDISK_PATH}/addons/model.dts"
|
[ -f "${USER_UP_PATH}/model.dts" ] && cp -f "${USER_UP_PATH}/model.dts" "${RAMDISK_PATH}/addons/model.dts"
|
||||||
|
|||||||
@ -71,8 +71,7 @@ while true; do
|
|||||||
shift 2
|
shift 2
|
||||||
;;
|
;;
|
||||||
--tag)
|
--tag)
|
||||||
TAG="$2"
|
TAG="$(echo "$2" | sed 's/^[v|V]//g')"
|
||||||
[ "${TAG:0:1}" = "v" ] && TAG="${TAG:1}"
|
|
||||||
shift 2
|
shift 2
|
||||||
;;
|
;;
|
||||||
--img)
|
--img)
|
||||||
@ -97,8 +96,7 @@ if ! command -v qm >/dev/null 2>&1; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "$TAG" ]; then
|
if [ -z "$TAG" ]; then
|
||||||
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')"
|
||||||
[ "${TAG:0:1}" = "v" ] && TAG="${TAG:1}"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "${IMG}" ] && [ -f "${IMG}" ]; then
|
if [ -n "${IMG}" ] && [ -f "${IMG}" ]; then
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user