From c4cc0b779a15739c0aa789b6979c8d86927f984e Mon Sep 17 00:00:00 2001 From: AuxXxilium Date: Fri, 15 Nov 2024 14:57:03 +0100 Subject: [PATCH 1/4] arc-functions: fix logic Signed-off-by: AuxXxilium --- files/initrd/opt/arc/arc-functions.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/files/initrd/opt/arc/arc-functions.sh b/files/initrd/opt/arc/arc-functions.sh index 0d5c730a..a3c42cf9 100755 --- a/files/initrd/opt/arc/arc-functions.sh +++ b/files/initrd/opt/arc/arc-functions.sh @@ -886,9 +886,10 @@ function updateMenu() { updateLoader "${TAG}" ;; 2) - updateDependencies + dependenciesUpdate ;; 3) + updateConfigs checkHardwareID ;; 4) From 16a73afe9d40daa48b33dd9ef7eddaadbc7086a4 Mon Sep 17 00:00:00 2001 From: AuxXxilium Date: Fri, 15 Nov 2024 15:20:33 +0100 Subject: [PATCH 2/4] arc-functions: more logic fix Signed-off-by: AuxXxilium --- files/initrd/opt/arc/arc-functions.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/files/initrd/opt/arc/arc-functions.sh b/files/initrd/opt/arc/arc-functions.sh index a3c42cf9..815ed711 100755 --- a/files/initrd/opt/arc/arc-functions.sh +++ b/files/initrd/opt/arc/arc-functions.sh @@ -2258,7 +2258,7 @@ function genHardwareID() { HWID="$(genHWID)" while true; do if [ -n "${HWID}" ]; then - USERID="$(curl -skL "https://arc.auxxxilium.tech?hwid=${HWID}" 2>/dev/null)" + USERID="$(curl -skL -m 10 "https://arc.auxxxilium.tech?hwid=${HWID}" 2>/dev/null)" if echo "${USERID}" | grep -vq "Hardware ID"; then dialog --backtitle "$(backtitle)" --title "HardwareID" \ --msgbox "HardwareID: ${HWID}\nYour HardwareID is registered to UserID: ${USERID}!" 6 70 @@ -2288,15 +2288,16 @@ function genHardwareID() { # Check HardwareID function checkHardwareID() { HWID="$(genHWID)" - USERID="$(curl -skL "https://arc.auxxxilium.tech?hwid=${HWID}" 2>/dev/null)" + USERID="$(curl -skL -m 10 "https://arc.auxxxilium.tech?hwid=${HWID}" 2>/dev/null)" if echo "${USERID}" | grep -vq "Hardware ID"; then cp -f "${S_FILE}" "${S_FILE}.bak" - if curl -skL "https://arc.auxxxilium.tech?hwid=${HWID}&userid=${USERID}" -o "${S_FILE}" 2>/dev/null; then + if curl -skL -m 10 "https://arc.auxxxilium.tech?hwid=${HWID}&userid=${USERID}" -o "${S_FILE}" 2>/dev/null; then writeConfigKey "arc.hwid" "${HWID}" "${USER_CONFIG_FILE}" writeConfigKey "arc.userid" "${USERID}" "${USER_CONFIG_FILE}" else dialog --backtitle "$(backtitle)" --title "HardwareID" \ --infobox "HardwareID: Your HardwareID couldn't be verified!" 4 50 + sleep 3 USERID="" writeConfigKey "arc.hwid" "" "${USER_CONFIG_FILE}" writeConfigKey "arc.userid" "" "${USER_CONFIG_FILE}" @@ -2304,11 +2305,11 @@ function checkHardwareID() { else dialog --backtitle "$(backtitle)" --title "HardwareID" \ --infobox "HardwareID: Your HardwareID isn't registered!" 4 50 + sleep 3 USERID="" writeConfigKey "arc.hwid" "" "${USER_CONFIG_FILE}" writeConfigKey "arc.userid" "" "${USER_CONFIG_FILE}" fi - sleep 3 return } From ab508a9eb5cab536ef60a3d17f9e3a15a410ca88 Mon Sep 17 00:00:00 2001 From: AuxXxilium Date: Fri, 15 Nov 2024 15:35:27 +0100 Subject: [PATCH 3/4] arc-functions: rename update function Signed-off-by: AuxXxilium --- files/initrd/opt/arc/arc-functions.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/initrd/opt/arc/arc-functions.sh b/files/initrd/opt/arc/arc-functions.sh index 815ed711..6d2fe85c 100755 --- a/files/initrd/opt/arc/arc-functions.sh +++ b/files/initrd/opt/arc/arc-functions.sh @@ -858,7 +858,7 @@ function updateMenu() { --menu "Choose an Option" 0 0 0 \ 1 "Update Loader \Z1(no reflash)\Zn" \ 2 "Update Dependencies" \ - 3 "Update Arc Patch" \ + 3 "Update Configs and Arc Patch" \ 4 "Switch Arc Branch: \Z1${ARC_BRANCH}\Zn" \ 2>"${TMP_PATH}/resp" [ $? -ne 0 ] && break From cee2d7d26337085415cfc2ad4dc4877f2f5d67ca Mon Sep 17 00:00:00 2001 From: AuxXxilium Date: Fri, 15 Nov 2024 15:46:33 +0100 Subject: [PATCH 4/4] tree: cleanup Signed-off-by: AuxXxilium --- files/initrd/opt/arc/arc.sh | 13 ------------- files/initrd/opt/arc/include/update.sh | 6 +++--- 2 files changed, 3 insertions(+), 16 deletions(-) diff --git a/files/initrd/opt/arc/arc.sh b/files/initrd/opt/arc/arc.sh index ddd27491..fa9b5c2c 100755 --- a/files/initrd/opt/arc/arc.sh +++ b/files/initrd/opt/arc/arc.sh @@ -671,19 +671,6 @@ function arcSummary() { # Building Loader function make() { STEP="build" - ARCCONF="$(readConfigKey "${MODEL}.serial" "${S_FILE}" 2>/dev/null)" - SN="$(readConfigKey "sn" "${USER_CONFIG_FILE}")" - BOOTMODE="$(readConfigKey "arc.mode" "${USER_CONFIG_FILE}")" - if [ "${BOOTMODE}" != "automated" ] && [ "${ARCOFFLINE}" != "true" ] && [[ "${ARCPATCH}" != "true" || -z "${ARCCONF}" ]]; then - if ! curl -skL "https://arc.auxxxilium.tech/check.yml" -o "${TMP_PATH}/check.yml" 2>/dev/null; then - SN=$(generateSerial "${MODEL}" "false") - else - if grep -q "${SN}" "${TMP_PATH}/check.yml"; then - SN=$(generateSerial "${MODEL}" "false") - fi - fi - writeConfigKey "sn" "${SN}" "${USER_CONFIG_FILE}" - fi # Read Model Config MODEL="$(readConfigKey "model" "${USER_CONFIG_FILE}")" PLATFORM="$(readConfigKey "platform" "${USER_CONFIG_FILE}")" diff --git a/files/initrd/opt/arc/include/update.sh b/files/initrd/opt/arc/include/update.sh index 86c99ac0..3279e3d7 100755 --- a/files/initrd/opt/arc/include/update.sh +++ b/files/initrd/opt/arc/include/update.sh @@ -447,7 +447,7 @@ function dependenciesUpdate() { BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")" FAILED="false" dialog --backtitle "$(backtitle)" --title "Update Dependencies" --aspect 18 \ - --infobox "Updating Dependencies..." 0 0 + --infobox "Updating Dependencies..." 3 40 sleep 2 updateAddons [ $? -ne 0 ] && FAILED="true" @@ -463,11 +463,11 @@ function dependenciesUpdate() { [ $? -ne 0 ] && FAILED="true" if [ "${FAILED}" == "true" ]; then dialog --backtitle "$(backtitle)" --title "Update Dependencies" --aspect 18 \ - --infobox "Update failed!\nTry again later." 0 0 + --infobox "Update failed! Try again later." 3 40 sleep 3 elif [ "${FAILED}" == "false" ]; then dialog --backtitle "$(backtitle)" --title "Update Dependencies" --aspect 18 \ - --infobox "Update successful!" 0 0 + --infobox "Update successful!" 3 40 writeConfigKey "arc.builddone" "false" "${USER_CONFIG_FILE}" BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")" sleep 3