From 4542fd4ff9db1cbac8d20674e8798fedd2d14d16 Mon Sep 17 00:00:00 2001 From: AuxXxilium Date: Mon, 26 Aug 2024 11:27:53 -0400 Subject: [PATCH 01/10] arc: temp workaround part 1 Signed-off-by: AuxXxilium --- files/initrd/opt/arc/arc-functions.sh | 5 +- files/initrd/opt/arc/arc.sh | 92 +++++++++++++++----------- files/initrd/opt/arc/include/consts.sh | 1 + 3 files changed, 57 insertions(+), 41 deletions(-) diff --git a/files/initrd/opt/arc/arc-functions.sh b/files/initrd/opt/arc/arc-functions.sh index 01a63d9f6..02931f783 100755 --- a/files/initrd/opt/arc/arc-functions.sh +++ b/files/initrd/opt/arc/arc-functions.sh @@ -70,8 +70,11 @@ function addonSelection() { writeConfigKey "addons.\"${ADDON}\"" "" "${USER_CONFIG_FILE}" done ADDONSINFO="$(readConfigEntriesArray "addons" "${USER_CONFIG_FILE}")" + if [ "${PRODUCTVER}" == "7.2" ]; then + ADDONSINFO+="\n\n\Z1Warning: \ZnDSM 7.2.2 isn't supported by all Addons!" + fi dialog --backtitle "$(backtitle)" --title "DSM Addons" \ - --msgbox "DSM Addons selected:\n${ADDONSINFO}" 0 0 + --msgbox "DSM Addons selected:\n${ADDONSINFO}" 8 50 } ############################################################################### diff --git a/files/initrd/opt/arc/arc.sh b/files/initrd/opt/arc/arc.sh index 61d14f70c..d64e3655d 100755 --- a/files/initrd/opt/arc/arc.sh +++ b/files/initrd/opt/arc/arc.sh @@ -284,6 +284,7 @@ function arcVersion() { resp=$(cat ${TMP_PATH}/resp) [ -z "${resp}" ] && return 1 if [ "${PRODUCTVER}" != "${resp}" ]; then + [ "${PRODUCTVER}" == "7.2.2" ] && PRODUCTVER="7.2" PRODUCTVER="${resp}" writeConfigKey "productver" "${PRODUCTVER}" "${USER_CONFIG_FILE}" # Delete old files @@ -643,57 +644,66 @@ function make() { [ -d "${UNTAR_PAT_PATH}" ] && rm -rf "${UNTAR_PAT_PATH}" mkdir -p "${UNTAR_PAT_PATH}" if [ "${OFFLINE}" == "false" ]; then - # Get PAT Data - dialog --backtitle "$(backtitle)" --colors --title "Arc Build" \ - --infobox "Get PAT Data from Syno..." 3 40 - idx=0 - while [ ${idx} -le 3 ]; do # Loop 3 times, if successful, break - local URL="https://www.synology.com/api/support/findDownloadInfo?lang=en-us&product=${MODEL/+/%2B}&major=${PRODUCTVER%%.*}&minor=${PRODUCTVER##*.}" - if [ "${ARCNIC}" == "auto" ]; then - PAT_DATA="$(curl -skL -m 10 "${URL}")" - else - PAT_DATA="$(curl --interface ${ARCNIC} -skL -m 10 "${URL}")" - fi - if [ "$(echo ${PAT_DATA} | jq -r '.success' 2>/dev/null)" == "true" ]; then - if echo ${PAT_DATA} | jq -r '.info.system.detail[0].items[0].files[0].label_ext' 2>/dev/null | grep -q 'pat'; then - PAT_URL=$(echo ${PAT_DATA} | jq -r '.info.system.detail[0].items[0].files[0].url') - PAT_HASH=$(echo ${PAT_DATA} | jq -r '.info.system.detail[0].items[0].files[0].checksum') - PAT_URL=${PAT_URL%%\?*} - if [ -n "${PAT_URL}" ] && [ -n "${PAT_HASH}" ]; then - if echo "${PAT_URL}" | grep -q "https://"; then - VALID=true - break - fi - fi - fi - fi - sleep 3 - idx=$((${idx} + 1)) - done - if [ "${VALID}" == "false" ]; then + if [ "${PRODUCTVER}" == "7.2.1" ]; then + # Get PAT Data + dialog --backtitle "$(backtitle)" --colors --title "Arc Build" \ + --infobox "Get PAT Data from Local File..." 3 40 + PAT_URL="$(readConfigKey "${MODEL}.${PRODUCTVER}.url" "${D_FILE}")" + PAT_HASH="$(readConfigKey "${MODEL}.${PRODUCTVER}.hash" "${D_FILE}")" + else + [ "${PRODUCTVER}" == "7.2.2" ] && PRODUCTVER="7.2" + # Get PAT Data dialog --backtitle "$(backtitle)" --colors --title "Arc Build" \ - --infobox "Get PAT Data from Github..." 3 40 + --infobox "Get PAT Data from Syno..." 3 40 idx=0 while [ ${idx} -le 3 ]; do # Loop 3 times, if successful, break - URL="https://raw.githubusercontent.com/AuxXxilium/arc-dsm/main/dsm/${MODEL/+/%2B}/${PRODUCTVER}/pat_url" - HASH="https://raw.githubusercontent.com/AuxXxilium/arc-dsm/main/dsm/${MODEL/+/%2B}/${PRODUCTVER}/pat_hash" + local URL="https://www.synology.com/api/support/findDownloadInfo?lang=en-us&product=${MODEL/+/%2B}&major=${PRODUCTVER%%.*}&minor=${PRODUCTVER##*.}" if [ "${ARCNIC}" == "auto" ]; then - PAT_URL="$(curl -skL -m 10 "${URL}")" - PAT_HASH="$(curl -skL -m 10 "${HASH}")" + PAT_DATA="$(curl -skL -m 10 "${URL}")" else - PAT_URL="$(curl --interface ${ARCNIC} -m 10 -skL "${URL}")" - PAT_HASH="$(curl --interface ${ARCNIC} -m 10 -skL "$HASH")" + PAT_DATA="$(curl --interface ${ARCNIC} -skL -m 10 "${URL}")" fi - PAT_URL=${PAT_URL%%\?*} - if [ -n "${PAT_URL}" ] && [ -n "${PAT_HASH}" ]; then - if echo "${PAT_URL}" | grep -q "https://"; then - VALID="true" - break + if [ "$(echo ${PAT_DATA} | jq -r '.success' 2>/dev/null)" == "true" ]; then + if echo ${PAT_DATA} | jq -r '.info.system.detail[0].items[0].files[0].label_ext' 2>/dev/null | grep -q 'pat'; then + PAT_URL=$(echo ${PAT_DATA} | jq -r '.info.system.detail[0].items[0].files[0].url') + PAT_HASH=$(echo ${PAT_DATA} | jq -r '.info.system.detail[0].items[0].files[0].checksum') + PAT_URL=${PAT_URL%%\?*} + if [ -n "${PAT_URL}" ] && [ -n "${PAT_HASH}" ]; then + if echo "${PAT_URL}" | grep -q "https://"; then + VALID=true + break + fi + fi fi fi sleep 3 idx=$((${idx} + 1)) done + if [ "${VALID}" == "false" ]; then + dialog --backtitle "$(backtitle)" --colors --title "Arc Build" \ + --infobox "Get PAT Data from Github..." 3 40 + idx=0 + while [ ${idx} -le 3 ]; do # Loop 3 times, if successful, break + URL="https://raw.githubusercontent.com/AuxXxilium/arc-dsm/main/dsm/${MODEL/+/%2B}/${PRODUCTVER}/pat_url" + HASH="https://raw.githubusercontent.com/AuxXxilium/arc-dsm/main/dsm/${MODEL/+/%2B}/${PRODUCTVER}/pat_hash" + if [ "${ARCNIC}" == "auto" ]; then + PAT_URL="$(curl -skL -m 10 "${URL}")" + PAT_HASH="$(curl -skL -m 10 "${HASH}")" + else + PAT_URL="$(curl --interface ${ARCNIC} -m 10 -skL "${URL}")" + PAT_HASH="$(curl --interface ${ARCNIC} -m 10 -skL "$HASH")" + fi + PAT_URL=${PAT_URL%%\?*} + if [ -n "${PAT_URL}" ] && [ -n "${PAT_HASH}" ]; then + if echo "${PAT_URL}" | grep -q "https://"; then + VALID="true" + break + fi + fi + sleep 3 + idx=$((${idx} + 1)) + done + fi fi if [ "${AUTOMATED}" == "false" ] && [ "${VALID}" == "false" ]; then MSG="Failed to get PAT Data.\n" @@ -912,6 +922,8 @@ if [ "${AUTOMATED}" == "true" ]; then make fi else + dialog --backtitle "$(backtitle)" --title "Arc Warning" \ + --msgbox "WARN: Be aware of using DSM 7.2.2 is not stable,\nall Addons and Patches are written for 7.2.1." 7 70 [ "${BUILDDONE}" == "true" ] && NEXT="3" || NEXT="1" while true; do echo "= \"\Z4========== Main ==========\Zn \" " >"${TMP_PATH}/menu" diff --git a/files/initrd/opt/arc/include/consts.sh b/files/initrd/opt/arc/include/consts.sh index 25be118f9..ac48b7553 100755 --- a/files/initrd/opt/arc/include/consts.sh +++ b/files/initrd/opt/arc/include/consts.sh @@ -37,6 +37,7 @@ S_FILE="${MODEL_CONFIG_PATH}/serials.yml" S_FILE_ARC="${MODEL_CONFIG_PATH}/arc_serials.yml" S_FILE_ENC="${MODEL_CONFIG_PATH}/arc_serials.enc" P_FILE="${MODEL_CONFIG_PATH}/platforms.yml" +D_FILE="${MODEL_CONFIG_PATH}/data.yml" EXTRACTOR_PATH="${PART3_PATH}/extractor" EXTRACTOR_BIN="syno_extract_system_patch" \ No newline at end of file From b612c541ab7ca85b8871c13daa3514ff8c17681e Mon Sep 17 00:00:00 2001 From: AuxXxilium Date: Mon, 26 Aug 2024 11:44:50 -0400 Subject: [PATCH 02/10] arc: format warnings Signed-off-by: AuxXxilium --- files/initrd/opt/arc/arc-functions.sh | 7 +++++-- files/initrd/opt/arc/arc.sh | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/files/initrd/opt/arc/arc-functions.sh b/files/initrd/opt/arc/arc-functions.sh index 02931f783..ee89e90e5 100755 --- a/files/initrd/opt/arc/arc-functions.sh +++ b/files/initrd/opt/arc/arc-functions.sh @@ -72,9 +72,12 @@ function addonSelection() { ADDONSINFO="$(readConfigEntriesArray "addons" "${USER_CONFIG_FILE}")" if [ "${PRODUCTVER}" == "7.2" ]; then ADDONSINFO+="\n\n\Z1Warning: \ZnDSM 7.2.2 isn't supported by all Addons!" + dialog --backtitle "$(backtitle)" --title "DSM Addons" \ + --msgbox "DSM Addons selected:\n\n${ADDONSINFO}" 9 50 + else + dialog --backtitle "$(backtitle)" --title "DSM Addons" \ + --msgbox "DSM Addons selected:\n\n${ADDONSINFO}" 6 50 fi - dialog --backtitle "$(backtitle)" --title "DSM Addons" \ - --msgbox "DSM Addons selected:\n${ADDONSINFO}" 8 50 } ############################################################################### diff --git a/files/initrd/opt/arc/arc.sh b/files/initrd/opt/arc/arc.sh index d64e3655d..a24b5e39d 100755 --- a/files/initrd/opt/arc/arc.sh +++ b/files/initrd/opt/arc/arc.sh @@ -923,7 +923,7 @@ if [ "${AUTOMATED}" == "true" ]; then fi else dialog --backtitle "$(backtitle)" --title "Arc Warning" \ - --msgbox "WARN: Be aware of using DSM 7.2.2 is not stable,\nall Addons and Patches are written for 7.2.1." 7 70 + --msgbox "WARN: Be aware of using DSM 7.2.2 is not stable,\nall Addons and Patches are written for 7.2.1." 6 55 [ "${BUILDDONE}" == "true" ] && NEXT="3" || NEXT="1" while true; do echo "= \"\Z4========== Main ==========\Zn \" " >"${TMP_PATH}/menu" From 9a15f8208dc30824625237186c8180de54284414 Mon Sep 17 00:00:00 2001 From: AuxXxilium Date: Mon, 26 Aug 2024 12:14:23 -0400 Subject: [PATCH 03/10] tree: workaround Signed-off-by: AuxXxilium --- files/initrd/opt/arc/arc.sh | 18 +++++++++++++----- files/initrd/opt/arc/init.sh | 2 +- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/files/initrd/opt/arc/arc.sh b/files/initrd/opt/arc/arc.sh index a24b5e39d..6958ae2f7 100755 --- a/files/initrd/opt/arc/arc.sh +++ b/files/initrd/opt/arc/arc.sh @@ -284,9 +284,16 @@ function arcVersion() { resp=$(cat ${TMP_PATH}/resp) [ -z "${resp}" ] && return 1 if [ "${PRODUCTVER}" != "${resp}" ]; then - [ "${PRODUCTVER}" == "7.2.2" ] && PRODUCTVER="7.2" + if [ "${PRODUCTVER}" == "7.2.2" ]; then + PRODUCTVER="7.2" + HOTFIX="2" + elif [ "${PRODUCTVER}" == "7.2.1" ]; then + PRODUCTVER="7.2" + HOTFIX="1" + fi PRODUCTVER="${resp}" writeConfigKey "productver" "${PRODUCTVER}" "${USER_CONFIG_FILE}" + writeConfigKey "hotfix" "${HOTFIX}" "${USER_CONFIG_FILE}" # Delete old files rm -f "${ORI_ZIMAGE_FILE}" "${ORI_RDGZ_FILE}" "${MOD_ZIMAGE_FILE}" "${MOD_RDGZ_FILE}" 2>/dev/null || true rm -f "${PART1_PATH}/grub_cksum.syno" "${PART1_PATH}/GRUB_VER" "${PART2_PATH}/"* >/dev/null 2>&1 || true @@ -633,6 +640,7 @@ function make() { MODELID="$(readConfigKey "modelid" "${USER_CONFIG_FILE}")" PLATFORM="$(readConfigKey "platform" "${USER_CONFIG_FILE}")" PRODUCTVER="$(readConfigKey "productver" "${USER_CONFIG_FILE}")" + HOTFIX="$(readConfigKey "hotfix" "${USER_CONFIG_FILE}")" DT="$(readConfigKey "platforms.${PLATFORM}.dt" "${P_FILE}")" AUTOMATED="$(readConfigKey "automated" "${USER_CONFIG_FILE}")" PAT_URL="" @@ -644,14 +652,14 @@ function make() { [ -d "${UNTAR_PAT_PATH}" ] && rm -rf "${UNTAR_PAT_PATH}" mkdir -p "${UNTAR_PAT_PATH}" if [ "${OFFLINE}" == "false" ]; then - if [ "${PRODUCTVER}" == "7.2.1" ]; then + if [ "${HOTFIX}" == "1" ]; then # Get PAT Data dialog --backtitle "$(backtitle)" --colors --title "Arc Build" \ --infobox "Get PAT Data from Local File..." 3 40 - PAT_URL="$(readConfigKey "${MODEL}.${PRODUCTVER}.url" "${D_FILE}")" - PAT_HASH="$(readConfigKey "${MODEL}.${PRODUCTVER}.hash" "${D_FILE}")" + PAT_URL="$(readConfigKey "\"${MODEL}\".\"${PRODUCTVER}\".url" "${D_FILE}")" + PAT_HASH="$(readConfigKey "\"${MODEL}\".\"${PRODUCTVER}\".hash" "${D_FILE}")" + VALID="true" else - [ "${PRODUCTVER}" == "7.2.2" ] && PRODUCTVER="7.2" # Get PAT Data dialog --backtitle "$(backtitle)" --colors --title "Arc Build" \ --infobox "Get PAT Data from Syno..." 3 40 diff --git a/files/initrd/opt/arc/init.sh b/files/initrd/opt/arc/init.sh index dd23cb26d..0154bdfd2 100755 --- a/files/initrd/opt/arc/init.sh +++ b/files/initrd/opt/arc/init.sh @@ -51,8 +51,8 @@ initConfigKey "bootipwait" "30" "${USER_CONFIG_FILE}" initConfigKey "directboot" "false" "${USER_CONFIG_FILE}" initConfigKey "dsmlogo" "true" "${USER_CONFIG_FILE}" initConfigKey "emmcboot" "false" "${USER_CONFIG_FILE}" -initConfigKey "governor" "" "${USER_CONFIG_FILE}" initConfigKey "hddsort" "false" "${USER_CONFIG_FILE}" +initConfigKey "hotfix" "" "${USER_CONFIG_FILE}" initConfigKey "kernel" "official" "${USER_CONFIG_FILE}" initConfigKey "kernelload" "power" "${USER_CONFIG_FILE}" initConfigKey "kernelpanic" "5" "${USER_CONFIG_FILE}" From 1a81e2d204d77ca86a5ce886ba95934d7d6a7e60 Mon Sep 17 00:00:00 2001 From: AuxXxilium Date: Mon, 26 Aug 2024 12:21:07 -0400 Subject: [PATCH 04/10] functions: fix Signed-off-by: AuxXxilium --- files/initrd/opt/arc/include/functions.sh | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/files/initrd/opt/arc/include/functions.sh b/files/initrd/opt/arc/include/functions.sh index 5b681fdaa..0c4d64ead 100755 --- a/files/initrd/opt/arc/include/functions.sh +++ b/files/initrd/opt/arc/include/functions.sh @@ -589,23 +589,22 @@ function offlineCheck() { done if [ -n "${ARCNIC}" ]; then OFFLINE="false" - elif [ -z "${ARCNIC}" ] && [ "${AUTOMATED}" == "false" ]; then - dialog --backtitle "$(backtitle)" --title "Online Check" \ - --infobox "Could not connect to Github.\nSwitch to Offline Mode!" 0 0 + elif [ -z "${ARCNIC}" ]; then + if [ "${AUTOMATED}" == "false" ]; then + dialog --backtitle "$(backtitle)" --title "Online Check" \ + --infobox "Could not connect to Github.\nSwitch to Offline Mode!" 0 0 + else + dialog --backtitle "$(backtitle)" --title "Online Check" \ + --infobox "Could not connect to Github.\nSwitch to Offline Mode!\nDisable Automated Mode!" 0 0 + fi sleep 5 cp -f "${PART3_PATH}/configs/offline.json" "${ARC_PATH}/include/offline.json" - ARCNIC="offline" - OFFLINE="true" - elif [ -z "${ARCNIC}" ] && [ "${AUTOMATED}" == "true" ]; then - dialog --backtitle "$(backtitle)" --title "Online Check" \ - --infobox "Could not connect to Github.\nSwitch to Offline Mode!\nDisable Automated Mode!" 0 0 - sleep 5 - writeConfigKey "automated" "false" "${USER_CONFIG_FILE}" - [ -f "${PART3_PATH}/automated" ] && rm -f "${PART3_PATH}/automated" >/dev/null + AUTOMATED="false" ARCNIC="offline" OFFLINE="true" fi fi + writeConfigKey "automated" "${AUTOMATED}" "${USER_CONFIG_FILE}" writeConfigKey "arc.nic" "${ARCNIC}" "${USER_CONFIG_FILE}" writeConfigKey "arc.offline" "${OFFLINE}" "${USER_CONFIG_FILE}" } From 0595c78aa261f101be55536d6317de78e40d2b86 Mon Sep 17 00:00:00 2001 From: AuxXxilium Date: Mon, 26 Aug 2024 12:31:52 -0400 Subject: [PATCH 05/10] tree: fix offline file Signed-off-by: AuxXxilium --- files/initrd/opt/arc/arc-functions.sh | 1 - files/initrd/opt/arc/include/update.sh | 1 - 2 files changed, 2 deletions(-) diff --git a/files/initrd/opt/arc/arc-functions.sh b/files/initrd/opt/arc/arc-functions.sh index ee89e90e5..d25ee137f 100755 --- a/files/initrd/opt/arc/arc-functions.sh +++ b/files/initrd/opt/arc/arc-functions.sh @@ -2127,7 +2127,6 @@ function decryptMenu() { fi if [ -f "${TMP_PATH}/configs.zip" ]; then echo "Download successful!" - rm -rf "${MODEL_CONFIG_PATH}" mkdir -p "${MODEL_CONFIG_PATH}" echo "Installing new Configs..." unzip -oq "${TMP_PATH}/configs.zip" -d "${MODEL_CONFIG_PATH}" diff --git a/files/initrd/opt/arc/include/update.sh b/files/initrd/opt/arc/include/update.sh index c00a2aa8d..c349dd75e 100755 --- a/files/initrd/opt/arc/include/update.sh +++ b/files/initrd/opt/arc/include/update.sh @@ -510,7 +510,6 @@ function updateConfigs() { fi if [ -f "${TMP_PATH}/configs.zip" ]; then echo "Download successful!" - rm -rf "${MODEL_CONFIG_PATH}" mkdir -p "${MODEL_CONFIG_PATH}" echo "Installing new Configs..." unzip -oq "${TMP_PATH}/configs.zip" -d "${MODEL_CONFIG_PATH}" From 7d7d719e2ddf29b5c3abc4cd7ceb29081af2ea35 Mon Sep 17 00:00:00 2001 From: AuxXxilium Date: Mon, 26 Aug 2024 12:47:54 -0400 Subject: [PATCH 06/10] tree: rewrite Signed-off-by: AuxXxilium --- files/initrd/opt/arc/arc-functions.sh | 3 ++- files/initrd/opt/arc/arc.sh | 23 ++++++++++++++++------- files/initrd/opt/arc/init.sh | 2 +- 3 files changed, 19 insertions(+), 9 deletions(-) diff --git a/files/initrd/opt/arc/arc-functions.sh b/files/initrd/opt/arc/arc-functions.sh index d25ee137f..62c880d40 100755 --- a/files/initrd/opt/arc/arc-functions.sh +++ b/files/initrd/opt/arc/arc-functions.sh @@ -37,6 +37,7 @@ function addonSelection() { # read platform and kernel version to check if addon exists MODEL="$(readConfigKey "model" "${USER_CONFIG_FILE}")" PRODUCTVER="$(readConfigKey "productver" "${USER_CONFIG_FILE}")" + NANOVER="$(readConfigKey "nanover" "${USER_CONFIG_FILE}")" PLATFORM="$(readConfigKey "platform" "${USER_CONFIG_FILE}")" ARCPATCH="$(readConfigKey "arc.patch" "${USER_CONFIG_FILE}")" # read addons from user config @@ -70,7 +71,7 @@ function addonSelection() { writeConfigKey "addons.\"${ADDON}\"" "" "${USER_CONFIG_FILE}" done ADDONSINFO="$(readConfigEntriesArray "addons" "${USER_CONFIG_FILE}")" - if [ "${PRODUCTVER}" == "7.2" ]; then + if [ "${NANOVER}" == "2" ]; then ADDONSINFO+="\n\n\Z1Warning: \ZnDSM 7.2.2 isn't supported by all Addons!" dialog --backtitle "$(backtitle)" --title "DSM Addons" \ --msgbox "DSM Addons selected:\n\n${ADDONSINFO}" 9 50 diff --git a/files/initrd/opt/arc/arc.sh b/files/initrd/opt/arc/arc.sh index 6958ae2f7..3d4c9aae4 100755 --- a/files/initrd/opt/arc/arc.sh +++ b/files/initrd/opt/arc/arc.sh @@ -88,7 +88,11 @@ function backtitle() { fi BACKTITLE="${ARC_TITLE} | " BACKTITLE+="${MODEL} | " - BACKTITLE+="${PRODUCTVER} | " + if [ -n "${NANOVER}" ]; then + BACKTITLE+="${PRODUCTVER}.${NANOVER} | " + else + BACKTITLE+="${PRODUCTVER} | " + fi BACKTITLE+="${IPCON}${OFF} | " BACKTITLE+="Patch: ${ARCPATCH} | " BACKTITLE+="Config: ${CONFDONE} | " @@ -284,16 +288,17 @@ function arcVersion() { resp=$(cat ${TMP_PATH}/resp) [ -z "${resp}" ] && return 1 if [ "${PRODUCTVER}" != "${resp}" ]; then + writeConfigKey "confdone" "false" "${USER_CONFIG_FILE}" + PRODUCTVER="${resp}" if [ "${PRODUCTVER}" == "7.2.2" ]; then PRODUCTVER="7.2" - HOTFIX="2" + NANOVER="2" elif [ "${PRODUCTVER}" == "7.2.1" ]; then PRODUCTVER="7.2" - HOTFIX="1" + NANOVER="1" fi - PRODUCTVER="${resp}" writeConfigKey "productver" "${PRODUCTVER}" "${USER_CONFIG_FILE}" - writeConfigKey "hotfix" "${HOTFIX}" "${USER_CONFIG_FILE}" + writeConfigKey "nanover" "${NANOVER}" "${USER_CONFIG_FILE}" # Delete old files rm -f "${ORI_ZIMAGE_FILE}" "${ORI_RDGZ_FILE}" "${MOD_ZIMAGE_FILE}" "${MOD_RDGZ_FILE}" 2>/dev/null || true rm -f "${PART1_PATH}/grub_cksum.syno" "${PART1_PATH}/GRUB_VER" "${PART2_PATH}/"* >/dev/null 2>&1 || true @@ -438,6 +443,7 @@ function arcSettings() { --infobox "Generating Network Config..." 3 40 sleep 2 getnet + [ $? -ne 0 ] && return 1 if [ "${ONLYPATCH}" == "true" ]; then # Build isn't done writeConfigKey "arc.builddone" "false" "${USER_CONFIG_FILE}" @@ -451,6 +457,7 @@ function arcSettings() { --infobox "Generating Storage Map..." 3 40 sleep 2 getmapSelection + [ $? -ne 0 ] && return 1 fi # Check for Custom Build if [ "${AUTOMATED}" == "false" ]; then @@ -461,6 +468,7 @@ function arcSettings() { initConfigKey "addons.cpuinfo" "" "${USER_CONFIG_FILE}" initConfigKey "addons.storagepanel" "" "${USER_CONFIG_FILE}" addonSelection + [ $? -ne 0 ] && return 1 # Check for CPU Frequency Scaling if [ "${CPUFREQ}" == "true" ] && readConfigMap "addons" "${USER_CONFIG_FILE}" | grep -q "cpufreqscaling"; then # Select Governor for DSM @@ -468,6 +476,7 @@ function arcSettings() { dialog --backtitle "$(backtitle)" --colors --title "CPU Frequency Scaling" \ --infobox "Generating Governor Table..." 3 40 governorSelection + [ $? -ne 0 ] && return 1 else deleteConfigKey "addons.cpufreqscaling" "${USER_CONFIG_FILE}" fi @@ -640,7 +649,7 @@ function make() { MODELID="$(readConfigKey "modelid" "${USER_CONFIG_FILE}")" PLATFORM="$(readConfigKey "platform" "${USER_CONFIG_FILE}")" PRODUCTVER="$(readConfigKey "productver" "${USER_CONFIG_FILE}")" - HOTFIX="$(readConfigKey "hotfix" "${USER_CONFIG_FILE}")" + NANOVER="$(readConfigKey "nanover" "${USER_CONFIG_FILE}")" DT="$(readConfigKey "platforms.${PLATFORM}.dt" "${P_FILE}")" AUTOMATED="$(readConfigKey "automated" "${USER_CONFIG_FILE}")" PAT_URL="" @@ -652,7 +661,7 @@ function make() { [ -d "${UNTAR_PAT_PATH}" ] && rm -rf "${UNTAR_PAT_PATH}" mkdir -p "${UNTAR_PAT_PATH}" if [ "${OFFLINE}" == "false" ]; then - if [ "${HOTFIX}" == "1" ]; then + if [ "${NANOVER}" == "1" ]; then # Get PAT Data dialog --backtitle "$(backtitle)" --colors --title "Arc Build" \ --infobox "Get PAT Data from Local File..." 3 40 diff --git a/files/initrd/opt/arc/init.sh b/files/initrd/opt/arc/init.sh index 0154bdfd2..0ab5fc0d4 100755 --- a/files/initrd/opt/arc/init.sh +++ b/files/initrd/opt/arc/init.sh @@ -52,10 +52,10 @@ initConfigKey "directboot" "false" "${USER_CONFIG_FILE}" initConfigKey "dsmlogo" "true" "${USER_CONFIG_FILE}" initConfigKey "emmcboot" "false" "${USER_CONFIG_FILE}" initConfigKey "hddsort" "false" "${USER_CONFIG_FILE}" -initConfigKey "hotfix" "" "${USER_CONFIG_FILE}" initConfigKey "kernel" "official" "${USER_CONFIG_FILE}" initConfigKey "kernelload" "power" "${USER_CONFIG_FILE}" initConfigKey "kernelpanic" "5" "${USER_CONFIG_FILE}" +initConfigKey "nanover" "" "${USER_CONFIG_FILE}" initConfigKey "odp" "false" "${USER_CONFIG_FILE}" initConfigKey "pathash" "" "${USER_CONFIG_FILE}" initConfigKey "paturl" "" "${USER_CONFIG_FILE}" From d6609e191cb32ccdfae08bbcff4e31a471164556 Mon Sep 17 00:00:00 2001 From: AuxXxilium Date: Mon, 26 Aug 2024 12:54:51 -0400 Subject: [PATCH 07/10] tree: more formatting Signed-off-by: AuxXxilium --- files/initrd/opt/arc/arc-functions.sh | 6 +++--- files/initrd/opt/arc/arc.sh | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/files/initrd/opt/arc/arc-functions.sh b/files/initrd/opt/arc/arc-functions.sh index 62c880d40..2b47c7db5 100755 --- a/files/initrd/opt/arc/arc-functions.sh +++ b/files/initrd/opt/arc/arc-functions.sh @@ -72,12 +72,12 @@ function addonSelection() { done ADDONSINFO="$(readConfigEntriesArray "addons" "${USER_CONFIG_FILE}")" if [ "${NANOVER}" == "2" ]; then - ADDONSINFO+="\n\n\Z1Warning: \ZnDSM 7.2.2 isn't supported by all Addons!" + ADDONSINFO+="\nWarning: DSM 7.2.2 isn't supported by all Addons!" dialog --backtitle "$(backtitle)" --title "DSM Addons" \ - --msgbox "DSM Addons selected:\n\n${ADDONSINFO}" 9 50 + --msgbox "DSM Addons selected:\n${ADDONSINFO}" 10 50 else dialog --backtitle "$(backtitle)" --title "DSM Addons" \ - --msgbox "DSM Addons selected:\n\n${ADDONSINFO}" 6 50 + --msgbox "DSM Addons selected:\n${ADDONSINFO}" 7 50 fi } diff --git a/files/initrd/opt/arc/arc.sh b/files/initrd/opt/arc/arc.sh index 3d4c9aae4..24b07f4cd 100755 --- a/files/initrd/opt/arc/arc.sh +++ b/files/initrd/opt/arc/arc.sh @@ -484,7 +484,7 @@ function arcSettings() { if [ "${PLATFORM}" != "epyc7002" ]; then if [ "${DT}" == "true" ] && [ "${EXTERNALCONTROLLER}" == "true" ]; then dialog --backtitle "$(backtitle)" --title "Arc Warning" \ - --msgbox "WARN: You use a HBA/Raid Controller and selected a DT Model.\nThis is still an experimental." 6 80 + --msgbox "WARN: You use a HBA/Raid Controller and selected a DT Model.\nThis is still an experimental." 6 70 fi fi # Check for more then 8 Ethernet Ports @@ -492,7 +492,7 @@ function arcSettings() { MODELNIC="$(readConfigKey "${MODEL}.ports" "${S_FILE}" 2>/dev/null)" if [ ${DEVICENIC} -gt 8 ]; then dialog --backtitle "$(backtitle)" --title "Arc Warning" \ - --msgbox "WARN: You have more NIC (${DEVICENIC}) then 8 NIC.\nOnly 8 supported by DSM." 6 80 + --msgbox "WARN: You have more NIC (${DEVICENIC}) then 8 NIC.\nOnly 8 supported by DSM." 6 60 fi if [ ${DEVICENIC} -gt ${MODELNIC} ] && [ "${ARCPATCH}" == "true" ]; then dialog --backtitle "$(backtitle)" --title "Arc Warning" \ @@ -501,12 +501,12 @@ function arcSettings() { # Check for AES if [ "${AESSYS}" == "false" ]; then dialog --backtitle "$(backtitle)" --title "Arc Warning" \ - --msgbox "WARN: Your System doesn't support Hardwareencryption in DSM. (AES)" 5 80 + --msgbox "WARN: Your System doesn't support Hardwareencryption in DSM. (AES)" 5 70 fi # Check for CPUFREQ if [ "${CPUFREQ}" == "false" ]; then dialog --backtitle "$(backtitle)" --title "Arc Warning" \ - --msgbox "WARN: Your System doesn't support CPU Frequency Scaling in DSM." 5 80 + --msgbox "WARN: Your System doesn't support CPU Frequency Scaling in DSM." 5 70 fi fi EMMCBOOT="$(readConfigKey "emmcboot" "${USER_CONFIG_FILE}")" From 9f2485ad00dd3c15e7605cd3c042466a60890beb Mon Sep 17 00:00:00 2001 From: AuxXxilium Date: Mon, 26 Aug 2024 13:02:51 -0400 Subject: [PATCH 08/10] arc: rework more Signed-off-by: AuxXxilium --- files/initrd/opt/arc/arc-functions.sh | 8 +++---- files/initrd/opt/arc/arc.sh | 31 ++++++++++++++++++--------- 2 files changed, 25 insertions(+), 14 deletions(-) diff --git a/files/initrd/opt/arc/arc-functions.sh b/files/initrd/opt/arc/arc-functions.sh index 2b47c7db5..03d7e8e9d 100755 --- a/files/initrd/opt/arc/arc-functions.sh +++ b/files/initrd/opt/arc/arc-functions.sh @@ -1,6 +1,8 @@ ############################################################################### # Permits user edit the user config function editUserConfig() { + OLDMODEL="${MODEL}" + OLDPRODUCTVER="${PRODUCTVER}" while true; do dialog --backtitle "$(backtitle)" --title "Edit with caution" \ --ok-label "Save" --editbox "${USER_CONFIG_FILE}" 0 0 2>"${TMP_PATH}/userconfig" @@ -10,8 +12,6 @@ function editUserConfig() { [ $? -eq 0 ] && break || continue dialog --backtitle "$(backtitle)" --title "Invalid YAML format" --msgbox "${ERRORS}" 0 0 done - OLDMODEL="${MODEL}" - OLDPRODUCTVER="${PRODUCTVER}" MODEL="$(readConfigKey "model" "${USER_CONFIG_FILE}")" PRODUCTVER="$(readConfigKey "productver" "${USER_CONFIG_FILE}")" SN="$(readConfigKey "sn" "${USER_CONFIG_FILE}")" @@ -72,9 +72,9 @@ function addonSelection() { done ADDONSINFO="$(readConfigEntriesArray "addons" "${USER_CONFIG_FILE}")" if [ "${NANOVER}" == "2" ]; then - ADDONSINFO+="\nWarning: DSM 7.2.2 isn't supported by all Addons!" + ADDONSINFO+="\n\nWARN: DSM 7.2.2 isn't supported by app-specific Addons!" dialog --backtitle "$(backtitle)" --title "DSM Addons" \ - --msgbox "DSM Addons selected:\n${ADDONSINFO}" 10 50 + --msgbox "DSM Addons selected:\n${ADDONSINFO}" 10 60 else dialog --backtitle "$(backtitle)" --title "DSM Addons" \ --msgbox "DSM Addons selected:\n${ADDONSINFO}" 7 50 diff --git a/files/initrd/opt/arc/arc.sh b/files/initrd/opt/arc/arc.sh index 24b07f4cd..7aa80b6df 100755 --- a/files/initrd/opt/arc/arc.sh +++ b/files/initrd/opt/arc/arc.sh @@ -287,17 +287,28 @@ function arcVersion() { [ $? -ne 0 ] && return 0 resp=$(cat ${TMP_PATH}/resp) [ -z "${resp}" ] && return 1 - if [ "${PRODUCTVER}" != "${resp}" ]; then + if [ "${resp}" == "7.2" ]; then + dialog --backtitle "$(backtitle)" --title "DSM Version" \ + --menu "Choose a DSM Version?\n* Recommended Option" 8 40 0 \ + 1 "DSM 7.2.1 (Stable) *" \ + 2 "DSM 7.2.2 (Experimental)" \ + 2>"${TMP_PATH}/resp" + [ $? -ne 0 ] && return 1 + resp=$(cat ${TMP_PATH}/resp) + [ -z "${resp}" ] && return 1 + if [ ${resp} -eq 1 ]; then + resp="7.2" + respnano="1" + elif [ ${resp} -eq 2 ]; then + resp="7.2" + respnano="2" + fi + fi + if [ "${PRODUCTVER}" != "${resp}" ] || [ "${NANOVER}" != "${respnano}" ]; then writeConfigKey "confdone" "false" "${USER_CONFIG_FILE}" PRODUCTVER="${resp}" - if [ "${PRODUCTVER}" == "7.2.2" ]; then - PRODUCTVER="7.2" - NANOVER="2" - elif [ "${PRODUCTVER}" == "7.2.1" ]; then - PRODUCTVER="7.2" - NANOVER="1" - fi writeConfigKey "productver" "${PRODUCTVER}" "${USER_CONFIG_FILE}" + NANOVER="${respnano}" writeConfigKey "nanover" "${NANOVER}" "${USER_CONFIG_FILE}" # Delete old files rm -f "${ORI_ZIMAGE_FILE}" "${ORI_RDGZ_FILE}" "${MOD_ZIMAGE_FILE}" "${MOD_RDGZ_FILE}" 2>/dev/null || true @@ -665,8 +676,8 @@ function make() { # Get PAT Data dialog --backtitle "$(backtitle)" --colors --title "Arc Build" \ --infobox "Get PAT Data from Local File..." 3 40 - PAT_URL="$(readConfigKey "\"${MODEL}\".\"${PRODUCTVER}\".url" "${D_FILE}")" - PAT_HASH="$(readConfigKey "\"${MODEL}\".\"${PRODUCTVER}\".hash" "${D_FILE}")" + PAT_URL="$(readConfigKey "\"${MODEL}\".\"${PRODUCTVER}.${NANOVER}\".url" "${D_FILE}")" + PAT_HASH="$(readConfigKey "\"${MODEL}\".\"${PRODUCTVER}.${NANOVER}\".hash" "${D_FILE}")" VALID="true" else # Get PAT Data From 9e34bc70f37af85457f8cac375e0cee469858db4 Mon Sep 17 00:00:00 2001 From: AuxXxilium Date: Mon, 26 Aug 2024 14:29:26 -0400 Subject: [PATCH 09/10] arc: remove custom kernel if 7.2.2 is selected Signed-off-by: AuxXxilium --- files/initrd/opt/arc/arc-functions.sh | 12 ++++-------- files/initrd/opt/arc/arc.sh | 2 +- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/files/initrd/opt/arc/arc-functions.sh b/files/initrd/opt/arc/arc-functions.sh index 03d7e8e9d..64b3047cd 100755 --- a/files/initrd/opt/arc/arc-functions.sh +++ b/files/initrd/opt/arc/arc-functions.sh @@ -52,6 +52,8 @@ function addonSelection() { arrayExistItem "${ADDON}" "${!ADDONS[@]}" && ACT="on" || ACT="off" if [[ "${ADDON}" == "amepatch" || "${ADDON}" == "sspatch" || "${ADDON}" == "arcdns" ]] && [ "${ARCPATCH}" == "false" ]; then continue + elif [[ "${ADDON}" == "amepatch" || "${ADDON}" == "sspatch" || "${ADDON}" == "photosfacepatch" || "${ADDON}" == "remotefs" ]] && [ "${NANOVER}" == "2" ]; then + continue elif [ "${ADDON}" == "cpufreqscaling" ] && [ "${CPUFREQ}" == "false" ]; then continue else @@ -71,14 +73,8 @@ function addonSelection() { writeConfigKey "addons.\"${ADDON}\"" "" "${USER_CONFIG_FILE}" done ADDONSINFO="$(readConfigEntriesArray "addons" "${USER_CONFIG_FILE}")" - if [ "${NANOVER}" == "2" ]; then - ADDONSINFO+="\n\nWARN: DSM 7.2.2 isn't supported by app-specific Addons!" - dialog --backtitle "$(backtitle)" --title "DSM Addons" \ - --msgbox "DSM Addons selected:\n${ADDONSINFO}" 10 60 - else - dialog --backtitle "$(backtitle)" --title "DSM Addons" \ - --msgbox "DSM Addons selected:\n${ADDONSINFO}" 7 50 - fi + dialog --backtitle "$(backtitle)" --title "DSM Addons" \ + --msgbox "DSM Addons selected:\n${ADDONSINFO}" 7 50 } ############################################################################### diff --git a/files/initrd/opt/arc/arc.sh b/files/initrd/opt/arc/arc.sh index 7aa80b6df..666f6a46f 100755 --- a/files/initrd/opt/arc/arc.sh +++ b/files/initrd/opt/arc/arc.sh @@ -1032,7 +1032,7 @@ else echo "N \"Add new User\" " >>"${TMP_PATH}/menu" echo "D \"StaticIP \" " >>"${TMP_PATH}/menu" echo "J \"Reset DSM Network Config \" " >>"${TMP_PATH}/menu" - if [ "${PLATFORM}" == "epyc7002" ]; then + if [ "${PLATFORM}" == "epyc7002" ] && [ "${NANOVER}" == "1"]; then echo "K \"Kernel: \Z4${KERNEL}\Zn \" " >>"${TMP_PATH}/menu" fi if [ "${DT}" == "true" ]; then From ffe51043d4f454faeecf8fb2a4ac257797054813 Mon Sep 17 00:00:00 2001 From: AuxXxilium Date: Mon, 26 Aug 2024 15:02:43 -0400 Subject: [PATCH 10/10] tree: rewrite more Signed-off-by: AuxXxilium --- files/initrd/opt/arc/arc-functions.sh | 2 +- files/initrd/opt/arc/arc.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/files/initrd/opt/arc/arc-functions.sh b/files/initrd/opt/arc/arc-functions.sh index 64b3047cd..6788b5540 100755 --- a/files/initrd/opt/arc/arc-functions.sh +++ b/files/initrd/opt/arc/arc-functions.sh @@ -52,7 +52,7 @@ function addonSelection() { arrayExistItem "${ADDON}" "${!ADDONS[@]}" && ACT="on" || ACT="off" if [[ "${ADDON}" == "amepatch" || "${ADDON}" == "sspatch" || "${ADDON}" == "arcdns" ]] && [ "${ARCPATCH}" == "false" ]; then continue - elif [[ "${ADDON}" == "amepatch" || "${ADDON}" == "sspatch" || "${ADDON}" == "photosfacepatch" || "${ADDON}" == "remotefs" ]] && [ "${NANOVER}" == "2" ]; then + elif [[ "${ADDON}" == "codecpatch" || "${ADDON}" == "sspatch" ]] && [ "${NANOVER}" == "2" ]; then continue elif [ "${ADDON}" == "cpufreqscaling" ] && [ "${CPUFREQ}" == "false" ]; then continue diff --git a/files/initrd/opt/arc/arc.sh b/files/initrd/opt/arc/arc.sh index 666f6a46f..a5bb71273 100755 --- a/files/initrd/opt/arc/arc.sh +++ b/files/initrd/opt/arc/arc.sh @@ -951,7 +951,7 @@ if [ "${AUTOMATED}" == "true" ]; then fi else dialog --backtitle "$(backtitle)" --title "Arc Warning" \ - --msgbox "WARN: Be aware of using DSM 7.2.2 is not stable,\nall Addons and Patches are written for 7.2.1." 6 55 + --msgbox "WARN: Be aware of using DSM 7.2.2 is not stable,\nsome Addons are only available for DSM 7.2.1." 6 55 [ "${BUILDDONE}" == "true" ] && NEXT="3" || NEXT="1" while true; do echo "= \"\Z4========== Main ==========\Zn \" " >"${TMP_PATH}/menu"