From bd2fc25b6f18e0884281fef3cc5deb6a402bb6f7 Mon Sep 17 00:00:00 2001 From: AuxXxilium Date: Fri, 2 Feb 2024 20:20:05 +0100 Subject: [PATCH] arc: add DSM force Reinstall to menu Signed-off-by: AuxXxilium --- files/initrd/opt/arc/arc.sh | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/files/initrd/opt/arc/arc.sh b/files/initrd/opt/arc/arc.sh index 361e5f59..db370955 100755 --- a/files/initrd/opt/arc/arc.sh +++ b/files/initrd/opt/arc/arc.sh @@ -2810,18 +2810,36 @@ function greplogs() { --msgbox "Logs can be found at /tmp/log.tar.gz" 5 40 } +############################################################################### +# Calls boot.sh to boot into DSM Recovery +function juniorboot() { + BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")" + [ "${BUILDDONE}" = "false" ] && dialog --backtitle "$(backtitle)" --title "Alert" \ + --yesno "Config changed, please build Loader first." 0 0 + if [ $? -eq 0 ]; then + make + fi + grub-editenv ${GRUB_PATH}/grubenv set next_entry="junior" + writeConfigKey "arc.bootcount" "0" "${USER_CONFIG_FILE}" + dialog --backtitle "$(backtitle)" --title "Arc Boot" \ + --infobox "Booting DSM Recovery...\nPlease stay patient!" 4 30 + sleep 2 + exec reboot +} + ############################################################################### # Calls boot.sh to boot into DSM kernel/ramdisk function boot() { BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")" [ "${BUILDDONE}" = "false" ] && dialog --backtitle "$(backtitle)" --title "Alert" \ - --yesno "Config changed, you need to rebuild the loader?" 0 0 + --yesno "Config changed, you need to rebuild the Loader?" 0 0 if [ $? -eq 0 ]; then make fi + grub-editenv ${GRUB_PATH}/grubenv set next_entry="boot" writeConfigKey "arc.bootcount" "0" "${USER_CONFIG_FILE}" dialog --backtitle "$(backtitle)" --title "Arc Boot" \ - --infobox "Booting to DSM...\nPlease stay patient!" 4 25 + --infobox "Booting DSM...\nPlease stay patient!" 4 25 sleep 2 exec reboot } @@ -2918,6 +2936,7 @@ while true; do echo "v \"Save Modifications to Disk \" " >>"${TMP_PATH}/menu" echo "n \"Edit Grub Config \" " >>"${TMP_PATH}/menu" echo "w \"Reset Loader \" " >>"${TMP_PATH}/menu" + echo "J \"DSM force Reinstall \" " >>"${TMP_PATH}/menu" echo "F \"\Z1Format Sata/NVMe Disk\Zn \" " >>"${TMP_PATH}/menu" echo "L \"Grep Logs from dbgutils \" " >>"${TMP_PATH}/menu" fi @@ -3041,6 +3060,7 @@ while true; do v) saveMenu; NEXT="v" ;; n) editGrubCfg; NEXT="n" ;; w) resetLoader; NEXT="w" ;; + J) juniorboot; NEXT="J" ;; F) formatdisks; NEXT="F" ;; L) greplogs; NEXT="L" ;; # Loader Settings