From 070e89430c138a395afe06fe2ccb4f3f9dc75028 Mon Sep 17 00:00:00 2001 From: AuxXxilium Date: Wed, 21 Feb 2024 20:31:20 +0100 Subject: [PATCH] Revert "boot/init: remove sata disk warning" This reverts commit 0aa465d03a91a73c361a11cd05cdeba54c4b3d38. --- files/initrd/opt/arc/boot.sh | 11 +++++++++++ files/initrd/opt/arc/init.sh | 13 +++++++++++++ 2 files changed, 24 insertions(+) diff --git a/files/initrd/opt/arc/boot.sh b/files/initrd/opt/arc/boot.sh index 58e2fc69..59d10003 100755 --- a/files/initrd/opt/arc/boot.sh +++ b/files/initrd/opt/arc/boot.sh @@ -79,6 +79,17 @@ if [[ ! -f "${MODEL_CONFIG_PATH}/${MODEL}.yml" || -z "$(readModelKey "${MODEL}" exit 1 fi +# Diskcheck +HASATA=0 +for D in $(lsblk -dpno NAME); do + [ "${D}" = "${LOADER_DISK}" ] && continue + if [[ "$(getBus "${D}")" = "sata" || "$(getBus "${D}")" = "scsi" ]]; then + HASATA=1 + break + fi +done +[ ${HASATA} = "0" ] && echo -e "\033[1;31m*** Please insert at least one Sata/SAS Disk for System Installation, except for the Bootloader Disk. ***\033[0m" + # Read necessary variables VID="$(readConfigKey "vid" "${USER_CONFIG_FILE}")" PID="$(readConfigKey "pid" "${USER_CONFIG_FILE}")" diff --git a/files/initrd/opt/arc/init.sh b/files/initrd/opt/arc/init.sh index 8f161850..22a7b78b 100755 --- a/files/initrd/opt/arc/init.sh +++ b/files/initrd/opt/arc/init.sh @@ -197,11 +197,24 @@ updateAddons echo -e "\033[1;34mLoading Arc Overlay...\033[0m" sleep 2 +# Diskcheck +HASATA=0 +for D in $(lsblk -dpno NAME); do + [ "${D}" = "${LOADER_DISK}" ] && continue + if [[ "$(getBus "${D}")" = "sata" || "$(getBus "${D}")" = "scsi" ]]; then + HASATA=1 + break + fi +done + # Check memory and load Arc RAM=$(free -m | grep -i mem | awk '{print$2}') if [ ${RAM} -le 3500 ]; then echo -e "\033[1;31mYou have less than 4GB of RAM, if errors occur in loader creation, please increase the amount of RAM.\033[0m\n" echo -e "\033[1;31mUse arc.sh to proceed. Not recommended!\033[0m\n" +elif [ ${HASATA} = "0" ]; then + echo -e "\033[1;31m*** Please insert at least one Sata/SAS Disk for System Installation, except for the Bootloader Disk. ***\033[0m\n" + echo -e "\033[1;31mUse arc.sh to proceed. Not recommended!\033[0m\n" else arc.sh fi \ No newline at end of file