From 784bd4f18126905cdcd86b2a62b87c8ce8c39a35 Mon Sep 17 00:00:00 2001 From: AuxXxilium Date: Sat, 15 Jun 2024 13:15:37 +0200 Subject: [PATCH] arc-functions: add sequentialio menu Signed-off-by: AuxXxilium --- files/initrd/opt/arc/arc-functions.sh | 31 +++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/files/initrd/opt/arc/arc-functions.sh b/files/initrd/opt/arc/arc-functions.sh index 09fcdf5d..1ae868ad 100755 --- a/files/initrd/opt/arc/arc-functions.sh +++ b/files/initrd/opt/arc/arc-functions.sh @@ -600,6 +600,37 @@ function storagepanelMenu() { return } +############################################################################### +# Shows storagepanel menu to user +function sequentialIOMenu() { + CONFDONE="$(readConfigKey "arc.confdone" "${USER_CONFIG_FILE}")" + if [ "${CONFDONE}" == "true" ]; then + while true; do + dialog --backtitle "$(backtitle)" --cancel-label "Exit" --menu "SequentialIO" 0 0 0 \ + 1 "Enable for SSD Cache" \ + 2 "Disable for SSD Cache" \ + 2>"${TMP_PATH}/resp" + [ $? -ne 0 ] && break + case "$(cat ${TMP_PATH}/resp)" in + 1) + dialog --backtitle "$(backtitle)" --colors --title "SequentialIO" \ + --msgbox "SequentialIO enabled" 0 0 + SEQUENTIAL="true" + ;; + 2) + dialog --backtitle "$(backtitle)" --colors --title "SequentialIO" \ + --msgbox "SequentialIO disabled" 0 0 + SEQUENTIAL="false" + ;; + esac + done + writeConfigKey "addons.sequentialio" "${SEQUENTIAL}" "${USER_CONFIG_FILE}" + writeConfigKey "arc.builddone" "false" "${USER_CONFIG_FILE}" + BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")" + fi + return +} + ############################################################################### # Shows backup menu to user function backupMenu() {