Skip to content

Commit

Permalink
tree: rewrite
Browse files Browse the repository at this point in the history
Signed-off-by: AuxXxilium <[email protected]>
  • Loading branch information
AuxXxilium committed Aug 26, 2024
1 parent 0595c78 commit 7d7d719
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 9 deletions.
3 changes: 2 additions & 1 deletion files/initrd/opt/arc/arc-functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
23 changes: 16 additions & 7 deletions files/initrd/opt/arc/arc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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} | "
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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}"
Expand All @@ -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
Expand All @@ -461,13 +468,15 @@ 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
initConfigKey "addons.cpufreqscaling" "" "${USER_CONFIG_FILE}"
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
Expand Down Expand Up @@ -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=""
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion files/initrd/opt/arc/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down

0 comments on commit 7d7d719

Please sign in to comment.