From 270ecd019ee23e9380a8714712dae6e76d14b52c Mon Sep 17 00:00:00 2001 From: AuxXxilium Date: Sat, 21 Sep 2024 15:24:54 +0200 Subject: [PATCH] arc: rework latest changes Signed-off-by: AuxXxilium --- files/initrd/opt/arc/arc-functions.sh | 39 +-------------------------- files/initrd/opt/arc/arc.sh | 38 ++++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 38 deletions(-) diff --git a/files/initrd/opt/arc/arc-functions.sh b/files/initrd/opt/arc/arc-functions.sh index 61f3090a..1ec44823 100755 --- a/files/initrd/opt/arc/arc-functions.sh +++ b/files/initrd/opt/arc/arc-functions.sh @@ -39,43 +39,6 @@ function addonSelection() { PRODUCTVER="$(readConfigKey "productver" "${USER_CONFIG_FILE}")" PLATFORM="$(readConfigKey "platform" "${USER_CONFIG_FILE}")" ARCCONF="$(readConfigKey "${MODEL}.serial" "${S_FILE}")" - ADDONS="$(readConfigKey "addons" "${USER_CONFIG_FILE}")" - DEVICENIC="$(readConfigKey "device.nic" "${USER_CONFIG_FILE}")" - PAT_URL="$(readConfigKey "paturl" "${USER_CONFIG_FILE}")" - if [ "${ADDONS}" = "{}" ]; then - initConfigKey "addons.acpid" "" "${USER_CONFIG_FILE}" - initConfigKey "addons.cpuinfo" "" "${USER_CONFIG_FILE}" - initConfigKey "addons.storagepanel" "" "${USER_CONFIG_FILE}" - initConfigKey "addons.updatenotify" "" "${USER_CONFIG_FILE}" - if [ ${NVMEDRIVES} -gt 0 ]; then - if [ "${PLATFORM}" == "epyc7002" ] && [ ${SATADRIVES} -eq 0 ]; then - initConfigKey "addons.nvmesystem" "" "${USER_CONFIG_FILE}" - elif [ "${MODEL}" == "DS918+" ] || [ "${MODEL}" == "DS1019+" ] || [ "${MODEL}" == "DS1621xs+" ] || [ "${MODEL}" == "RS1619xs+" ]; then - initConfigKey "addons.nvmecache" "" "${USER_CONFIG_FILE}" - fi - initConfigKey "addons.nvmevolume" "" "${USER_CONFIG_FILE}" - fi - if [ "${CPUFREQ}" == "true" ] && [ "${ACPISYS}" == "true" ]; then - initConfigKey "addons.cpufreqscaling" "" "${USER_CONFIG_FILE}" - fi - if [ "${MACHINE}" == "Native" ]; then - initConfigKey "addons.powersched" "" "${USER_CONFIG_FILE}" - initConfigKey "addons.sensors" "" "${USER_CONFIG_FILE}" - fi - if echo "$(lsmod)" 2>/dev/null | grep -q "i915" && [[ "${PLATFORM}" == "apollolake" || "${PLATFORM}" == "geminilake" ]]; then - initConfigKey "addons.i915" "" "${USER_CONFIG_FILE}" - fi - if echo "${PAT_URL}" 2>/dev/null | grep -q "7.2.2"; then - initConfigKey "addons.allowdowngrade" "" "${USER_CONFIG_FILE}" - fi - if [ ${DEVICENIC} -gt 1 ]; then - initConfigKey "addons.multismb3" "" "${USER_CONFIG_FILE}" - initConfigKey "addons.sortnetif" "" "${USER_CONFIG_FILE}" - fi - if [ "${ARCCONF}" == "true" ]; then - initConfigKey "addons.arcdns" "" "${USER_CONFIG_FILE}" - fi - fi # read addons from user config unset ADDONS declare -A ADDONS @@ -95,7 +58,7 @@ function addonSelection() { fi done < <(availableAddons "${PLATFORM}") dialog --backtitle "$(backtitle)" --title "DSM Addons" --colors --aspect 18 \ - --checklist "Select DSM Addons to include.\nAddons: \Z1System Addon\Zn \Z4App Addon\Zn\nSelect with SPACE, Confirm with ENTER!" 0 0 0 \ + --checklist "Select DSM Addons to include.\nAddons: \Z1System Addon\Zn | \Z4App Addon\Zn\nSelect with SPACE, Confirm with ENTER!" 0 0 0 \ --file "${TMP_PATH}/opts" 2>"${TMP_PATH}/resp" [ $? -ne 0 ] && return 1 resp=$(cat ${TMP_PATH}/resp) diff --git a/files/initrd/opt/arc/arc.sh b/files/initrd/opt/arc/arc.sh index c92317ff..bb35835c 100755 --- a/files/initrd/opt/arc/arc.sh +++ b/files/initrd/opt/arc/arc.sh @@ -466,6 +466,44 @@ function arcVersion() { writeConfigKey "synoinfo.\"${KEY}\"" "${VALUE}" "${USER_CONFIG_FILE}" done < <(readConfigMap "platforms.${PLATFORM}.synoinfo" "${P_FILE}") # Check Addons for Platform + ADDONS="$(readConfigKey "addons" "${USER_CONFIG_FILE}")" + DEVICENIC="$(readConfigKey "device.nic" "${USER_CONFIG_FILE}")" + ARCCONF="$(readConfigKey "${MODEL}.serial" "${S_FILE}")" + PAT_URL="$(readConfigKey "paturl" "${USER_CONFIG_FILE}")" + if [ "${ADDONS}" = "{}" ]; then + initConfigKey "addons.acpid" "" "${USER_CONFIG_FILE}" + initConfigKey "addons.cpuinfo" "" "${USER_CONFIG_FILE}" + initConfigKey "addons.storagepanel" "" "${USER_CONFIG_FILE}" + initConfigKey "addons.updatenotify" "" "${USER_CONFIG_FILE}" + if [ ${NVMEDRIVES} -gt 0 ]; then + if [ "${PLATFORM}" == "epyc7002" ] && [ ${SATADRIVES} -eq 0 ]; then + initConfigKey "addons.nvmesystem" "" "${USER_CONFIG_FILE}" + elif [ "${MODEL}" == "DS918+" ] || [ "${MODEL}" == "DS1019+" ] || [ "${MODEL}" == "DS1621xs+" ] || [ "${MODEL}" == "RS1619xs+" ]; then + initConfigKey "addons.nvmecache" "" "${USER_CONFIG_FILE}" + fi + initConfigKey "addons.nvmevolume" "" "${USER_CONFIG_FILE}" + fi + if [ "${CPUFREQ}" == "true" ] && [ "${ACPISYS}" == "true" ]; then + initConfigKey "addons.cpufreqscaling" "" "${USER_CONFIG_FILE}" + fi + if [ "${MACHINE}" == "Native" ]; then + initConfigKey "addons.powersched" "" "${USER_CONFIG_FILE}" + initConfigKey "addons.sensors" "" "${USER_CONFIG_FILE}" + fi + if echo "$(lsmod)" 2>/dev/null | grep -q "i915" && [[ "${PLATFORM}" == "apollolake" || "${PLATFORM}" == "geminilake" ]]; then + initConfigKey "addons.i915" "" "${USER_CONFIG_FILE}" + fi + if echo "${PAT_URL}" 2>/dev/null | grep -q "7.2.2"; then + initConfigKey "addons.allowdowngrade" "" "${USER_CONFIG_FILE}" + fi + if [ ${DEVICENIC} -gt 1 ]; then + initConfigKey "addons.multismb3" "" "${USER_CONFIG_FILE}" + initConfigKey "addons.sortnetif" "" "${USER_CONFIG_FILE}" + fi + if [ -n "${ARCCONF}" ]; then + initConfigKey "addons.arcdns" "" "${USER_CONFIG_FILE}" + fi + fi while IFS=': ' read -r ADDON PARAM; do [ -z "${ADDON}" ] && continue if ! checkAddonExist "${ADDON}" "${PLATFORM}"; then