From 94a5d42b75fc1d5e24bba75e87e1f19b42db0798 Mon Sep 17 00:00:00 2001 From: AuxXxilium Date: Wed, 22 May 2024 18:32:25 +0200 Subject: [PATCH] update: rewrite code Signed-off-by: AuxXxilium --- files/initrd/opt/arc/include/update.sh | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/files/initrd/opt/arc/include/update.sh b/files/initrd/opt/arc/include/update.sh index 505d39ca..5d189416 100755 --- a/files/initrd/opt/arc/include/update.sh +++ b/files/initrd/opt/arc/include/update.sh @@ -6,6 +6,17 @@ . ${ARC_PATH}/include/modules.sh CUSTOM="$(readConfigKey "arc.custom" "${USER_CONFIG_FILE}")" +PRODUCTVER="$(readConfigKey "productver" "${USER_CONFIG_FILE}")" +if [ -n "${PRODUCTVER}" ]; then + PLATFORM="$(readConfigKey "platform" "${USER_CONFIG_FILE}")" + KVER="$(readConfigKey "platforms.${PLATFORM}.productvers.[${PRODUCTVER}].kver" "${P_FILE}")" + # Modify KVER for Epyc7002 + if [ "${PLATFORM}" = "epyc7002" ]; then + KVERP="${PRODUCTVER}-${KVER}" + else + KVERP="${KVER}" + fi +fi ############################################################################### # Update Loader @@ -207,17 +218,6 @@ function updateModules() { unzip -oq "${TMP_PATH}/modules.zip" -d "${MODULES_PATH}" >/dev/null 2>&1 if [ -f "${TMP_PATH}/modules.zip" ]; then rm -f "${TMP_PATH}/modules.zip" - PRODUCTVER="$(readConfigKey "productver" "${USER_CONFIG_FILE}")" - if [ -n "${PRODUCTVER}" ]; then - PLATFORM="$(readConfigKey "platform" "${USER_CONFIG_FILE}")" - KVER="$(readConfigKey "platforms.${PLATFORM}.productvers.[${PRODUCTVER}].kver" "${P_FILE}")" - # Modify KVER for Epyc7002 - if [ "${PLATFORM}" = "epyc7002" ]; then - KVERP="${PRODUCTVER}-${KVER}" - else - KVERP="${KVER}" - fi - fi # Rebuild modules if model/build is selected if [ -n "${PLATFORM}" ] && [ -n "${KVERP}" ]; then writeConfigKey "modules" "{}" "${USER_CONFIG_FILE}"