From 9287f177666674bd683e9800126b11062008e685 Mon Sep 17 00:00:00 2001 From: AuxXxilium Date: Sat, 25 Jan 2025 20:34:38 +0100 Subject: [PATCH 1/2] arc: more work Signed-off-by: AuxXxilium --- files/initrd/opt/arc/arc-functions.sh | 18 ++++++++++++------ files/initrd/opt/arc/arc.sh | 11 +++++------ 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/files/initrd/opt/arc/arc-functions.sh b/files/initrd/opt/arc/arc-functions.sh index 8c78b32c..f43e4d91 100755 --- a/files/initrd/opt/arc/arc-functions.sh +++ b/files/initrd/opt/arc/arc-functions.sh @@ -1864,7 +1864,7 @@ function loaderPorts() { 2>"${TMP_PATH}/resp" RET=$? case ${RET} in - 0) # ok-button + 0) HTTP=$(sed -n '1p' "${TMP_PATH}/resp" 2>/dev/null) DUFS=$(sed -n '2p' "${TMP_PATH}/resp" 2>/dev/null) TTYD=$(sed -n '3p' "${TMP_PATH}/resp" 2>/dev/null) @@ -1961,19 +1961,25 @@ function disablescheduledTasks { for I in ${DSMROOTS}; do # fixDSMRootPart "${I}" mount -t ext4 "${I}" "${TMP_PATH}/mdX" - [ $? -ne 0 ] && continue + if [ $? -ne 0 ]; then + continue + fi if [ -f "${TMP_PATH}/mdX/usr/syno/etc/esynoscheduler/esynoscheduler.db" ]; then - echo "UPDATE task SET enable = 0;" | sqlite3 ${TMP_PATH}/mdX/usr/syno/etc/esynoscheduler/esynoscheduler.db + echo "UPDATE task SET enable = 0;" | sqlite3 "${TMP_PATH}/mdX/usr/syno/etc/esynoscheduler/esynoscheduler.db" sync - echo "true" >${TMP_PATH}/isEnable + echo "true" > "${TMP_PATH}/isEnable" fi umount "${TMP_PATH}/mdX" done rm -rf "${TMP_PATH}/mdX" ) 2>&1 | dialog --backtitle "$(backtitle)" --title "Scheduled Tasks" \ --progressbox "Modifying..." 20 100 - [ "$(cat ${TMP_PATH}/isEnable 2>/dev/null)" = "true" ] && MSG="Disable all scheduled tasks successful." || MSG="Disable all scheduled tasks failed." - dialog --backtitle "$(backtitle)" --title Scheduled Tasks \ + if [ "$(cat ${TMP_PATH}/isEnable 2>/dev/null)" = "true" ]; then + MSG="Disable all scheduled tasks successful." + else + MSG="Disable all scheduled tasks failed." + fi + dialog --backtitle "$(backtitle)" --title "Scheduled Tasks" \ --msgbox "${MSG}" 0 0 return } diff --git a/files/initrd/opt/arc/arc.sh b/files/initrd/opt/arc/arc.sh index f89fde91..c3ed5d6e 100755 --- a/files/initrd/opt/arc/arc.sh +++ b/files/initrd/opt/arc/arc.sh @@ -751,9 +751,9 @@ elif [ "${ARCMODE}" = "automated" ]; then make fi elif [ "${ARCMODE}" = "config" ]; then + [ "${CONFDONE}" = "true" ] && NEXT="2" || NEXT="1" + [ "${BUILDDONE}" = "true" ] && NEXT="3" || NEXT="1" while true; do - [ "${CONFDONE}" = "true" ] && NEXT="2" || NEXT="1" - [ "${BUILDDONE}" = "true" ] && NEXT="3" || NEXT="1" rm -f "${TMP_PATH}/menu" "${TMP_PATH}/resp" >/dev/null 2>&1 || true write_menu "=" "\Z4===== Main =====\Zn" @@ -779,7 +779,6 @@ elif [ "${ARCMODE}" = "config" ]; then write_menu "=" "\Z4===== Info =====\Zn" write_menu "a" "Sysinfo" write_menu "A" "Networkdiag" - write_menu "=" "\Z4===== System ====\Zn" if [ "${CONFDONE}" = "true" ]; then if [ "${ARCOPTS}" = "true" ]; then @@ -806,9 +805,9 @@ elif [ "${ARCMODE}" = "config" ]; then for addon in "cpufreqscaling" "storagepanel" "sequentialio"; do if readConfigMap "addons" "${USER_CONFIG_FILE}" | grep -q "${addon}"; then case "${addon}" in - "cpufreqscaling") write_menu "g" "Frequency Scaling Governor" ;; - "storagepanel") write_menu "P" "StoragePanel Options" ;; - "sequentialio") write_menu "Q" "SequentialIO Options" ;; + "cpufreqscaling") write_menu "g" "Scaling Governor" ;; + "storagepanel") write_menu "P" "StoragePanel" ;; + "sequentialio") write_menu "Q" "SequentialIO" ;; esac fi done From 72d15f6241321516535f6002815449baaee1f8a2 Mon Sep 17 00:00:00 2001 From: AuxXxilium Date: Mon, 27 Jan 2025 17:47:57 +0100 Subject: [PATCH 2/2] tree: more changes Signed-off-by: AuxXxilium --- files/initrd/opt/arc/arc-functions.sh | 6 +++--- files/initrd/opt/arc/arc.sh | 4 ++-- files/initrd/opt/arc/boot.sh | 3 +++ files/initrd/opt/arc/evo.sh | 4 ++-- files/initrd/opt/arc/init.sh | 2 +- 5 files changed, 11 insertions(+), 8 deletions(-) diff --git a/files/initrd/opt/arc/arc-functions.sh b/files/initrd/opt/arc/arc-functions.sh index f43e4d91..b3b3fb44 100755 --- a/files/initrd/opt/arc/arc-functions.sh +++ b/files/initrd/opt/arc/arc-functions.sh @@ -1855,7 +1855,7 @@ function loaderPorts() { MSG="Modify Ports (0-65535) (Leave empty for default):" unset HTTPPORT DUFSPORT TTYDPORT [ -f "/etc/arc.conf" ] && source "/etc/arc.conf" 2>/dev/null - local HTTP=${HTTPPORT:-8080} + local HTTP=${HTTPPORT:-80} local DUFS=${DUFSPORT:-7304} local TTYD=${TTYDPORT:-7681} while true; do @@ -1876,7 +1876,7 @@ function loaderPorts() { [ $? -eq 0 ] && continue || break fi rm -f "/etc/arc.conf" - [ "${HTTPPORT:-5000}" != "5000" ] && echo "HTTP_PORT=${HTTPPORT}" >>"/etc/arc.conf" + [ "${HTTPPORT:-80}" != "80" ] && echo "HTTP_PORT=${HTTPPORT}" >>"/etc/arc.conf" [ "${DUFSPORT:-7304}" != "7304" ] && echo "DUFS_PORT=${DUFSPORT}" >>"/etc/arc.conf" [ "${TTYDPORT:-7681}" != "7681" ] && echo "TTYD_PORT=${TTYDPORT}" >>"/etc/arc.conf" RDXZ_PATH="${TMP_PATH}/rdxz_tmp" @@ -1931,7 +1931,7 @@ function loaderPorts() { --msgbox "${MSG}" 0 0 rm -f "${TMP_PATH}/restartS.sh" { - [ ! "${HTTP:-8080}" = "${HTTPPORT:-8080}" ] && echo "/etc/init.d/S90thttpd restart" + [ ! "${HTTP:-80}" = "${HTTPPORT:-80}" ] && echo "/etc/init.d/S90thttpd restart" [ ! "${DUFS:-7304}" = "${DUFSPORT:-7304}" ] && echo "/etc/init.d/S99dufs restart" [ ! "${TTYD:-7681}" = "${TTYDPORT:-7681}" ] && echo "/etc/init.d/S99ttyd restart" } >"${TMP_PATH}/restartS.sh" diff --git a/files/initrd/opt/arc/arc.sh b/files/initrd/opt/arc/arc.sh index c3ed5d6e..5b9fb2c6 100755 --- a/files/initrd/opt/arc/arc.sh +++ b/files/initrd/opt/arc/arc.sh @@ -892,7 +892,7 @@ elif [ "${ARCMODE}" = "config" ]; then write_menu "I" "Power/Service Menu" write_menu "V" "Credits" if [ "$TERM" != "xterm-256color" ]; then - WEBCONFIG="Webconfig: http://${IPCON}:5000" + WEBCONFIG="Webconfig: http://${IPCON}${HTTPPORT:+:$HTTPPORT}" else WEBCONFIG="" fi @@ -1071,7 +1071,7 @@ fi # Inform user echo -e "Call \033[1;34marc.sh\033[0m to configure Loader" echo -echo -e "Web Config: \033[1;34mhttp://${IPCON}:${HTTPPORT:-5000}\033[0m" +echo -e "Web Config: \033[1;34mhttp://${IPCON}${HTTPPORT:+:$HTTPPORT}\033[0m" echo echo -e "SSH Access:" echo -e "IP: \033[1;34m${IPCON}\033[0m" diff --git a/files/initrd/opt/arc/boot.sh b/files/initrd/opt/arc/boot.sh index ccdf3185..de4a1f07 100755 --- a/files/initrd/opt/arc/boot.sh +++ b/files/initrd/opt/arc/boot.sh @@ -345,6 +345,9 @@ elif [ "${DIRECTBOOT}" = "false" ]; then [ -f "${TMP_PATH}/qrcode_boot.png" ] && echo | fbv -acufi "${TMP_PATH}/qrcode_boot.png" >/dev/null 2>/dev/null || true fi + # Wait for boot interrupt + _bootwait + for T in $(busybox w 2>/dev/null | grep -v 'TTY' | awk '{print $2}'); do if [ -w "/dev/${T}" ]; then [ -n "${IPCON}" ] && echo -e "Use \033[1;34mhttp://${IPCON}:5000\033[0m or try \033[1;34mhttp://find.synology.com/ \033[0mto find DSM and proceed.\n\n\033[1;37mThis interface will not be operational. Wait a few minutes - Network will be unreachable until DSM boot.\033[0m\n" >"/dev/${T}" 2>/dev/null \ diff --git a/files/initrd/opt/arc/evo.sh b/files/initrd/opt/arc/evo.sh index 69c893a1..efeaf111 100755 --- a/files/initrd/opt/arc/evo.sh +++ b/files/initrd/opt/arc/evo.sh @@ -828,7 +828,7 @@ elif [ "${ARCMODE}" = "config" ]; then EXTRA_LABEL="Boot" fi if [ "$TERM" != "xterm-256color" ]; then - WEBCONFIG="Webconfig: http://${IPCON}:5000" + WEBCONFIG="Webconfig: http://${IPCON}${HTTPPORT:+:$HTTPPORT}" else WEBCONFIG="" fi @@ -931,7 +931,7 @@ fi # Inform user echo -e "Call \033[1;34marc.sh\033[0m to configure Loader" echo -echo -e "Web Config: \033[1;34mhttp://${IPCON}:${HTTPPORT:-5000}\033[0m" +echo -e "Web Config: \033[1;34mhttp://${IPCON}${HTTPPORT:+:$HTTPPORT}\033[0m" echo echo -e "SSH Access:" echo -e "IP: \033[1;34m${IPCON}\033[0m" diff --git a/files/initrd/opt/arc/init.sh b/files/initrd/opt/arc/init.sh index 80c83239..d8e0d85e 100755 --- a/files/initrd/opt/arc/init.sh +++ b/files/initrd/opt/arc/init.sh @@ -221,7 +221,7 @@ touch "${HOME}/.initialized" # Load Arc Overlay echo -e "\033[1;34mLoading Arc Overlay...\033[0m" echo -echo -e "Use \033[1;34mDisplay Output\033[0m or \033[1;34mhttp://${IPCON}:${HTTPPORT:-5000}\033[0m to configure Loader." +echo -e "Use \033[1;34mDisplay Output\033[0m or \033[1;34mhttp://${IPCON}${HTTPPORT:+:$HTTPPORT}\033[0m to configure Loader." # Check memory and load Arc RAM=$(awk '/MemTotal:/ {printf "%.0f", $2 / 1024}' /proc/meminfo 2>/dev/null)