From 3ad6ba68a69a0db5862ae6bf700e8175e966402e Mon Sep 17 00:00:00 2001 From: Ing Date: Wed, 24 Sep 2025 14:02:44 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=84=9A=E6=9C=AC=EF=BC=8C?= =?UTF-8?q?=E7=AE=80=E5=8C=96=E6=9D=A1=E4=BB=B6=E5=88=A4=E6=96=AD=EF=BC=8C?= =?UTF-8?q?=E7=A7=BB=E9=99=A4=E4=B8=8D=E5=BF=85=E8=A6=81=E7=9A=84=20LOCALB?= =?UTF-8?q?UILD=20=E6=A3=80=E6=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/data.yml | 31 +++++++++++++------------ files/initrd/opt/rr/boot.sh | 6 ++--- files/initrd/opt/rr/init.sh | 15 +++++-------- files/initrd/opt/rr/menu.sh | 45 ++++++++++++++++--------------------- 4 files changed, 44 insertions(+), 53 deletions(-) diff --git a/.github/workflows/data.yml b/.github/workflows/data.yml index 97ed1d6d..a6d5b2d0 100644 --- a/.github/workflows/data.yml +++ b/.github/workflows/data.yml @@ -38,7 +38,7 @@ jobs: echo "Delaying for 1 minutes..." sleep 60 - - name: Get Release RR + - name: Get Data run: | REPO="${{ github.server_url }}/${{ github.repository }}" PRERELEASE="true" @@ -57,18 +57,17 @@ jobs: exit 1 fi - unzip rr-${TAG}.img.zip -d "rr" + unzip rr-${TAG}.img.zip -d rr rr.img - export TERM=xterm + . scripts/func.sh "${{ secrets.RRORG }}" - sudo ./localbuild.sh create rr/ws rr/rr.img - if [ $? -ne 0 ]; then - echo "create failed" - exit 1 - fi + LOOPX=$(sudo losetup -f) + sudo losetup -P "${LOOPX}" "rr/rr.img" + rm -rf "/tmp/mnt/p3" + mkdir -p "/tmp/mnt/p3" + mount "${LOOPX}p3" "/tmp/mnt/p3" + unpackInitrd /tmp/mnt/p3/initrd-rr "rr/initrd" - - name: Get data - run: | sudo apt update sudo apt install -y locales busybox dialog gettext sed gawk jq curl sudo apt install -y python-is-python3 python3-pip libelf-dev qemu-utils cpio xz-utils lz4 lzma bzip2 gzip zstd @@ -78,10 +77,14 @@ jobs: sudo mv -f "$(realpath $(which python3))/EXTERNALLY-MANAGED" "$(realpath $(which python3))/EXTERNALLY-MANAGED.bak" 2>/dev/null || true sudo pip3 install -U -r scripts/requirements.txt - python3 scripts/func.py getmodels -w "rr/ws/initrd" -j "docs/models.json" -x "docs/models.xlsx" - python3 scripts/func.py getpats -w "rr/ws/initrd" -j "docs/pats.json" -x "docs/pats.xlsx" - python3 scripts/func.py getaddons -w "rr/ws" -j "docs/addons.json" -x "docs/addons.xlsx" - python3 scripts/func.py getmodules -w "rr/ws" -j "docs/modules.json" -x "docs/modules.xlsx" + python3 scripts/func.py getmodels -w "rr/initrd" -j "docs/models.json" -x "docs/models.xlsx" + python3 scripts/func.py getpats -w "rr/initrd" -j "docs/pats.json" -x "docs/pats.xlsx" + python3 scripts/func.py getaddons -w "/tmp" -j "docs/addons.json" -x "docs/addons.xlsx" + python3 scripts/func.py getmodules -w "/tmp" -j "docs/modules.json" -x "docs/modules.xlsx" + + sudo umount "/tmp/mnt/p3" + sudo losetup -d "${LOOPX}" + rm -rf "/tmp/mnt/p3" - name: Upload to Artifacts if: success() diff --git a/files/initrd/opt/rr/boot.sh b/files/initrd/opt/rr/boot.sh index c9fd5d57..c34464fd 100755 --- a/files/initrd/opt/rr/boot.sh +++ b/files/initrd/opt/rr/boot.sh @@ -363,7 +363,7 @@ if [ "${DIRECT}" = "true" ] || [ "${MEV:-physical}" = "parallels" ]; then _bootwait || exit 0 printf "\033[1;33m%s\033[0m\n" "$(TEXT "Reboot to boot directly in DSM")" - [ ! -f "/.dockerenv" ] && [ ! "LOCALBUILD" = "${LOADER_DISK}" ] && reboot + [ ! -f "/.dockerenv" ] && reboot exit 0 else rm -f "${USER_RSYSENVFILE}" 2>/dev/null || true @@ -390,7 +390,7 @@ else printf "." sleep 1 done - if [ ! -f "/.dockerenv" ] && [ ! "LOCALBUILD" = "${LOADER_DISK}" ]; then + if [ ! -f "/.dockerenv" ]; then [ ! -f /var/run/dhcpcd/pid ] && /etc/init.d/S41dhcpcd restart >/dev/null 2>&1 || true fi printf "$(TEXT "Waiting IP.\n")" @@ -464,7 +464,7 @@ else fi done - if [ ! -f "/.dockerenv" ] && [ ! "LOCALBUILD" = "${LOADER_DISK}" ]; then + if [ ! -f "/.dockerenv" ]; then # Disconnect wireless lsmod | grep -q iwlwifi && for F in /sys/class/net/wlan*; do [ ! -e "${F}" ] && continue diff --git a/files/initrd/opt/rr/init.sh b/files/initrd/opt/rr/init.sh index 78e27f37..c59aafb9 100755 --- a/files/initrd/opt/rr/init.sh +++ b/files/initrd/opt/rr/init.sh @@ -94,7 +94,7 @@ fi initConfigKey "modules" "{}" "${USER_CONFIG_FILE}" initConfigKey "modblacklist" "evbug,cdc_ether" "${USER_CONFIG_FILE}" -if [ ! -f "/.dockerenv" ] && [ ! "LOCALBUILD" = "${LOADER_DISK}" ]; then +if [ ! -f "/.dockerenv" ]; then if arrayExistItem "sortnetif:" "$(readConfigMap "addons" "${USER_CONFIG_FILE}")"; then _sort_netif "$(readConfigKey "addons.sortnetif" "${USER_CONFIG_FILE}")" fi @@ -138,12 +138,7 @@ if [ "${BUS}" = "usb" ]; then elif [ "${BUS}" = "docker" ]; then TYPE="PC" elif ! echo "${BUSLIST}" | grep -wq "${BUS}"; then - if [ "LOCALBUILD" = "${LOADER_DISK}" ]; then - echo "LOCALBUILD MODE" - TYPE="PC" - else - die "$(printf "$(TEXT "The loader disk does not support the current %s, only %s DoM is supported.")" "${BUS}" "${BUSLIST// /\/}")" - fi + die "$(printf "$(TEXT "The loader disk does not support the current %s, only %s DoM is supported.")" "${BUS}" "${BUSLIST// /\/}")" fi # Save variables to user config file @@ -205,7 +200,7 @@ while [ ${COUNT} -lt 30 ]; do sleep 1 done -if [ ! -f "/.dockerenv" ] && [ ! "LOCALBUILD" = "${LOADER_DISK}" ]; then +if [ ! -f "/.dockerenv" ]; then [ ! -f /var/run/dhcpcd/pid ] && /etc/init.d/S41dhcpcd restart >/dev/null 2>&1 || true fi @@ -262,7 +257,7 @@ fi printf "\n" DSMLOGO="$(readConfigKey "dsmlogo" "${USER_CONFIG_FILE}")" -if [ "${DSMLOGO}" = "true" ] && [ -c "/dev/fb0" ] && [ ! -f "/.dockerenv" ] && [ ! "LOCALBUILD" = "${LOADER_DISK}" ]; then +if [ "${DSMLOGO}" = "true" ] && [ -c "/dev/fb0" ] && [ ! -f "/.dockerenv" ]; then IP="$(getIP)" echo "${IP}" | grep -q "^169\.254\." && IP="" [ -n "${IP}" ] && URL="http://${IP}:${TTYD:-7681}" || URL="http://rr:${TTYD:-7681}" @@ -273,7 +268,7 @@ if [ "${DSMLOGO}" = "true" ] && [ -c "/dev/fb0" ] && [ ! -f "/.dockerenv" ] && [ [ -f "${TMP_PATH}/qrcode_qhxg.png" ] && echo | fbv -acufi "${TMP_PATH}/qrcode_qhxg.png" >/dev/null 2>&1 || true fi WEBHOOKURL="$(readConfigKey "webhookurl" "${USER_CONFIG_FILE}")" -if [ -n "${WEBHOOKURL}" ] && [ ! -f "${TMP_PATH}/WebhookSent" ] && [ ! -f "/.dockerenv" ] && [ ! "LOCALBUILD" = "${LOADER_DISK}" ]; then +if [ -n "${WEBHOOKURL}" ] && [ ! -f "${TMP_PATH}/WebhookSent" ] && [ ! -f "/.dockerenv" ]; then DMI="$(dmesg 2>/dev/null | grep -i "DMI:" | head -1 | sed 's/\[.*\] DMI: //i')" IP="$(getIP)" echo "${IP}" | grep -q "^169\.254\." && IP="" diff --git a/files/initrd/opt/rr/menu.sh b/files/initrd/opt/rr/menu.sh index 33a12a1c..02c59fb2 100755 --- a/files/initrd/opt/rr/menu.sh +++ b/files/initrd/opt/rr/menu.sh @@ -130,9 +130,6 @@ fi # Mounts backtitle dynamically function backtitle() { BACKTITLE="" - if [ "LOCALBUILD" = "${LOADER_DISK}" ]; then - BACKTITLE="LOCAL " - fi BACKTITLE+="${RR_TITLE}${RR_RELEASE:+(${RR_RELEASE})}" if [ -n "${MODEL}" ]; then BACKTITLE+=" ${MODEL}(${PLATFORM})" @@ -3146,19 +3143,17 @@ function advancedMenu() { if [ -n "$(ls /dev/mmcblk* 2>/dev/null)" ]; then echo "b \"$(TEXT "Use EMMC as the system disk:") \Z4${EMMCBOOT}\Zn\"" fi - if [ ! "LOCALBUILD" = "${LOADER_DISK}" ]; then - echo "s \"$(TEXT "Show disks information")\"" - echo "t \"$(TEXT "Mounting DSM storage pool")\"" - echo "f \"$(TEXT "Format disk(s) # Without loader disk")\"" - echo "g \"$(TEXT "Download DSM config backup files")\"" - echo "a \"$(TEXT "Allow downgrade installation")\"" - echo "x \"$(TEXT "Reset DSM system password")\"" - echo "y \"$(TEXT "Add a new user to DSM system")\"" - echo "z \"$(TEXT "Force enable Telnet&SSH of DSM system")\"" - echo "o \"$(TEXT "Remove the blocked IP database of DSM")\"" - echo "q \"$(TEXT "Disable all scheduled tasks of DSM")\"" - echo "r \"$(TEXT "Initialize DSM network settings")\"" - fi + echo "s \"$(TEXT "Show disks information")\"" + echo "t \"$(TEXT "Mounting DSM storage pool")\"" + echo "f \"$(TEXT "Format disk(s) # Without loader disk")\"" + echo "g \"$(TEXT "Download DSM config backup files")\"" + echo "a \"$(TEXT "Allow downgrade installation")\"" + echo "x \"$(TEXT "Reset DSM system password")\"" + echo "y \"$(TEXT "Add a new user to DSM system")\"" + echo "z \"$(TEXT "Force enable Telnet&SSH of DSM system")\"" + echo "o \"$(TEXT "Remove the blocked IP database of DSM")\"" + echo "q \"$(TEXT "Disable all scheduled tasks of DSM")\"" + echo "r \"$(TEXT "Initialize DSM network settings")\"" echo "e \"$(TEXT "Exit")\"" } >"${TMP_PATH}/menu" @@ -3394,16 +3389,14 @@ function settingsMenu() { echo "p \"$(TEXT "Custom patch script # Developer")\"" echo "u \"$(TEXT "Edit user config file manually")\"" echo "g \"$(TEXT "Edit grub.cfg file manually")\"" - if [ ! "LOCALBUILD" = "${LOADER_DISK}" ]; then - echo "r \"$(TEXT "Try to recovery a installed DSM system")\"" - echo "c \"$(TEXT "Clone bootloader disk to another disk")\"" - echo "q \"$(TEXT "System Environment Report")\"" - echo "v \"$(TEXT "Report bugs to the author")\"" - echo "d \"$(TEXT "Install development tools")\"" - echo "s \"$(TEXT "Save modifications of '/opt/rr'")\"" - echo "i \"$(TEXT "Set static IP")\"" - echo "w \"$(TEXT "Set wireless account")\"" - fi + echo "r \"$(TEXT "Try to recovery a installed DSM system")\"" + echo "c \"$(TEXT "Clone bootloader disk to another disk")\"" + echo "q \"$(TEXT "System Environment Report")\"" + echo "v \"$(TEXT "Report bugs to the author")\"" + echo "d \"$(TEXT "Install development tools")\"" + echo "s \"$(TEXT "Save modifications of '/opt/rr'")\"" + echo "i \"$(TEXT "Set static IP")\"" + echo "w \"$(TEXT "Set wireless account")\"" echo "1 \"$(TEXT "Set global proxy")\"" echo "2 \"$(TEXT "Set github proxy")\"" UPDMC="$([ -f "${MC_RAMDISK_FILE}" ] && echo "true" || echo "false")"