From db28065b211808448f4b04e2fc3846bfa7040704 Mon Sep 17 00:00:00 2001 From: Fabio Belavenuto Date: Fri, 20 Jan 2023 14:58:39 -0300 Subject: [PATCH] Improving DSM boot --- VERSION | 2 +- files/board/arpl/overlayfs/opt/arpl/boot.sh | 12 ++++-------- .../board/arpl/overlayfs/opt/arpl/include/consts.sh | 2 +- files/board/arpl/overlayfs/opt/arpl/init.sh | 4 +++- files/board/arpl/overlayfs/opt/arpl/menu.sh | 5 ++--- files/board/arpl/p1/ARPL-VERSION | 2 +- 6 files changed, 12 insertions(+), 15 deletions(-) diff --git a/VERSION b/VERSION index b766899a..13cc17b5 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.0-beta12 +1.0-beta13 diff --git a/files/board/arpl/overlayfs/opt/arpl/boot.sh b/files/board/arpl/overlayfs/opt/arpl/boot.sh index fd125580..93384239 100755 --- a/files/board/arpl/overlayfs/opt/arpl/boot.sh +++ b/files/board/arpl/overlayfs/opt/arpl/boot.sh @@ -18,9 +18,6 @@ printf "\033[1;44m%*s\033[0m\n" ${COLUMNS} "" TITLE="BOOTING..." printf "\033[1;33m%*s\033[0m\n" $(((${#TITLE}+${COLUMNS})/2)) "${TITLE}" -history -w -sync - # Check if DSM zImage changed, patch it if necessary ZIMAGE_HASH="`readConfigKey "zimage-hash" "${USER_CONFIG_FILE}"`" if [ "`sha256sum "${ORI_ZIMAGE_FILE}" | awk '{print$1}'`" != "${ZIMAGE_HASH}" ]; then @@ -29,7 +26,7 @@ if [ "`sha256sum "${ORI_ZIMAGE_FILE}" | awk '{print$1}'`" != "${ZIMAGE_HASH}" ]; if [ $? -ne 0 ]; then dialog --backtitle "`backtitle`" --title "Error" \ --msgbox "zImage not patched:\n`<"${LOG_FILE}"`" 12 70 - return 1 + exit 1 fi fi @@ -41,7 +38,7 @@ if [ "`sha256sum "${ORI_RDGZ_FILE}" | awk '{print$1}'`" != "${RAMDISK_HASH}" ]; if [ $? -ne 0 ]; then dialog --backtitle "`backtitle`" --title "Error" \ --msgbox "Ramdisk not patched:\n`<"${LOG_FILE}"`" 12 70 - return 1 + exit 1 fi fi @@ -142,8 +139,7 @@ if [ "${DIRECT}" = "true" ]; then echo -e "\033[1;33mReboot to boot directly in DSM\033[0m" grub-editenv ${GRUB_PATH}/grubenv set next_entry="direct" reboot - sleep 100 - exit + exit 0 fi echo -e "\033[1;37mLoading DSM kernel...\033[0m" @@ -156,4 +152,4 @@ else fi echo -e "\033[1;37mBooting...\033[0m" poweroff -while true; do sleep 1; done # infinity loop +exit 0 diff --git a/files/board/arpl/overlayfs/opt/arpl/include/consts.sh b/files/board/arpl/overlayfs/opt/arpl/include/consts.sh index f58eff09..5d4525d4 100644 --- a/files/board/arpl/overlayfs/opt/arpl/include/consts.sh +++ b/files/board/arpl/overlayfs/opt/arpl/include/consts.sh @@ -1,5 +1,5 @@ -ARPL_VERSION="1.0-beta12" +ARPL_VERSION="1.0-beta13" # Define paths TMP_PATH="/tmp" diff --git a/files/board/arpl/overlayfs/opt/arpl/init.sh b/files/board/arpl/overlayfs/opt/arpl/init.sh index fec5a868..3e3dca7e 100755 --- a/files/board/arpl/overlayfs/opt/arpl/init.sh +++ b/files/board/arpl/overlayfs/opt/arpl/init.sh @@ -158,7 +158,9 @@ elif grep -q "IWANTTOCHANGETHECONFIG" /proc/cmdline; then fi # If is to boot automatically, do it -[ ${BOOT} -eq 1 ] && boot.sh +if [ ${BOOT} -eq 1 ]; then + boot.sh && exit 0 +fi # Wait for an IP COUNT=0 diff --git a/files/board/arpl/overlayfs/opt/arpl/menu.sh b/files/board/arpl/overlayfs/opt/arpl/menu.sh index b7bb433e..621f0c65 100755 --- a/files/board/arpl/overlayfs/opt/arpl/menu.sh +++ b/files/board/arpl/overlayfs/opt/arpl/menu.sh @@ -1162,7 +1162,7 @@ function updateMenu() { if [ "x$1" = "xb" -a -n "${MODEL}" -a -n "${BUILD}" -a loaderIsConfigured ]; then make - boot + boot && exit 0 || sleep 5 fi # Main loop NEXT="m" @@ -1206,7 +1206,7 @@ while true; do i) synoinfoMenu; NEXT="v" ;; v) advancedMenu; NEXT="d" ;; d) make; NEXT="b" ;; - b) boot ;; + b) boot && exit 0 || sleep 5 ;; k) keymapMenu ;; c) dialog --backtitle "`backtitle`" --title "Cleaning" --aspect 18 \ --prgbox "rm -rfv \"${CACHE_PATH}/dl\"" 0 0 ;; @@ -1216,4 +1216,3 @@ while true; do done clear echo -e "Call \033[1;32mmenu.sh\033[0m to return to menu" - diff --git a/files/board/arpl/p1/ARPL-VERSION b/files/board/arpl/p1/ARPL-VERSION index b766899a..13cc17b5 100644 --- a/files/board/arpl/p1/ARPL-VERSION +++ b/files/board/arpl/p1/ARPL-VERSION @@ -1 +1 @@ -1.0-beta12 +1.0-beta13