From 39b95a840aa45bd02e49c0238568d73d4263fccd Mon Sep 17 00:00:00 2001 From: AuxXxilium Date: Sat, 26 Oct 2024 20:15:57 +0200 Subject: [PATCH] arc: rework update way Signed-off-by: AuxXxilium --- .github/workflows/autobuild.yml | 2 +- .github/workflows/build.yml | 4 ++-- files/initrd/opt/arc/include/update.sh | 27 ++++++++------------------ 3 files changed, 11 insertions(+), 22 deletions(-) diff --git a/.github/workflows/autobuild.yml b/.github/workflows/autobuild.yml index 3aba0fcc..1ba42990 100644 --- a/.github/workflows/autobuild.yml +++ b/.github/workflows/autobuild.yml @@ -119,7 +119,7 @@ jobs: zip -9 "arc-${{ env.VERSION }}-next.vmdk-dyn.zip" arc-dyn.vmdk zip -9 "arc-${{ env.VERSION }}-next.vmdk-flat.zip" arc.vmdk arc-flat.vmdk zip -9 "arc-${{ env.VERSION }}-next.vhdx.zip" arc.vhdx - (cd files && zip -r ../update-${{ env.VERSION }}-next.zip .) + (cd files && zip -r ../update-${{ env.VERSION }}-next.zip ./p1 ./p3) fi # Cleanup diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cb119280..832679d5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -171,7 +171,7 @@ jobs: zip -9 "arc-${{ env.VERSION }}-${{ env.ARCBRANCH }}.vmdk-flat.zip" arc.vmdk arc-flat.vmdk zip -9 "arc-${{ env.VERSION }}-${{ env.ARCBRANCH }}.vhdx.zip" arc.vhdx zip -9 "arc-${{ env.VERSION }}-${{ env.ARCBRANCH }}.ova.zip" arc.ova - (cd files && zip -r ../update-${{ env.VERSION }}-${{ env.ARCBRANCH }}.zip .) + (cd files && zip -r ../update-${{ env.VERSION }}-${{ env.ARCBRANCH }}.zip ./p1 ./p3) fi # Cleanup @@ -241,7 +241,7 @@ jobs: zip -9 "arc-${{ env.VERSION }}-${{ env.ARCBRANCH }}.vmdk-flat.zip" arc.vmdk arc-flat.vmdk zip -9 "arc-${{ env.VERSION }}-${{ env.ARCBRANCH }}.vhdx.zip" arc.vhdx zip -9 "arc-${{ env.VERSION }}-${{ env.ARCBRANCH }}.ova.zip" arc.ova - (cd files && zip -r ../update-${{ env.VERSION }}-${{ env.ARCBRANCH }}.zip .) + (cd files && zip -r ../update-${{ env.VERSION }}-${{ env.ARCBRANCH }}.zip ./p1 ./p3) fi # Publish a release if is a tag diff --git a/files/initrd/opt/arc/include/update.sh b/files/initrd/opt/arc/include/update.sh index e2a1c705..df6d9719 100755 --- a/files/initrd/opt/arc/include/update.sh +++ b/files/initrd/opt/arc/include/update.sh @@ -27,11 +27,10 @@ function updateLoader() { [[ $char == % ]] && echo "$progress%" && progress="" && keep=0 ; [[ $keep == 1 ]] && progress="$progress$char" ; done - if [ -f "${TMP_PATH}/update.zip" ]; then - echo -e "Downloading ${TAG}-${ARC_BRANCH} Loader successful!\nUpdating ${ARC_BRANCH} Loader..." + if [ -f "${TMP_PATH}/update.zip" ] && [ $(ls -s "${TMP_PATH}/update.zip" | cut -d' ' -f1) -gt 300000 ]; then + echo -e "Downloading ${TAG}-${ARC_BRANCH} Loader successful!\nUpdating Loader..." if unzip -oq "${TMP_PATH}/update.zip" -d "/mnt"; then echo "Successful!" - echo "${TAG}" > "${PART1_PATH}/VERSION" sleep 2 else updateFailed @@ -336,37 +335,27 @@ function arcUpdate() { KERNEL="$(readConfigKey "kernel" "${USER_CONFIG_FILE}")" BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")" FAILED="false" - dialog --backtitle "$(backtitle)" --title "Update Dependencies" --aspect 18 \ + dialog --backtitle "$(backtitle)" --title "Full Update" --aspect 18 \ --infobox "Updating Dependencies..." 0 0 sleep 3 - updateAddons + updateLoader [ $? -ne 0 ] && FAILED="true" - updateModules - [ $? -ne 0 ] && FAILED="true" - updateLKMs - [ $? -ne 0 ] && FAILED="true" - updatePatches - [ $? -ne 0 ] && FAILED="true" - if [ "${KERNEL}" == "custom" ]; then - updateCustom - [ $? -ne 0 ] && FAILED="true" - fi if [ "${FAILED}" == "true" ] && [ "${UPDATEMODE}" == "true" ]; then - dialog --backtitle "$(backtitle)" --title "Update Dependencies" --aspect 18 \ + dialog --backtitle "$(backtitle)" --title "Full Update" --aspect 18 \ --infobox "Update failed!\nTry again later." 0 0 sleep 3 exec reboot elif [ "${FAILED}" == "true" ]; then - dialog --backtitle "$(backtitle)" --title "Update Dependencies" --aspect 18 \ + dialog --backtitle "$(backtitle)" --title "Full Update" --aspect 18 \ --infobox "Update failed!\nTry again later." 0 0 sleep 3 elif [ "${FAILED}" == "false" ] && [ "${UPDATEMODE}" == "true" ]; then - dialog --backtitle "$(backtitle)" --title "Update Dependencies" --aspect 18 \ + dialog --backtitle "$(backtitle)" --title "Full Update" --aspect 18 \ --infobox "Update successful! -> Reboot to automated build..." 0 0 sleep 3 rebootTo "automated" elif [ "${FAILED}" == "false" ]; then - dialog --backtitle "$(backtitle)" --title "Update Dependencies" --aspect 18 \ + dialog --backtitle "$(backtitle)" --title "Full Update" --aspect 18 \ --infobox "Update successful!" 0 0 writeConfigKey "arc.builddone" "false" "${USER_CONFIG_FILE}" BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")"