From 820268107df94f01c74d36b8b1c19595cd24066e Mon Sep 17 00:00:00 2001 From: AuxXxilium Date: Tue, 23 Apr 2024 16:35:38 +0200 Subject: [PATCH] boot: reorder things Signed-off-by: AuxXxilium --- files/initrd/opt/arc/boot.sh | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/files/initrd/opt/arc/boot.sh b/files/initrd/opt/arc/boot.sh index 470fa95b..5ddd0046 100755 --- a/files/initrd/opt/arc/boot.sh +++ b/files/initrd/opt/arc/boot.sh @@ -81,7 +81,6 @@ fi VID="$(readConfigKey "vid" "${USER_CONFIG_FILE}")" PID="$(readConfigKey "pid" "${USER_CONFIG_FILE}")" SN="$(readConfigKey "arc.sn" "${USER_CONFIG_FILE}")" -KERNELLOAD="$(readConfigKey "arc.kernelload" "${USER_CONFIG_FILE}")" KERNELPANIC="$(readConfigKey "arc.kernelpanic" "${USER_CONFIG_FILE}")" DIRECTBOOT="$(readConfigKey "arc.directboot" "${USER_CONFIG_FILE}")" EMMCBOOT="$(readConfigKey "arc.emmcboot" "${USER_CONFIG_FILE}")" @@ -181,6 +180,7 @@ if [ "${DIRECTBOOT}" = "true" ]; then grub-editenv ${GRUB_PATH}/grubenv set next_entry="direct" echo -e "\033[1;34mReboot with Directboot\033[0m" exec reboot + exit 0 elif [ "${DIRECTBOOT}" = "false" ]; then BOOTIPWAIT="$(readConfigKey "arc.bootipwait" "${USER_CONFIG_FILE}")" echo -e "\033[1;34mDetected ${NIC} NIC.\033[0m \033[1;37mWaiting for Connection:\033[0m" @@ -228,19 +228,21 @@ elif [ "${DIRECTBOOT}" = "false" ]; then done rm -f WB WC echo -en "\r$(printf "%$((${#MSG} * 2))s" " ")\n" + echo -e "\033[1;37mLoading DSM kernel...\033[0m" # Executes DSM kernel via KEXEC - kexec -l "${MOD_ZIMAGE_FILE}" --initrd "${MOD_RDGZ_FILE}" --command-line="${CMDLINE_LINE}" >"${LOG_FILE}" 2>&1 || dieLog + KEXECARGS="" + kexec ${KEXECARGS} -l "${MOD_ZIMAGE_FILE}" --initrd "${MOD_RDGZ_FILE}" --command-line="${CMDLINE_LINE}" >"${LOG_FILE}" 2>&1 || dieLog echo -e "\033[1;37m"Booting DSM..."\033[0m" - for T in $(w | grep -v "TTY" | awk -F' ' '{print $2}') - do - echo -e "\n\033[1;37mThis interface will not be operational. Wait a few minutes.\033[0m\nUse \033[1;34mhttp://${IPCON}:5000\033[0m or try \033[1;34mhttp://find.synology.com/ \033[0mto find DSM and proceed.\n" >"/dev/${T}" 2>/dev/null || true + for T in $(w | grep -v "TTY" | awk -F' ' '{print $2}'); do + [ -w "/dev/${T}" ] && echo -e "\n\033[1;37mThis interface will not be operational. Wait a few minutes.\033[0m\nUse \033[1;34mhttp://${IPCON}:5000\033[0m or try \033[1;34mhttp://find.synology.com/ \033[0mto find DSM and proceed.\n" >"/dev/${T}" 2>/dev/null || true done # Clear logs for dbgutils addons rm -rf "${PART1_PATH}/logs" >/dev/null 2>&1 || true + KERNELLOAD="$(readConfigKey "arc.kernelload" "${USER_CONFIG_FILE}")" [ "${KERNELLOAD}" = "kexec" ] && kexec -i -a -e || poweroff exit 0 fi \ No newline at end of file