tree: cleanup

Signed-off-by: AuxXxilium <info@auxxxilium.tech>
This commit is contained in:
AuxXxilium 2024-11-16 22:58:57 +01:00
parent 71e7eba6f3
commit 8c22d11c49
13 changed files with 253 additions and 248 deletions

View File

@ -49,15 +49,15 @@ function addonSelection() {
touch "${TMP_PATH}/opts" touch "${TMP_PATH}/opts"
while read -r ADDON DESC; do while read -r ADDON DESC; do
arrayExistItem "${ADDON}" "${!ADDONS[@]}" && ACT="on" || ACT="off" arrayExistItem "${ADDON}" "${!ADDONS[@]}" && ACT="on" || ACT="off"
if [[ "${ADDON}" == "amepatch" || "${ADDON}" == "arcdns" ]] && [ -z "${ARCCONF}" ]; then if [[ "${ADDON}" = "amepatch" || "${ADDON}" = "arcdns" ]] && [ -z "${ARCCONF}" ]; then
continue continue
elif [ "${ADDON}" == "codecpatch" ] && [ -n "${ARCCONF}" ]; then elif [ "${ADDON}" = "codecpatch" ] && [ -n "${ARCCONF}" ]; then
continue continue
else else
echo -e "${ADDON} \"${DESC}\" ${ACT}" >>"${TMP_PATH}/opts" echo -e "${ADDON} \"${DESC}\" ${ACT}" >>"${TMP_PATH}/opts"
fi fi
done < <(availableAddons "${PLATFORM}") done < <(availableAddons "${PLATFORM}")
if [ "${STEP}" == "addons" ]; then if [ "${STEP}" = "addons" ]; then
dialog --backtitle "$(backtitlep)" --title "Addons" --colors --aspect 18 \ dialog --backtitle "$(backtitlep)" --title "Addons" --colors --aspect 18 \
--checklist "Select Addons to include.\nAddons: \Z1System Addon\Zn | \Z4App Addon\Zn\nSelect with SPACE, Confirm with ENTER!" 0 0 0 \ --checklist "Select 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" --file "${TMP_PATH}/opts" 2>"${TMP_PATH}/resp"
@ -78,7 +78,7 @@ function addonSelection() {
writeConfigKey "addons.\"${ADDON}\"" "" "${USER_CONFIG_FILE}" writeConfigKey "addons.\"${ADDON}\"" "" "${USER_CONFIG_FILE}"
done done
ADDONSINFO="$(readConfigEntriesArray "addons" "${USER_CONFIG_FILE}")" ADDONSINFO="$(readConfigEntriesArray "addons" "${USER_CONFIG_FILE}")"
if [ "${STEP}" == "addons" ]; then if [ "${STEP}" = "addons" ]; then
dialog --backtitle "$(backtitlep)" --title "Addons" \ dialog --backtitle "$(backtitlep)" --title "Addons" \
--msgbox "Addons selected:\n${ADDONSINFO}" 7 70 --msgbox "Addons selected:\n${ADDONSINFO}" 7 70
else else
@ -95,7 +95,7 @@ function modulesMenu() {
PLATFORM="$(readConfigKey "platform" "${USER_CONFIG_FILE}")" PLATFORM="$(readConfigKey "platform" "${USER_CONFIG_FILE}")"
KVER="$(readConfigKey "platforms.${PLATFORM}.productvers.\"${PRODUCTVER}\".kver" "${P_FILE}")" KVER="$(readConfigKey "platforms.${PLATFORM}.productvers.\"${PRODUCTVER}\".kver" "${P_FILE}")"
# Modify KVER for Epyc7002 # Modify KVER for Epyc7002
[ "${PLATFORM}" == "epyc7002" ] && KVERP="${PRODUCTVER}-${KVER}" || KVERP="${KVER}" [ "${PLATFORM}" = "epyc7002" ] && KVERP="${PRODUCTVER}-${KVER}" || KVERP="${KVER}"
# menu loop # menu loop
while true; do while true; do
dialog --backtitle "$(backtitle)" --title "Modules" --cancel-label "Exit" --menu "Choose an Option" 0 0 0 \ dialog --backtitle "$(backtitle)" --title "Modules" --cancel-label "Exit" --menu "Choose an Option" 0 0 0 \
@ -207,7 +207,7 @@ function modulesMenu() {
--ok-label "Proceed" --msgbox "Please upload the *.ko file to /tmp/users.\n- Use SFTP at ${IPCON}:22 User: root PW: arc\n- Use Webclient at http://${IPCON}:7304" 7 50 --ok-label "Proceed" --msgbox "Please upload the *.ko file to /tmp/users.\n- Use SFTP at ${IPCON}:22 User: root PW: arc\n- Use Webclient at http://${IPCON}:7304" 7 50
for F in $(ls "${TMP_UP_PATH}" 2>/dev/null); do for F in $(ls "${TMP_UP_PATH}" 2>/dev/null); do
USER_FILE="${F}" USER_FILE="${F}"
if [ -n "${USER_FILE}" ] && [ "${USER_FILE##*.}" == "ko" ]; then if [ -n "${USER_FILE}" ] && [ "${USER_FILE##*.}" = "ko" ]; then
addToModules "${PLATFORM}" "${KVERP}" "${TMP_UP_PATH}/${USER_FILE}" addToModules "${PLATFORM}" "${KVERP}" "${TMP_UP_PATH}/${USER_FILE}"
dialog --backtitle "$(backtitle)" --title "External Modules" \ dialog --backtitle "$(backtitle)" --title "External Modules" \
--msgbox "Module: ${USER_FILE}\nadded to ${PLATFORM}-${KVERP}" 7 50 --msgbox "Module: ${USER_FILE}\nadded to ${PLATFORM}-${KVERP}" 7 50
@ -252,7 +252,7 @@ function modulesMenu() {
KOLIST=($(echo ${KOLIST} | tr ' ' '\n' | sort -u)) KOLIST=($(echo ${KOLIST} | tr ' ' '\n' | sort -u))
while read -r ID DESC; do while read -r ID DESC; do
for MOD in ${KOLIST[@]}; do for MOD in ${KOLIST[@]}; do
[ "${MOD}" == "${ID}" ] && echo "F ${ID}.ko" >>"${TMP_PATH}/modulelist.tmp" [ "${MOD}" = "${ID}" ] && echo "F ${ID}.ko" >>"${TMP_PATH}/modulelist.tmp"
done done
done < <(getAllModules "${PLATFORM}" "${KVERP}") done < <(getAllModules "${PLATFORM}" "${KVERP}")
[ ! -d "${USER_UP_PATH}" ] && mkdir -p "${USER_UP_PATH}" [ ! -d "${USER_UP_PATH}" ] && mkdir -p "${USER_UP_PATH}"
@ -627,7 +627,7 @@ function keymapMenu() {
# Shows storagepanel menu to user # Shows storagepanel menu to user
function storagepanelMenu() { function storagepanelMenu() {
CONFDONE="$(readConfigKey "arc.confdone" "${USER_CONFIG_FILE}")" CONFDONE="$(readConfigKey "arc.confdone" "${USER_CONFIG_FILE}")"
if [ "${CONFDONE}" == "true" ]; then if [ "${CONFDONE}" = "true" ]; then
while true; do while true; do
STORAGEPANELUSER="$(readConfigKey "addons.storagepanel" "${USER_CONFIG_FILE}")" STORAGEPANELUSER="$(readConfigKey "addons.storagepanel" "${USER_CONFIG_FILE}")"
[ -n "${STORAGEPANELUSER}" ] && DISKPANELUSER="$(echo ${STORAGEPANELUSER} | cut -d' ' -f1)" || DISKPANELUSER="RACK_24_Bay" [ -n "${STORAGEPANELUSER}" ] && DISKPANELUSER="$(echo ${STORAGEPANELUSER} | cut -d' ' -f1)" || DISKPANELUSER="RACK_24_Bay"
@ -660,7 +660,7 @@ function storagepanelMenu() {
# Shows sequentialIO menu to user # Shows sequentialIO menu to user
function sequentialIOMenu() { function sequentialIOMenu() {
CONFDONE="$(readConfigKey "arc.confdone" "${USER_CONFIG_FILE}")" CONFDONE="$(readConfigKey "arc.confdone" "${USER_CONFIG_FILE}")"
if [ "${CONFDONE}" == "true" ]; then if [ "${CONFDONE}" = "true" ]; then
while true; do while true; do
dialog --backtitle "$(backtitle)" --title "SequentialIO" --cancel-label "Exit" --menu "Choose an Option" 0 0 0 \ dialog --backtitle "$(backtitle)" --title "SequentialIO" --cancel-label "Exit" --menu "Choose an Option" 0 0 0 \
1 "Enable for SSD Cache" \ 1 "Enable for SSD Cache" \
@ -751,7 +751,7 @@ function backupMenu() {
if [ -n "${PRODUCTVER}" ]; then if [ -n "${PRODUCTVER}" ]; then
PLATFORM="$(readConfigKey "platform" "${USER_CONFIG_FILE}")" PLATFORM="$(readConfigKey "platform" "${USER_CONFIG_FILE}")"
KVER="$(readConfigKey "platforms.${PLATFORM}.productvers.\"${PRODUCTVER}\".kver" "${P_FILE}")" KVER="$(readConfigKey "platforms.${PLATFORM}.productvers.\"${PRODUCTVER}\".kver" "${P_FILE}")"
[ "${PLATFORM}" == "epyc7002" ] && KVERP="${PRODUCTVER}-${KVER}" || KVERP="${KVER}" [ "${PLATFORM}" = "epyc7002" ] && KVERP="${PRODUCTVER}-${KVER}" || KVERP="${KVER}"
fi fi
if [ -n "${PLATFORM}" ] && [ -n "${KVERP}" ]; then if [ -n "${PLATFORM}" ] && [ -n "${KVERP}" ]; then
writeConfigKey "modules" "{}" "${USER_CONFIG_FILE}" writeConfigKey "modules" "{}" "${USER_CONFIG_FILE}"
@ -813,7 +813,7 @@ function backupMenu() {
rm -rf "${TMP_PATH}/mdX" >/dev/null rm -rf "${TMP_PATH}/mdX" >/dev/null
) 2>&1 | dialog --backtitle "$(backtitle)" --title "Backup Encrytion Key" \ ) 2>&1 | dialog --backtitle "$(backtitle)" --title "Backup Encrytion Key" \
--progressbox "Backup Encryption Key ..." 20 70 --progressbox "Backup Encryption Key ..." 20 70
if [ "${BACKUPKEY}" == "true" ]; then if [ "${BACKUPKEY}" = "true" ]; then
dialog --backtitle "$(backtitle)" --title "Backup Encrytion Key" \ dialog --backtitle "$(backtitle)" --title "Backup Encrytion Key" \
--msgbox "Encryption Key backup successful!" 0 0 --msgbox "Encryption Key backup successful!" 0 0
else else
@ -922,7 +922,7 @@ function storageMenu() {
DT="$(readConfigKey "platforms.${PLATFORM}.dt" "${P_FILE}")" DT="$(readConfigKey "platforms.${PLATFORM}.dt" "${P_FILE}")"
# Get Portmap for Loader # Get Portmap for Loader
getmap getmap
if [ "${DT}" == "false" ] && [ $(lspci -d ::106 | wc -l) -gt 0 ]; then if [ "${DT}" = "false" ] && [ $(lspci -d ::106 | wc -l) -gt 0 ]; then
getmapSelection getmapSelection
fi fi
writeConfigKey "arc.builddone" "false" "${USER_CONFIG_FILE}" writeConfigKey "arc.builddone" "false" "${USER_CONFIG_FILE}"
@ -954,7 +954,7 @@ function sysinfo() {
ARC_BRANCH="$(readConfigKey "arc.branch" "${USER_CONFIG_FILE}")" ARC_BRANCH="$(readConfigKey "arc.branch" "${USER_CONFIG_FILE}")"
CONFDONE="$(readConfigKey "arc.confdone" "${USER_CONFIG_FILE}")" CONFDONE="$(readConfigKey "arc.confdone" "${USER_CONFIG_FILE}")"
BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")" BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")"
if [ "${CONFDONE}" == "true" ]; then if [ "${CONFDONE}" = "true" ]; then
MODEL="$(readConfigKey "model" "${USER_CONFIG_FILE}")" MODEL="$(readConfigKey "model" "${USER_CONFIG_FILE}")"
MODELID="$(readConfigKey "modelid" "${USER_CONFIG_FILE}")" MODELID="$(readConfigKey "modelid" "${USER_CONFIG_FILE}")"
PRODUCTVER="$(readConfigKey "productver" "${USER_CONFIG_FILE}")" PRODUCTVER="$(readConfigKey "productver" "${USER_CONFIG_FILE}")"
@ -964,18 +964,18 @@ function sysinfo() {
ARCPATCH="$(readConfigKey "arc.patch" "${USER_CONFIG_FILE}")" ARCPATCH="$(readConfigKey "arc.patch" "${USER_CONFIG_FILE}")"
ADDONSINFO="$(readConfigEntriesArray "addons" "${USER_CONFIG_FILE}")" ADDONSINFO="$(readConfigEntriesArray "addons" "${USER_CONFIG_FILE}")"
REMAP="$(readConfigKey "arc.remap" "${USER_CONFIG_FILE}")" REMAP="$(readConfigKey "arc.remap" "${USER_CONFIG_FILE}")"
if [ "${REMAP}" == "acports" ] || [ "${REMAP}" == "maxports" ]; then if [ "${REMAP}" = "acports" ] || [ "${REMAP}" = "maxports" ]; then
PORTMAP="$(readConfigKey "cmdline.SataPortMap" "${USER_CONFIG_FILE}")" PORTMAP="$(readConfigKey "cmdline.SataPortMap" "${USER_CONFIG_FILE}")"
DISKMAP="$(readConfigKey "cmdline.DiskIdxMap" "${USER_CONFIG_FILE}")" DISKMAP="$(readConfigKey "cmdline.DiskIdxMap" "${USER_CONFIG_FILE}")"
elif [ "${REMAP}" == "remap" ]; then elif [ "${REMAP}" = "remap" ]; then
PORTMAP="$(readConfigKey "cmdline.sata_remap" "${USER_CONFIG_FILE}")" PORTMAP="$(readConfigKey "cmdline.sata_remap" "${USER_CONFIG_FILE}")"
elif [ "${REMAP}" == "ahci" ]; then elif [ "${REMAP}" = "ahci" ]; then
AHCIPORTMAP="$(readConfigKey "cmdline.ahci_remap" "${USER_CONFIG_FILE}")" AHCIPORTMAP="$(readConfigKey "cmdline.ahci_remap" "${USER_CONFIG_FILE}")"
fi fi
USERCMDLINEINFO="$(readConfigMap "cmdline" "${USER_CONFIG_FILE}")" USERCMDLINEINFO="$(readConfigMap "cmdline" "${USER_CONFIG_FILE}")"
USERSYNOINFO="$(readConfigMap "synoinfo" "${USER_CONFIG_FILE}")" USERSYNOINFO="$(readConfigMap "synoinfo" "${USER_CONFIG_FILE}")"
fi fi
[ "${CONFDONE}" == "true" ] && BUILDNUM="$(readConfigKey "buildnum" "${USER_CONFIG_FILE}")" [ "${CONFDONE}" = "true" ] && BUILDNUM="$(readConfigKey "buildnum" "${USER_CONFIG_FILE}")"
DIRECTBOOT="$(readConfigKey "directboot" "${USER_CONFIG_FILE}")" DIRECTBOOT="$(readConfigKey "directboot" "${USER_CONFIG_FILE}")"
LKM="$(readConfigKey "lkm" "${USER_CONFIG_FILE}")" LKM="$(readConfigKey "lkm" "${USER_CONFIG_FILE}")"
KERNELLOAD="$(readConfigKey "kernelload" "${USER_CONFIG_FILE}")" KERNELLOAD="$(readConfigKey "kernelload" "${USER_CONFIG_FILE}")"
@ -1045,8 +1045,8 @@ function sysinfo() {
TEXT+="\n Subversion: \ZbAddons ${ADDONSVERSION} | Configs ${CONFIGSVERSION} | LKM ${LKMVERSION} | Modules ${MODULESVERSION} | Patches ${PATCHESVERSION}\Zn" TEXT+="\n Subversion: \ZbAddons ${ADDONSVERSION} | Configs ${CONFIGSVERSION} | LKM ${LKMVERSION} | Modules ${MODULESVERSION} | Patches ${PATCHESVERSION}\Zn"
TEXT+="\n Config | Build: \Zb${CONFDONE} | ${BUILDDONE}\Zn" TEXT+="\n Config | Build: \Zb${CONFDONE} | ${BUILDDONE}\Zn"
TEXT+="\n Config Version: \Zb${CONFIGVER}\Zn" TEXT+="\n Config Version: \Zb${CONFIGVER}\Zn"
[ "${ARCOFFLINE}" == "true" ] && TEXT+="\n Offline Mode: \Zb${ARCOFFLINE}\Zn" [ "${ARCOFFLINE}" = "true" ] && TEXT+="\n Offline Mode: \Zb${ARCOFFLINE}\Zn"
if [ "${CONFDONE}" == "true" ]; then if [ "${CONFDONE}" = "true" ]; then
TEXT+="\n\Z4> DSM ${PRODUCTVER} (${BUILDNUM}): ${MODELID:-${MODEL}}\Zn" TEXT+="\n\Z4> DSM ${PRODUCTVER} (${BUILDNUM}): ${MODELID:-${MODEL}}\Zn"
TEXT+="\n Kernel | LKM: \Zb${KVER} | ${LKM}\Zn" TEXT+="\n Kernel | LKM: \Zb${KVER} | ${LKM}\Zn"
TEXT+="\n Platform | DeviceTree: \Zb${PLATFORM} | ${DT}\Zn" TEXT+="\n Platform | DeviceTree: \Zb${PLATFORM} | ${DT}\Zn"
@ -1059,26 +1059,26 @@ function sysinfo() {
TEXT+="\n Config not completed!\n" TEXT+="\n Config not completed!\n"
fi fi
TEXT+="\n Modules loaded: \Zb${MODULESINFO}\Zn" TEXT+="\n Modules loaded: \Zb${MODULESINFO}\Zn"
if [ "${CONFDONE}" == "true" ]; then if [ "${CONFDONE}" = "true" ]; then
[ -n "${USERCMDLINEINFO}" ] && TEXT+="\n User Cmdline: \Zb${USERCMDLINEINFO}\Zn" [ -n "${USERCMDLINEINFO}" ] && TEXT+="\n User Cmdline: \Zb${USERCMDLINEINFO}\Zn"
TEXT+="\n User Synoinfo: \Zb${USERSYNOINFO}\Zn" TEXT+="\n User Synoinfo: \Zb${USERSYNOINFO}\Zn"
fi fi
TEXT+="\n" TEXT+="\n"
TEXT+="\n\Z4> Settings\Zn" TEXT+="\n\Z4> Settings\Zn"
if [[ "${REMAP}" == "acports" || "${REMAP}" == "maxports" ]]; then if [[ "${REMAP}" = "acports" || "${REMAP}" = "maxports" ]]; then
TEXT+="\n SataPortMap | DiskIdxMap: \Zb${PORTMAP} | ${DISKMAP}\Zn" TEXT+="\n SataPortMap | DiskIdxMap: \Zb${PORTMAP} | ${DISKMAP}\Zn"
elif [ "${REMAP}" == "remap" ]; then elif [ "${REMAP}" = "remap" ]; then
TEXT+="\n SataRemap: \Zb${PORTMAP}\Zn" TEXT+="\n SataRemap: \Zb${PORTMAP}\Zn"
elif [ "${REMAP}" == "ahci" ]; then elif [ "${REMAP}" = "ahci" ]; then
TEXT+="\n AhciRemap: \Zb${AHCIPORTMAP}\Zn" TEXT+="\n AhciRemap: \Zb${AHCIPORTMAP}\Zn"
elif [ "${REMAP}" == "user" ]; then elif [ "${REMAP}" = "user" ]; then
TEXT+="\n PortMap: \Zb"User"\Zn" TEXT+="\n PortMap: \Zb"User"\Zn"
[ -n "${PORTMAP}" ] && TEXT+="\n SataPortmap: \Zb${PORTMAP}\Zn" [ -n "${PORTMAP}" ] && TEXT+="\n SataPortmap: \Zb${PORTMAP}\Zn"
[ -n "${DISKMAP}" ] && TEXT+="\n DiskIdxMap: \Zb${DISKMAP}\Zn" [ -n "${DISKMAP}" ] && TEXT+="\n DiskIdxMap: \Zb${DISKMAP}\Zn"
[ -n "${PORTREMAP}" ] && TEXT+="\n SataRemap: \Zb${PORTREMAP}\Zn" [ -n "${PORTREMAP}" ] && TEXT+="\n SataRemap: \Zb${PORTREMAP}\Zn"
[ -n "${AHCIPORTREMAP}" ] && TEXT+="\n AhciRemap: \Zb${AHCIPORTREMAP}\Zn" [ -n "${AHCIPORTREMAP}" ] && TEXT+="\n AhciRemap: \Zb${AHCIPORTREMAP}\Zn"
fi fi
if [ "${DT}" == "true" ]; then if [ "${DT}" = "true" ]; then
TEXT+="\n Hotplug: \Zb${HDDSORT}\Zn" TEXT+="\n Hotplug: \Zb${HDDSORT}\Zn"
else else
TEXT+="\n USB Mount: \Zb${USBMOUNT}\Zn" TEXT+="\n USB Mount: \Zb${USBMOUNT}\Zn"
@ -1099,8 +1099,8 @@ function sysinfo() {
PORTS=$(ls -l /sys/class/scsi_host | grep "${PCI}" | awk -F'/' '{print $NF}' | sed 's/host//' | sort -n) PORTS=$(ls -l /sys/class/scsi_host | grep "${PCI}" | awk -F'/' '{print $NF}' | sed 's/host//' | sort -n)
for P in ${PORTS}; do for P in ${PORTS}; do
if lsscsi -b | grep -v - | grep -q "\[${P}:"; then if lsscsi -b | grep -v - | grep -q "\[${P}:"; then
DUMMY="$([ "$(cat /sys/class/scsi_host/host${P}/ahci_port_cmd)" == "0" ] && echo 1 || echo 2)" DUMMY="$([ "$(cat /sys/class/scsi_host/host${P}/ahci_port_cmd)" = "0" ] && echo 1 || echo 2)"
if [ "$(cat /sys/class/scsi_host/host${P}/ahci_port_cmd)" == "0" ]; then if [ "$(cat /sys/class/scsi_host/host${P}/ahci_port_cmd)" = "0" ]; then
TEXT+="\Z1\Zb$(printf "%02d" ${P})\Zn " TEXT+="\Z1\Zb$(printf "%02d" ${P})\Zn "
else else
TEXT+="\Z2\Zb$(printf "%02d" ${P})\Zn " TEXT+="\Z2\Zb$(printf "%02d" ${P})\Zn "
@ -1269,7 +1269,7 @@ function networkdiag() {
dnsserver=$(cat /etc/resolv.conf | grep nameserver | awk '{print $2}') dnsserver=$(cat /etc/resolv.conf | grep nameserver | awk '{print $2}')
echo -e "DNS Server:\n${dnsserver}" echo -e "DNS Server:\n${dnsserver}"
echo echo
if [ "${ARCOFFLINE}" == "true" ]; then if [ "${ARCOFFLINE}" = "true" ]; then
echo -e "Offline Mode: ${ARCOFFLINE}" echo -e "Offline Mode: ${ARCOFFLINE}"
else else
websites=("google.com" "github.com" "auxxxilium.tech") websites=("google.com" "github.com" "auxxxilium.tech")
@ -1294,7 +1294,7 @@ function networkdiag() {
else else
echo -e "Github API reachable!" echo -e "Github API reachable!"
fi fi
if [ "${CONFDONE}" == "true" ]; then if [ "${CONFDONE}" = "true" ]; then
SYNOAPI=$(curl --interface ${N} -skL -m 10 "https://www.synology.com/api/support/findDownloadInfo?lang=en-us&product=${MODEL/+/%2B}&major=${PRODUCTVER%%.*}&minor=${PRODUCTVER##*.}" | jq -r '.info.system.detail[0].items[0].files[0].url') SYNOAPI=$(curl --interface ${N} -skL -m 10 "https://www.synology.com/api/support/findDownloadInfo?lang=en-us&product=${MODEL/+/%2B}&major=${PRODUCTVER%%.*}&minor=${PRODUCTVER##*.}" | jq -r '.info.system.detail[0].items[0].files[0].url')
if [[ $? -ne 0 || -z "${SYNOAPI}" ]]; then if [[ $? -ne 0 || -z "${SYNOAPI}" ]]; then
echo -e "Syno API not reachable!" echo -e "Syno API not reachable!"
@ -1465,7 +1465,7 @@ function resetPassword() {
while read L; do while read L; do
U=$(echo "${L}" | awk -F ':' '{if ($2 != "*" && $2 != "!!") print $1;}') U=$(echo "${L}" | awk -F ':' '{if ($2 != "*" && $2 != "!!") print $1;}')
[ -z "${U}" ] && continue [ -z "${U}" ] && continue
E=$(echo "${L}" | awk -F ':' '{if ($8 == "1") print "disabled"; else print " ";}') E=$(echo "${L}" | awk -F ':' '{if ($8 = "1") print "disabled"; else print " ";}')
grep -q "status=on" "${TMP_PATH}/mdX/usr/syno/etc/packages/SecureSignIn/preference/${U}/method.config" 2>/dev/null grep -q "status=on" "${TMP_PATH}/mdX/usr/syno/etc/packages/SecureSignIn/preference/${U}/method.config" 2>/dev/null
[ $? -eq 0 ] && S="SecureSignIn" || S=" " [ $? -eq 0 ] && S="SecureSignIn" || S=" "
printf "\"%-36s %-10s %-14s\"\n" "${U}" "${E}" "${S}" >>"${TMP_PATH}/menu" printf "\"%-36s %-10s %-14s\"\n" "${U}" "${E}" "${S}" >>"${TMP_PATH}/menu"
@ -1557,7 +1557,7 @@ EOF
rm -rf "${TMP_PATH}/mdX" >/dev/null rm -rf "${TMP_PATH}/mdX" >/dev/null
) 2>&1 | dialog --backtitle "$(backtitle)" --title "Add DSM User" \ ) 2>&1 | dialog --backtitle "$(backtitle)" --title "Add DSM User" \
--progressbox "Adding ..." 20 100 --progressbox "Adding ..." 20 100
[ "$(cat ${TMP_PATH}/isEnable 2>/dev/null)" == "true" ] && MSG="Add DSM User successful." || MSG="Add DSM User failed." [ "$(cat ${TMP_PATH}/isEnable 2>/dev/null)" = "true" ] && MSG="Add DSM User successful." || MSG="Add DSM User failed."
dialog --backtitle "$(backtitle)" --title "Add DSM User" \ dialog --backtitle "$(backtitle)" --title "Add DSM User" \
--msgbox "${MSG}" 0 0 --msgbox "${MSG}" 0 0
return return
@ -1722,9 +1722,9 @@ function formatDisks() {
rm -f "${TMP_PATH}/opts" rm -f "${TMP_PATH}/opts"
while read -r KNAME SIZE TYPE PKNAME; do while read -r KNAME SIZE TYPE PKNAME; do
[ -z "${KNAME}" ] && continue [ -z "${KNAME}" ] && continue
[ "${KNAME}" == "N/A" ] && continue [ "${KNAME}" = "N/A" ] && continue
[[ "${KNAME}" == /dev/md* ]] && continue [[ "${KNAME}" = /dev/md* ]] && continue
[[ "${KNAME}" == "${LOADER_DISK}" || "${PKNAME}" == "${LOADER_DISK}" ]] && continue [[ "${KNAME}" = "${LOADER_DISK}" || "${PKNAME}" = "${LOADER_DISK}" ]] && continue
[ -z "${SIZE}" ] && SIZE="Unknown" [ -z "${SIZE}" ] && SIZE="Unknown"
printf "\"%s\" \"%-6s %-4s %s\" \"off\"\n" "${KNAME}" "${SIZE}" "${TYPE}" >>"${TMP_PATH}/opts" printf "\"%s\" \"%-6s %-4s %s\" \"off\"\n" "${KNAME}" "${SIZE}" "${TYPE}" >>"${TMP_PATH}/opts"
done < <(lsblk -Jpno KNAME,SIZE,TYPE,PKNAME 2>/dev/null | sed 's|null|"N/A"|g' | jq -r '.blockdevices[] | "\(.kname) \(.size) \(.type) \(.pkname)"' 2>/dev/null) done < <(lsblk -Jpno KNAME,SIZE,TYPE,PKNAME 2>/dev/null | sed 's|null|"N/A"|g' | jq -r '.blockdevices[] | "\(.kname) \(.size) \(.type) \(.pkname)"' 2>/dev/null)
@ -1769,10 +1769,10 @@ function cloneLoader() {
rm -f "${TMP_PATH}/opts" >/dev/null rm -f "${TMP_PATH}/opts" >/dev/null
while read -r KNAME SIZE TYPE PKNAME; do while read -r KNAME SIZE TYPE PKNAME; do
[ -z "${KNAME}" ] && continue [ -z "${KNAME}" ] && continue
[ "${KNAME}" == "N/A" ] && continue [ "${KNAME}" = "N/A" ] && continue
[ "${TYPE}" != "disk" ] && continue [ "${TYPE}" != "disk" ] && continue
[[ "${KNAME}" == /dev/md* ]] && continue [[ "${KNAME}" = /dev/md* ]] && continue
[[ "${KNAME}" == "${LOADER_DISK}" || "${PKNAME}" == "${LOADER_DISK}" ]] && continue [[ "${KNAME}" = "${LOADER_DISK}" || "${PKNAME}" = "${LOADER_DISK}" ]] && continue
[ -z "${SIZE}" ] && SIZE="Unknown" [ -z "${SIZE}" ] && SIZE="Unknown"
printf "\"%s\" \"%-6s %-4s %s\" \"off\"\n" "${KNAME}" "${SIZE}" "${TYPE}" >>"${TMP_PATH}/opts" printf "\"%s\" \"%-6s %-4s %s\" \"off\"\n" "${KNAME}" "${SIZE}" "${TYPE}" >>"${TMP_PATH}/opts"
done < <(lsblk -Jpno KNAME,SIZE,TYPE,PKNAME 2>/dev/null | sed 's|null|"N/A"|g' | jq -r '.blockdevices[] | "\(.kname) \(.size) \(.type) \(.pkname)"' 2>/dev/null) done < <(lsblk -Jpno KNAME,SIZE,TYPE,PKNAME 2>/dev/null | sed 's|null|"N/A"|g' | jq -r '.blockdevices[] | "\(.kname) \(.size) \(.type) \(.pkname)"' 2>/dev/null)
@ -1791,7 +1791,7 @@ function cloneLoader() {
--msgbox "No disk selected!" 0 0 --msgbox "No disk selected!" 0 0
return return
else else
SIZE=$(df -m ${resp} 2>/dev/null | awk 'NR==2 {print $2}') SIZE=$(df -m ${resp} 2>/dev/null | awk 'NR=2 {print $2}')
if [ ${SIZE:-0} -lt 1024 ]; then if [ ${SIZE:-0} -lt 1024 ]; then
dialog --backtitle "$(backtitle)" --colors --title "Clone Loader" \ dialog --backtitle "$(backtitle)" --colors --title "Clone Loader" \
--msgbox "Disk ${resp} size is less than 1GB and cannot be cloned!" 0 0 --msgbox "Disk ${resp} size is less than 1GB and cannot be cloned!" 0 0
@ -1984,7 +1984,7 @@ function rebootMenu() {
echo -e "config \"Arc: Config Mode\"" >>"${TMP_PATH}/opts" echo -e "config \"Arc: Config Mode\"" >>"${TMP_PATH}/opts"
echo -e "update \"Arc: Automated Update Mode\"" >>"${TMP_PATH}/opts" echo -e "update \"Arc: Automated Update Mode\"" >>"${TMP_PATH}/opts"
echo -e "network \"Arc: Restart Network Service\"" >>"${TMP_PATH}/opts" echo -e "network \"Arc: Restart Network Service\"" >>"${TMP_PATH}/opts"
if [ "${BUILDDONE}" == "true" ]; then if [ "${BUILDDONE}" = "true" ]; then
echo -e "recovery \"DSM: Recovery Mode\"" >>"${TMP_PATH}/opts" echo -e "recovery \"DSM: Recovery Mode\"" >>"${TMP_PATH}/opts"
echo -e "junior \"DSM: Reinstall Mode\"" >>"${TMP_PATH}/opts" echo -e "junior \"DSM: Reinstall Mode\"" >>"${TMP_PATH}/opts"
fi fi
@ -2000,13 +2000,13 @@ function rebootMenu() {
REDEST=${resp} REDEST=${resp}
dialog --backtitle "$(backtitle)" --title "Power Menu" \ dialog --backtitle "$(backtitle)" --title "Power Menu" \
--infobox "Option: ${REDEST} selected ...!" 3 50 --infobox "Option: ${REDEST} selected ...!" 3 50
if [ "${REDEST}" == "poweroff" ]; then if [ "${REDEST}" = "poweroff" ]; then
poweroff poweroff
exit 0 exit 0
elif [ "${REDEST}" == "shell" ]; then elif [ "${REDEST}" = "shell" ]; then
clear clear
exit 0 exit 0
elif [ "${REDEST}" == "network" ]; then elif [ "${REDEST}" = "network" ]; then
clear clear
/etc/init.d/S41dhcpcd restart /etc/init.d/S41dhcpcd restart
exec init.sh exec init.sh
@ -2085,9 +2085,9 @@ function governorMenu () {
function governorSelection () { function governorSelection () {
rm -f "${TMP_PATH}/opts" >/dev/null rm -f "${TMP_PATH}/opts" >/dev/null
touch "${TMP_PATH}/opts" touch "${TMP_PATH}/opts"
if [ "${ARCMODE}" == "config" ]; then if [ "${ARCMODE}" = "config" ]; then
# Selectable CPU governors # Selectable CPU governors
[ "${PLATFORM}" == "epyc7002" ] && echo -e "schedutil \"use schedutil to scale frequency *\"" >>"${TMP_PATH}/opts" [ "${PLATFORM}" = "epyc7002" ] && echo -e "schedutil \"use schedutil to scale frequency *\"" >>"${TMP_PATH}/opts"
[ "${PLATFORM}" != "epyc7002" ] && echo -e "ondemand \"use ondemand to scale frequency *\"" >>"${TMP_PATH}/opts" [ "${PLATFORM}" != "epyc7002" ] && echo -e "ondemand \"use ondemand to scale frequency *\"" >>"${TMP_PATH}/opts"
[ "${PLATFORM}" != "epyc7002" ] && echo -e "conservative \"use conservative to scale frequency\"" >>"${TMP_PATH}/opts" [ "${PLATFORM}" != "epyc7002" ] && echo -e "conservative \"use conservative to scale frequency\"" >>"${TMP_PATH}/opts"
echo -e "performance \"always run at max frequency\"" >>"${TMP_PATH}/opts" echo -e "performance \"always run at max frequency\"" >>"${TMP_PATH}/opts"
@ -2100,7 +2100,7 @@ function governorSelection () {
[ -z "${resp}" ] && return [ -z "${resp}" ] && return
CPUGOVERNOR=${resp} CPUGOVERNOR=${resp}
else else
[ "${PLATFORM}" == "epyc7002" ] && CPUGOVERNOR="schedutil" [ "${PLATFORM}" = "epyc7002" ] && CPUGOVERNOR="schedutil"
[ "${PLATFORM}" != "epyc7002" ] && CPUGOVERNOR="ondemand" [ "${PLATFORM}" != "epyc7002" ] && CPUGOVERNOR="ondemand"
fi fi
writeConfigKey "addons.cpufreqscaling" "${CPUGOVERNOR}" "${USER_CONFIG_FILE}" writeConfigKey "addons.cpufreqscaling" "${CPUGOVERNOR}" "${USER_CONFIG_FILE}"
@ -2213,7 +2213,7 @@ function getpatfiles() {
mkdir -p "${USER_UP_PATH}" mkdir -p "${USER_UP_PATH}"
DSM_FILE="${USER_UP_PATH}/${PAT_HASH}.tar" DSM_FILE="${USER_UP_PATH}/${PAT_HASH}.tar"
VALID="false" VALID="false"
if [ ! -f "${DSM_FILE}" ] && [ "${ARCOFFLINE}" == "false" ]; then if [ ! -f "${DSM_FILE}" ] && [ "${ARCOFFLINE}" = "false" ]; then
rm -f ${USER_UP_PATH}/*.tar rm -f ${USER_UP_PATH}/*.tar
dialog --backtitle "$(backtitlep)" --colors --title "DSM Boot Files" \ dialog --backtitle "$(backtitlep)" --colors --title "DSM Boot Files" \
--infobox "Downloading DSM Boot Files..." 3 40 --infobox "Downloading DSM Boot Files..." 3 40
@ -2222,7 +2222,7 @@ function getpatfiles() {
if curl -skL "${DSM_URL}" -o "${DSM_FILE}" 2>/dev/null; then if curl -skL "${DSM_URL}" -o "${DSM_FILE}" 2>/dev/null; then
VALID="true" VALID="true"
fi fi
elif [ ! -f "${DSM_FILE}" ] && [ "${ARCOFFLINE}" == "true" ]; then elif [ ! -f "${DSM_FILE}" ] && [ "${ARCOFFLINE}" = "true" ]; then
rm -f ${USER_UP_PATH}/*.tar rm -f ${USER_UP_PATH}/*.tar
dialog --backtitle "$(backtitlep)" --colors --title "DSM Boot Files" \ dialog --backtitle "$(backtitlep)" --colors --title "DSM Boot Files" \
--msgbox "Please upload the DSM Boot File to ${USER_UP_PATH}.\nUse ${IPCON}:7304 to upload and press OK after it's finished.\nLink: https://github.com/AuxXxilium/arc-dsm/blob/main/files/${MODEL}/${PRODUCTVER}/${PAT_HASH}.tar" 8 120 --msgbox "Please upload the DSM Boot File to ${USER_UP_PATH}.\nUse ${IPCON}:7304 to upload and press OK after it's finished.\nLink: https://github.com/AuxXxilium/arc-dsm/blob/main/files/${MODEL}/${PRODUCTVER}/${PAT_HASH}.tar" 8 120
@ -2234,7 +2234,7 @@ function getpatfiles() {
VALID="true" VALID="true"
fi fi
mkdir -p "${UNTAR_PAT_PATH}" mkdir -p "${UNTAR_PAT_PATH}"
if [ "${VALID}" == "true" ]; then if [ "${VALID}" = "true" ]; then
dialog --backtitle "$(backtitlep)" --title "DSM Boot Files" --aspect 18 \ dialog --backtitle "$(backtitlep)" --title "DSM Boot Files" --aspect 18 \
--infobox "Copying DSM Boot Files..." 3 40 --infobox "Copying DSM Boot Files..." 3 40
tar -xf "${DSM_FILE}" -C "${UNTAR_PAT_PATH}" 2>/dev/null tar -xf "${DSM_FILE}" -C "${UNTAR_PAT_PATH}" 2>/dev/null

View File

@ -69,19 +69,19 @@ function backtitle() {
BACKTITLE+="Build: ${BUILDDONE} | " BACKTITLE+="Build: ${BUILDDONE} | "
BACKTITLE+="${MACHINE}(${BUS}) | " BACKTITLE+="${MACHINE}(${BUS}) | "
[ -n "${KEYMAP}" ] && BACKTITLE+="KB: ${KEYMAP}" [ -n "${KEYMAP}" ] && BACKTITLE+="KB: ${KEYMAP}"
[ "${ARCOFFLINE}" == "true" ] && BACKTITLE+=" | Offline" [ "${ARCOFFLINE}" = "true" ] && BACKTITLE+=" | Offline"
echo "${BACKTITLE}" echo "${BACKTITLE}"
} }
function backtitlep() { function backtitlep() {
[ "${STEP}" == "model" ] && BACKTITLEP="CHOOSE MODEL >>> " || BACKTITLEP="Choose Model >>> " [ "${STEP}" = "model" ] && BACKTITLEP="CHOOSE MODEL >>> " || BACKTITLEP="Choose Model >>> "
[ "${STEP}" == "version" ] && BACKTITLEP+="CHOOSE VERSION >>> " || BACKTITLEP+="Choose Version >>> " [ "${STEP}" = "version" ] && BACKTITLEP+="CHOOSE VERSION >>> " || BACKTITLEP+="Choose Version >>> "
[ "${STEP}" == "snmac" ] && BACKTITLEP+="SET SN/MAC >>> " || BACKTITLEP+="Set SN/Mac >>> " [ "${STEP}" = "snmac" ] && BACKTITLEP+="SET SN/MAC >>> " || BACKTITLEP+="Set SN/Mac >>> "
[ "${STEP}" == "network" ] && BACKTITLEP+="SET NETWORK >>> " || BACKTITLEP+="Set Network >>> " [ "${STEP}" = "network" ] && BACKTITLEP+="SET NETWORK >>> " || BACKTITLEP+="Set Network >>> "
[ "${STEP}" == "storagemap" ] && BACKTITLEP+="SET STORAGEMAP >>> " || BACKTITLEP+="Set StorageMap >>> " [ "${STEP}" = "storagemap" ] && BACKTITLEP+="SET STORAGEMAP >>> " || BACKTITLEP+="Set StorageMap >>> "
[ "${STEP}" == "addons" ] && BACKTITLEP+="SET ADDONS >>> " || BACKTITLEP+="Set Addons >>> " [ "${STEP}" = "addons" ] && BACKTITLEP+="SET ADDONS >>> " || BACKTITLEP+="Set Addons >>> "
[ "${STEP}" == "build" ] && BACKTITLEP+="BUILD LOADER >>> " || BACKTITLEP+="Build Loader >>> " [ "${STEP}" = "build" ] && BACKTITLEP+="BUILD LOADER >>> " || BACKTITLEP+="Build Loader >>> "
[ "${STEP}" == "boot" ] && BACKTITLEP+="BOOT DSM" || BACKTITLEP+="Boot DSM" [ "${STEP}" = "boot" ] && BACKTITLEP+="BOOT DSM" || BACKTITLEP+="Boot DSM"
echo "${BACKTITLEP}" echo "${BACKTITLEP}"
} }
@ -105,7 +105,7 @@ function arcModel() {
echo "${M} ${P}" >>"${TMP_PATH}/modellist" echo "${M} ${P}" >>"${TMP_PATH}/modellist"
done < <(echo "${PM}") done < <(echo "${PM}")
done < <(echo "${PS}") done < <(echo "${PS}")
if [ "${ARCMODE}" == "config" ]; then if [ "${ARCMODE}" = "config" ]; then
while true; do while true; do
echo -n "" >"${TMP_PATH}/menu" echo -n "" >"${TMP_PATH}/menu"
while read -r M A; do while read -r M A; do
@ -116,16 +116,16 @@ function arcModel() {
ARC="" ARC=""
BETA="" BETA=""
[ -n "${ARCCONFM}" ] && ARC="x" || ARC="" [ -n "${ARCCONFM}" ] && ARC="x" || ARC=""
[ "${DT}" == "true" ] && DTS="x" || DTS="" [ "${DT}" = "true" ] && DTS="x" || DTS=""
IGPUS="" IGPUS=""
[[ "${A}" == "apollolake" || "${A}" == "geminilake" ]] && IGPUS="up to 9th" [[ "${A}" = "apollolake" || "${A}" = "geminilake" ]] && IGPUS="up to 9th"
[ "${A}" == "epyc7002" ] && IGPUS="up to 14th" [ "${A}" = "epyc7002" ] && IGPUS="up to 14th"
[ "${DT}" == "true" ] && HBAS="" || HBAS="x" [ "${DT}" = "true" ] && HBAS="" || HBAS="x"
[ "${M}" == "SA6400" ] && HBAS="x" [ "${M}" = "SA6400" ] && HBAS="x"
[ "${DT}" == "false" ] && USBS="int/ext" || USBS="ext" [ "${DT}" = "false" ] && USBS="int/ext" || USBS="ext"
[[ "${M}" == "DS918+" || "${M}" == "DS1019+" || "${M}" == "DS1621xs+" || "${M}" == "RS1619xs+" ]] && M_2_CACHE="+" || M_2_CACHE="x" [[ "${M}" = "DS918+" || "${M}" = "DS1019+" || "${M}" = "DS1621xs+" || "${M}" = "RS1619xs+" ]] && M_2_CACHE="+" || M_2_CACHE="x"
[[ "${M}" == "DS220+" || "${M}" == "DS224+" ]] && M_2_CACHE="" [[ "${M}" = "DS220+" || "${M}" = "DS224+" ]] && M_2_CACHE=""
[[ "${M}" == "DS220+" || "${M}" == "DS224+" || "${M}" == "DS918+" || "${M}" == "DS1019+" || "${M}" == "DS1621xs+" || "${M}" == "RS1619xs+" ]] && M_2_STORAGE="" || M_2_STORAGE="+" [[ "${M}" = "DS220+" || "${M}" = "DS224+" || "${M}" = "DS918+" || "${M}" = "DS1019+" || "${M}" = "DS1621xs+" || "${M}" = "RS1619xs+" ]] && M_2_STORAGE="" || M_2_STORAGE="+"
# Check id model is compatible with CPU # Check id model is compatible with CPU
if [ ${RESTRICT} -eq 1 ]; then if [ ${RESTRICT} -eq 1 ]; then
for F in "${FLAGS}"; do for F in "${FLAGS}"; do
@ -134,18 +134,18 @@ function arcModel() {
break break
fi fi
done done
if [ "${A}" != "epyc7002" ] && [ "${DT}" == "true" ] && [ "${EXTERNALCONTROLLER}" == "true" ]; then if [ "${A}" != "epyc7002" ] && [ "${DT}" = "true" ] && [ "${EXTERNALCONTROLLER}" = "true" ]; then
COMPATIBLE=0 COMPATIBLE=0
fi fi
if [ "${A}" != "epyc7002" ] && [ ${SATACONTROLLER} -eq 0 ] && [ "${EXTERNALCONTROLLER}" == "false" ]; then if [ "${A}" != "epyc7002" ] && [ ${SATACONTROLLER} -eq 0 ] && [ "${EXTERNALCONTROLLER}" = "false" ]; then
COMPATIBLE=0 COMPATIBLE=0
fi fi
if [ "${A}" == "epyc7002" ] && [[ ${SCSICONTROLLER} -ne 0 || ${RAIDCONTROLLER} -ne 0 ]]; then if [ "${A}" = "epyc7002" ] && [[ ${SCSICONTROLLER} -ne 0 || ${RAIDCONTROLLER} -ne 0 ]]; then
COMPATIBLE=0 COMPATIBLE=0
fi fi
if [ "${A}" != "epyc7002" ] && [ ${NVMEDRIVES} -gt 0 ] && [ "${BUS}" == "usb" ] && [ ${SATADRIVES} -eq 0 ] && [ "${EXTERNALCONTROLLER}" == "false" ]; then if [ "${A}" != "epyc7002" ] && [ ${NVMEDRIVES} -gt 0 ] && [ "${BUS}" = "usb" ] && [ ${SATADRIVES} -eq 0 ] && [ "${EXTERNALCONTROLLER}" = "false" ]; then
COMPATIBLE=0 COMPATIBLE=0
elif [ "${A}" != "epyc7002" ] && [ ${NVMEDRIVES} -gt 0 ] && [ "${BUS}" == "sata" ] && [ ${SATADRIVES} -eq 1 ] && [ "${EXTERNALCONTROLLER}" == "false" ]; then elif [ "${A}" != "epyc7002" ] && [ ${NVMEDRIVES} -gt 0 ] && [ "${BUS}" = "sata" ] && [ ${SATADRIVES} -eq 1 ] && [ "${EXTERNALCONTROLLER}" = "false" ]; then
COMPATIBLE=0 COMPATIBLE=0
fi fi
[ -z "$(grep -w "${M}" "${S_FILE}")" ] && COMPATIBLE=0 [ -z "$(grep -w "${M}" "${S_FILE}")" ] && COMPATIBLE=0
@ -194,7 +194,7 @@ function arcModel() {
done done
fi fi
# Reset Model Config if changed # Reset Model Config if changed
if [ "${ARCMODE}" == "config" ] && [ "${MODEL}" != "${resp}" ]; then if [ "${ARCMODE}" = "config" ] && [ "${MODEL}" != "${resp}" ]; then
MODEL="${resp}" MODEL="${resp}"
writeConfigKey "addons" "{}" "${USER_CONFIG_FILE}" writeConfigKey "addons" "{}" "${USER_CONFIG_FILE}"
writeConfigKey "arc.remap" "" "${USER_CONFIG_FILE}" writeConfigKey "arc.remap" "" "${USER_CONFIG_FILE}"
@ -243,7 +243,7 @@ function arcVersion() {
PAT_URL_CONF="$(readConfigKey "paturl" "${USER_CONFIG_FILE}")" PAT_URL_CONF="$(readConfigKey "paturl" "${USER_CONFIG_FILE}")"
PAT_HASH_CONF="$(readConfigKey "pathash" "${USER_CONFIG_FILE}")" PAT_HASH_CONF="$(readConfigKey "pathash" "${USER_CONFIG_FILE}")"
# Check for Custom Build # Check for Custom Build
if [ "${ARCMODE}" == "config" ] && [ "${ARCRESTORE}" != "true" ]; then if [ "${ARCMODE}" = "config" ] && [ "${ARCRESTORE}" != "true" ]; then
# Select Build for DSM # Select Build for DSM
ITEMS="$(readConfigEntriesArray "platforms.${PLATFORM}.productvers" "${P_FILE}" | sort -r)" ITEMS="$(readConfigEntriesArray "platforms.${PLATFORM}.productvers" "${P_FILE}" | sort -r)"
dialog --clear --no-items --nocancel --title "Version" --backtitle "$(backtitlep)" \ dialog --clear --no-items --nocancel --title "Version" --backtitle "$(backtitlep)" \
@ -276,7 +276,7 @@ function arcVersion() {
PVS="$(readConfigEntriesArray "${PLATFORM}.\"${MODEL}\"" "${D_FILE}" | sort -r)" PVS="$(readConfigEntriesArray "${PLATFORM}.\"${MODEL}\"" "${D_FILE}" | sort -r)"
echo -n "" >"${TMP_PATH}/versions" echo -n "" >"${TMP_PATH}/versions"
while read -r V; do while read -r V; do
if [ "${V:0:3}" != "${PRODUCTVER}" ] || [ "${V}" == "${PREV}" ]; then if [ "${V:0:3}" != "${PRODUCTVER}" ] || [ "${V}" = "${PREV}" ]; then
continue continue
else else
echo "${V}" >>"${TMP_PATH}/versions" echo "${V}" >>"${TMP_PATH}/versions"
@ -322,11 +322,11 @@ function arcVersion() {
dialog --backtitle "$(backtitlep)" --colors --title "Automated Mode" \ dialog --backtitle "$(backtitlep)" --colors --title "Automated Mode" \
--yesno "${MSG}" 6 55 --yesno "${MSG}" 6 55
[ $? -eq 0 ] && ARCMODE="automated" || ARCMODE="config" [ $? -eq 0 ] && ARCMODE="automated" || ARCMODE="config"
elif [ "${ARCMODE}" == "automated" ] || [ "${ARCRESTORE}" == "true" ]; then elif [ "${ARCMODE}" = "automated" ] || [ "${ARCRESTORE}" = "true" ]; then
VALID="true" VALID="true"
fi fi
# Change Config if Files are valid # Change Config if Files are valid
if [ "${VALID}" == "true" ]; then if [ "${VALID}" = "true" ]; then
dialog --backtitle "$(backtitlep)" --title "Arc Config" \ dialog --backtitle "$(backtitlep)" --title "Arc Config" \
--infobox "Reconfiguring Addons, Cmdline, Modules and Synoinfo" 3 60 --infobox "Reconfiguring Addons, Cmdline, Modules and Synoinfo" 3 60
# Reset Synoinfo # Reset Synoinfo
@ -338,27 +338,27 @@ function arcVersion() {
ADDONS="$(readConfigKey "addons" "${USER_CONFIG_FILE}")" ADDONS="$(readConfigKey "addons" "${USER_CONFIG_FILE}")"
DEVICENIC="$(readConfigKey "device.nic" "${USER_CONFIG_FILE}")" DEVICENIC="$(readConfigKey "device.nic" "${USER_CONFIG_FILE}")"
ARCCONF="$(readConfigKey "${MODEL}.serial" "${S_FILE}")" ARCCONF="$(readConfigKey "${MODEL}.serial" "${S_FILE}")"
if [ "${ADDONS}" == "{}" ]; then if [ "${ADDONS}" = "{}" ]; then
initConfigKey "addons.acpid" "" "${USER_CONFIG_FILE}" initConfigKey "addons.acpid" "" "${USER_CONFIG_FILE}"
initConfigKey "addons.cpuinfo" "" "${USER_CONFIG_FILE}" initConfigKey "addons.cpuinfo" "" "${USER_CONFIG_FILE}"
initConfigKey "addons.storagepanel" "" "${USER_CONFIG_FILE}" initConfigKey "addons.storagepanel" "" "${USER_CONFIG_FILE}"
initConfigKey "addons.updatenotify" "" "${USER_CONFIG_FILE}" initConfigKey "addons.updatenotify" "" "${USER_CONFIG_FILE}"
if [ ${NVMEDRIVES} -gt 0 ]; then if [ ${NVMEDRIVES} -gt 0 ]; then
if [ "${PLATFORM}" == "epyc7002" ] && [ ${SATADRIVES} -eq 0 ] && [ ${SASDRIVES} -eq 0 ]; then if [ "${PLATFORM}" = "epyc7002" ] && [ ${SATADRIVES} -eq 0 ] && [ ${SASDRIVES} -eq 0 ]; then
initConfigKey "addons.nvmesystem" "" "${USER_CONFIG_FILE}" initConfigKey "addons.nvmesystem" "" "${USER_CONFIG_FILE}"
elif [ "${MODEL}" == "DS918+" ] || [ "${MODEL}" == "DS1019+" ] || [ "${MODEL}" == "DS1621xs+" ] || [ "${MODEL}" == "RS1619xs+" ]; then elif [ "${MODEL}" = "DS918+" ] || [ "${MODEL}" = "DS1019+" ] || [ "${MODEL}" = "DS1621xs+" ] || [ "${MODEL}" = "RS1619xs+" ]; then
initConfigKey "addons.nvmecache" "" "${USER_CONFIG_FILE}" initConfigKey "addons.nvmecache" "" "${USER_CONFIG_FILE}"
initConfigKey "addons.nvmevolume" "" "${USER_CONFIG_FILE}" initConfigKey "addons.nvmevolume" "" "${USER_CONFIG_FILE}"
else else
initConfigKey "addons.nvmevolume" "" "${USER_CONFIG_FILE}" initConfigKey "addons.nvmevolume" "" "${USER_CONFIG_FILE}"
fi fi
fi fi
if [ "${MACHINE}" == "Native" ]; then if [ "${MACHINE}" = "Native" ]; then
initConfigKey "addons.cpufreqscaling" "" "${USER_CONFIG_FILE}" initConfigKey "addons.cpufreqscaling" "" "${USER_CONFIG_FILE}"
initConfigKey "addons.powersched" "" "${USER_CONFIG_FILE}" initConfigKey "addons.powersched" "" "${USER_CONFIG_FILE}"
initConfigKey "addons.sensors" "" "${USER_CONFIG_FILE}" initConfigKey "addons.sensors" "" "${USER_CONFIG_FILE}"
fi fi
if [ "${PLATFORM}" == "apollolake" ] || [ "${PLATFORM}" == "geminilake" ]; then if [ "${PLATFORM}" = "apollolake" ] || [ "${PLATFORM}" = "geminilake" ]; then
initConfigKey "addons.i915" "" "${USER_CONFIG_FILE}" initConfigKey "addons.i915" "" "${USER_CONFIG_FILE}"
fi fi
if echo "${PAT_URL}" 2>/dev/null | grep -q "7.2.2"; then if echo "${PAT_URL}" 2>/dev/null | grep -q "7.2.2"; then
@ -375,7 +375,7 @@ function arcVersion() {
fi fi
done < <(readConfigMap "addons" "${USER_CONFIG_FILE}") done < <(readConfigMap "addons" "${USER_CONFIG_FILE}")
KVER="$(readConfigKey "platforms.${PLATFORM}.productvers.\"${PRODUCTVER}\".kver" "${P_FILE}")" KVER="$(readConfigKey "platforms.${PLATFORM}.productvers.\"${PRODUCTVER}\".kver" "${P_FILE}")"
[ "${PLATFORM}" == "epyc7002" ] && KVERP="${PRODUCTVER}-${KVER}" || KVERP="${KVER}" [ "${PLATFORM}" = "epyc7002" ] && KVERP="${PRODUCTVER}-${KVER}" || KVERP="${KVER}"
if [ -n "${PLATFORM}" ] && [ -n "${KVERP}" ]; then if [ -n "${PLATFORM}" ] && [ -n "${KVERP}" ]; then
writeConfigKey "modules" "{}" "${USER_CONFIG_FILE}" writeConfigKey "modules" "{}" "${USER_CONFIG_FILE}"
while read -r ID DESC; do while read -r ID DESC; do
@ -383,7 +383,7 @@ function arcVersion() {
done < <(getAllModules "${PLATFORM}" "${KVERP}") done < <(getAllModules "${PLATFORM}" "${KVERP}")
fi fi
# Check for Only Version # Check for Only Version
if [ "${ONLYVERSION}" == "true" ]; then if [ "${ONLYVERSION}" = "true" ]; then
writeConfigKey "arc.builddone" "false" "${USER_CONFIG_FILE}" writeConfigKey "arc.builddone" "false" "${USER_CONFIG_FILE}"
BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")" BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")"
ONLYVERSION="false" ONLYVERSION="false"
@ -410,11 +410,11 @@ function arcPatch() {
MODEL="$(readConfigKey "model" "${USER_CONFIG_FILE}")" MODEL="$(readConfigKey "model" "${USER_CONFIG_FILE}")"
ARCCONF="$(readConfigKey "${MODEL}.serial" "${S_FILE}")" ARCCONF="$(readConfigKey "${MODEL}.serial" "${S_FILE}")"
# Check for Custom Build # Check for Custom Build
if [ "${ARCMODE}" == "automated" ]; then if [ "${ARCMODE}" = "automated" ]; then
ARCCONF="$(readConfigKey "${MODEL}.serial" "${S_FILE}")" ARCCONF="$(readConfigKey "${MODEL}.serial" "${S_FILE}")"
[ -n "${ARCCONF}" ] && SN="$(generateSerial "${MODEL}" "true")" || SN="$(generateSerial "${MODEL}" "false")" [ -n "${ARCCONF}" ] && SN="$(generateSerial "${MODEL}" "true")" || SN="$(generateSerial "${MODEL}" "false")"
[ -n "${ARCCONF}" ] && writeConfigKey "arc.patch" "true" "${USER_CONFIG_FILE}" || writeConfigKey "arc.patch" "false" "${USER_CONFIG_FILE}" [ -n "${ARCCONF}" ] && writeConfigKey "arc.patch" "true" "${USER_CONFIG_FILE}" || writeConfigKey "arc.patch" "false" "${USER_CONFIG_FILE}"
elif [ "${ARCMODE}" == "config" ]; then elif [ "${ARCMODE}" = "config" ]; then
dialog --clear --backtitle "$(backtitlep)" \ dialog --clear --backtitle "$(backtitlep)" \
--nocancel --title "SN/Mac Options"\ --nocancel --title "SN/Mac Options"\
--menu "Choose an Option." 7 60 0 \ --menu "Choose an Option." 7 60 0 \
@ -470,14 +470,14 @@ function arcSettings() {
sleep 2 sleep 2
getnet getnet
[ $? -ne 0 ] && return 1 [ $? -ne 0 ] && return 1
if [ "${ONLYPATCH}" == "true" ]; then if [ "${ONLYPATCH}" = "true" ]; then
writeConfigKey "arc.builddone" "false" "${USER_CONFIG_FILE}" writeConfigKey "arc.builddone" "false" "${USER_CONFIG_FILE}"
BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")" BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")"
ONLYPATCH="false" ONLYPATCH="false"
return 0 return 0
fi fi
# Select Portmap for Loader # Select Portmap for Loader
if [ "${DT}" == "false" ] && [ $(lspci -d ::106 | wc -l) -gt 0 ]; then if [ "${DT}" = "false" ] && [ $(lspci -d ::106 | wc -l) -gt 0 ]; then
STEP="storagemap" STEP="storagemap"
dialog --backtitle "$(backtitlep)" --colors --title "Storage Map" \ dialog --backtitle "$(backtitlep)" --colors --title "Storage Map" \
--infobox "Generating Storage Map..." 3 40 --infobox "Generating Storage Map..." 3 40
@ -486,7 +486,7 @@ function arcSettings() {
[ $? -ne 0 ] && return 1 [ $? -ne 0 ] && return 1
fi fi
# Check for Custom Build # Check for Custom Build
if [ "${ARCMODE}" == "config" ]; then if [ "${ARCMODE}" = "config" ]; then
# Select Addons # Select Addons
STEP="addons" STEP="addons"
dialog --backtitle "$(backtitlep)" --colors --title "Addons" \ dialog --backtitle "$(backtitlep)" --colors --title "Addons" \
@ -495,17 +495,17 @@ function arcSettings() {
[ $? -ne 0 ] && return 1 [ $? -ne 0 ] && return 1
fi fi
# Check for CPU Frequency Scaling & Governor # Check for CPU Frequency Scaling & Governor
if [ "${ARCMODE}" == "config" ] && [ "${MACHINE}" == "Native" ] && readConfigMap "addons" "${USER_CONFIG_FILE}" | grep -q "cpufreqscaling"; then if [ "${ARCMODE}" = "config" ] && [ "${MACHINE}" = "Native" ] && readConfigMap "addons" "${USER_CONFIG_FILE}" | grep -q "cpufreqscaling"; then
dialog --backtitle "$(backtitlep)" --colors --title "CPU Frequency Scaling" \ dialog --backtitle "$(backtitlep)" --colors --title "CPU Frequency Scaling" \
--infobox "Generating Governor Table..." 3 40 --infobox "Generating Governor Table..." 3 40
governorSelection governorSelection
[ $? -ne 0 ] && return 1 [ $? -ne 0 ] && return 1
elif [ "${ARCMODE}" == "automated" ] && [ "${MACHINE}" == "Native" ] && readConfigMap "addons" "${USER_CONFIG_FILE}" | grep -q "cpufreqscaling"; then elif [ "${ARCMODE}" = "automated" ] && [ "${MACHINE}" = "Native" ] && readConfigMap "addons" "${USER_CONFIG_FILE}" | grep -q "cpufreqscaling"; then
[ "${PLATFORM}" == "epyc7002" ] && writeConfigKey "addons.cpufreqscaling" "schedutil" "${USER_CONFIG_FILE}" || writeConfigKey "addons.cpufreqscaling" "conservative" "${USER_CONFIG_FILE}" [ "${PLATFORM}" = "epyc7002" ] && writeConfigKey "addons.cpufreqscaling" "schedutil" "${USER_CONFIG_FILE}" || writeConfigKey "addons.cpufreqscaling" "conservative" "${USER_CONFIG_FILE}"
fi fi
if [ "${ARCMODE}" == "config" ]; then if [ "${ARCMODE}" = "config" ]; then
# Check for DT and HBA/Raid Controller # Check for DT and HBA/Raid Controller
if [ "${DT}" == "true" ] && [ "${EXTERNALCONTROLLER}" == "true" ]; then if [ "${DT}" = "true" ] && [ "${EXTERNALCONTROLLER}" = "true" ]; then
dialog --backtitle "$(backtitlep)" --title "Arc Warning" \ dialog --backtitle "$(backtitlep)" --title "Arc Warning" \
--msgbox "WARN: You use a HBA/Raid Controller and selected a DT Model.\nThis is still an experimental." 6 70 --msgbox "WARN: You use a HBA/Raid Controller and selected a DT Model.\nThis is still an experimental." 6 70
fi fi
@ -516,24 +516,24 @@ function arcSettings() {
dialog --backtitle "$(backtitlep)" --title "Arc Warning" \ dialog --backtitle "$(backtitlep)" --title "Arc Warning" \
--msgbox "WARN: You have more NIC (${DEVICENIC}) then 8 NIC.\nOnly 8 supported by DSM." 6 60 --msgbox "WARN: You have more NIC (${DEVICENIC}) then 8 NIC.\nOnly 8 supported by DSM." 6 60
fi fi
if [ ${DEVICENIC} -gt ${MODELNIC} ] && [ "${ARCPATCH}" == "true" ]; then if [ ${DEVICENIC} -gt ${MODELNIC} ] && [ "${ARCPATCH}" = "true" ]; then
dialog --backtitle "$(backtitlep)" --title "Arc Warning" \ dialog --backtitle "$(backtitlep)" --title "Arc Warning" \
--msgbox "WARN: You have more NIC (${DEVICENIC}) than supported by Model (${MODELNIC}).\nOnly ${MODELNIC} are used by Arc Patch." 6 80 --msgbox "WARN: You have more NIC (${DEVICENIC}) than supported by Model (${MODELNIC}).\nOnly ${MODELNIC} are used by Arc Patch." 6 80
fi fi
# Check for AES # Check for AES
if [ "${AESSYS}" == "false" ]; then if [ "${AESSYS}" = "false" ]; then
dialog --backtitle "$(backtitlep)" --title "Arc Warning" \ dialog --backtitle "$(backtitlep)" --title "Arc Warning" \
--msgbox "WARN: Your System doesn't support Hardwareencryption in DSM. (AES)" 5 70 --msgbox "WARN: Your System doesn't support Hardwareencryption in DSM. (AES)" 5 70
fi fi
# Check for CPUFREQ # Check for CPUFREQ
if [[ "${CPUFREQ}" == "false" || "${ACPISYS}" == "false" ]] && readConfigMap "addons" "${USER_CONFIG_FILE}" | grep -q "cpufreqscaling"; then if [[ "${CPUFREQ}" = "false" || "${ACPISYS}" = "false" ]] && readConfigMap "addons" "${USER_CONFIG_FILE}" | grep -q "cpufreqscaling"; then
dialog --backtitle "$(backtitlep)" --title "Arc Warning" \ dialog --backtitle "$(backtitlep)" --title "Arc Warning" \
--msgbox "WARN: It is possible that CPU Frequency Scaling is not working properly with your System." 6 80 --msgbox "WARN: It is possible that CPU Frequency Scaling is not working properly with your System." 6 80
fi fi
fi fi
EMMCBOOT="$(readConfigKey "emmcboot" "${USER_CONFIG_FILE}")" EMMCBOOT="$(readConfigKey "emmcboot" "${USER_CONFIG_FILE}")"
# eMMC Boot Support # eMMC Boot Support
if [ "${EMMCBOOT}" == "true" ]; then if [ "${EMMCBOOT}" = "true" ]; then
writeConfigKey "modules.mmc_block" "" "${USER_CONFIG_FILE}" writeConfigKey "modules.mmc_block" "" "${USER_CONFIG_FILE}"
writeConfigKey "modules.mmc_core" "" "${USER_CONFIG_FILE}" writeConfigKey "modules.mmc_core" "" "${USER_CONFIG_FILE}"
else else
@ -545,7 +545,7 @@ function arcSettings() {
writeConfigKey "arc.confdone" "true" "${USER_CONFIG_FILE}" writeConfigKey "arc.confdone" "true" "${USER_CONFIG_FILE}"
CONFDONE="$(readConfigKey "arc.confdone" "${USER_CONFIG_FILE}")" CONFDONE="$(readConfigKey "arc.confdone" "${USER_CONFIG_FILE}")"
# Check for Custom Build # Check for Custom Build
if [ "${ARCMODE}" == "config" ]; then if [ "${ARCMODE}" = "config" ]; then
# Ask for Build # Ask for Build
dialog --clear --backtitle "$(backtitlep)" --title "Config done" \ dialog --clear --backtitle "$(backtitlep)" --title "Config done" \
--no-cancel --menu "Build now?" 7 40 0 \ --no-cancel --menu "Build now?" 7 40 0 \
@ -585,12 +585,12 @@ function arcSummary() {
ARCPATCH="$(readConfigKey "arc.patch" "${USER_CONFIG_FILE}")" ARCPATCH="$(readConfigKey "arc.patch" "${USER_CONFIG_FILE}")"
ADDONSINFO="$(readConfigEntriesArray "addons" "${USER_CONFIG_FILE}")" ADDONSINFO="$(readConfigEntriesArray "addons" "${USER_CONFIG_FILE}")"
REMAP="$(readConfigKey "arc.remap" "${USER_CONFIG_FILE}")" REMAP="$(readConfigKey "arc.remap" "${USER_CONFIG_FILE}")"
if [ "${REMAP}" == "acports" ] || [ "${REMAP}" == "maxports" ]; then if [ "${REMAP}" = "acports" ] || [ "${REMAP}" = "maxports" ]; then
PORTMAP="$(readConfigKey "cmdline.SataPortMap" "${USER_CONFIG_FILE}")" PORTMAP="$(readConfigKey "cmdline.SataPortMap" "${USER_CONFIG_FILE}")"
DISKMAP="$(readConfigKey "cmdline.DiskIdxMap" "${USER_CONFIG_FILE}")" DISKMAP="$(readConfigKey "cmdline.DiskIdxMap" "${USER_CONFIG_FILE}")"
elif [ "${REMAP}" == "remap" ]; then elif [ "${REMAP}" = "remap" ]; then
PORTREMAP="$(readConfigKey "cmdline.sata_remap" "${USER_CONFIG_FILE}")" PORTREMAP="$(readConfigKey "cmdline.sata_remap" "${USER_CONFIG_FILE}")"
elif [ "${REMAP}" == "ahci" ]; then elif [ "${REMAP}" = "ahci" ]; then
AHCIPORTREMAP="$(readConfigKey "cmdline.ahci_remap" "${USER_CONFIG_FILE}")" AHCIPORTREMAP="$(readConfigKey "cmdline.ahci_remap" "${USER_CONFIG_FILE}")"
else else
PORTMAP="$(readConfigKey "cmdline.SataPortMap" "${USER_CONFIG_FILE}")" PORTMAP="$(readConfigKey "cmdline.SataPortMap" "${USER_CONFIG_FILE}")"
@ -607,7 +607,7 @@ function arcSummary() {
DRIVES="$(readConfigKey "device.drives" "${USER_CONFIG_FILE}")" DRIVES="$(readConfigKey "device.drives" "${USER_CONFIG_FILE}")"
EMMCBOOT="$(readConfigKey "emmcboot" "${USER_CONFIG_FILE}")" EMMCBOOT="$(readConfigKey "emmcboot" "${USER_CONFIG_FILE}")"
KERNEL="$(readConfigKey "kernel" "${USER_CONFIG_FILE}")" KERNEL="$(readConfigKey "kernel" "${USER_CONFIG_FILE}")"
if [ "${DT}" == "false" ] && [ "${REMAP}" == "user" ]; then if [ "${DT}" = "false" ] && [ "${REMAP}" = "user" ]; then
if [ -z "${PORTMAP}" ] && [ -z "${DISKMAP}"] && [ -z "${PORTREMAP}" ] && [ -z "${AHCIPORTREMAP}" ]; then if [ -z "${PORTMAP}" ] && [ -z "${DISKMAP}"] && [ -z "${PORTREMAP}" ] && [ -z "${AHCIPORTREMAP}" ]; then
dialog --backtitle "$(backtitle)" --title "Arc Error" \ dialog --backtitle "$(backtitle)" --title "Arc Error" \
--msgbox "ERROR: You selected Portmap: User and not set any values. -> Can't build Loader!\nGo need to go Cmdline Options and add your Values." 6 80 --msgbox "ERROR: You selected Portmap: User and not set any values. -> Can't build Loader!\nGo need to go Cmdline Options and add your Values." 6 80
@ -622,7 +622,7 @@ function arcSummary() {
SUMMARY+="\n>> DT: \Zb${DT}\Zn" SUMMARY+="\n>> DT: \Zb${DT}\Zn"
SUMMARY+="\n>> PAT URL: \Zb${PAT_URL}\Zn" SUMMARY+="\n>> PAT URL: \Zb${PAT_URL}\Zn"
SUMMARY+="\n>> PAT Hash: \Zb${PAT_HASH}\Zn" SUMMARY+="\n>> PAT Hash: \Zb${PAT_HASH}\Zn"
[ "${MODEL}" == "SA6400" ] && SUMMARY+="\n>> Kernel: \Zb${KERNEL}\Zn" [ "${MODEL}" = "SA6400" ] && SUMMARY+="\n>> Kernel: \Zb${KERNEL}\Zn"
SUMMARY+="\n>> Kernel Version: \Zb${KVER}\Zn" SUMMARY+="\n>> Kernel Version: \Zb${KVER}\Zn"
SUMMARY+="\n" SUMMARY+="\n"
SUMMARY+="\n\Z4> Arc Information\Zn" SUMMARY+="\n\Z4> Arc Information\Zn"
@ -631,7 +631,7 @@ function arcSummary() {
[ -n "${DISKMAP}" ] && SUMMARY+="\n>> DiskIdxMap: \Zb${DISKMAP}\Zn" [ -n "${DISKMAP}" ] && SUMMARY+="\n>> DiskIdxMap: \Zb${DISKMAP}\Zn"
[ -n "${PORTREMAP}" ] && SUMMARY+="\n>> SataRemap: \Zb${PORTREMAP}\Zn" [ -n "${PORTREMAP}" ] && SUMMARY+="\n>> SataRemap: \Zb${PORTREMAP}\Zn"
[ -n "${AHCIPORTREMAP}" ] && SUMMARY+="\n>> AhciRemap: \Zb${AHCIPORTREMAP}\Zn" [ -n "${AHCIPORTREMAP}" ] && SUMMARY+="\n>> AhciRemap: \Zb${AHCIPORTREMAP}\Zn"
[ "${DT}" == "true" ] && SUMMARY+="\n>> Sort Drives: \Zb${HDDSORT}\Zn" [ "${DT}" = "true" ] && SUMMARY+="\n>> Sort Drives: \Zb${HDDSORT}\Zn"
SUMMARY+="\n>> Directboot: \Zb${DIRECTBOOT}\Zn" SUMMARY+="\n>> Directboot: \Zb${DIRECTBOOT}\Zn"
SUMMARY+="\n>> eMMC Boot: \Zb${EMMCBOOT}\Zn" SUMMARY+="\n>> eMMC Boot: \Zb${EMMCBOOT}\Zn"
SUMMARY+="\n>> Kernelload: \Zb${KERNELLOAD}\Zn" SUMMARY+="\n>> Kernelload: \Zb${KERNELLOAD}\Zn"
@ -676,7 +676,7 @@ function make() {
# Check for Arc Patch # Check for Arc Patch
ARCCONF="$(readConfigKey "${MODEL}.serial" "${S_FILE}")" ARCCONF="$(readConfigKey "${MODEL}.serial" "${S_FILE}")"
ARCPATCH="$(readConfigKey "arc.patch" "${USER_CONFIG_FILE}")" ARCPATCH="$(readConfigKey "arc.patch" "${USER_CONFIG_FILE}")"
if [ -z "${ARCCONF}" ] || [ "${ARCPATCH}" == "false" ]; then if [ -z "${ARCCONF}" ] || [ "${ARCPATCH}" = "false" ]; then
deleteConfigKey "addons.amepatch" "${USER_CONFIG_FILE}" deleteConfigKey "addons.amepatch" "${USER_CONFIG_FILE}"
deleteConfigKey "addons.arcdns" "${USER_CONFIG_FILE}" deleteConfigKey "addons.arcdns" "${USER_CONFIG_FILE}"
fi fi
@ -694,7 +694,7 @@ function make() {
sleep 2 sleep 2
return 1 return 1
fi fi
if [ -f "${ORI_ZIMAGE_FILE}" ] && [ -f "${ORI_RDGZ_FILE}" ] && [ "${CONFDONE}" == "true" ] && [ -n "${PAT_URL}" ] && [ -n "${PAT_HASH}" ]; then if [ -f "${ORI_ZIMAGE_FILE}" ] && [ -f "${ORI_RDGZ_FILE}" ] && [ "${CONFDONE}" = "true" ] && [ -n "${PAT_URL}" ] && [ -n "${PAT_HASH}" ]; then
( (
livepatch livepatch
sleep 3 sleep 3
@ -734,7 +734,7 @@ function arcFinish() {
if [ -n "${MODELID}" ]; then if [ -n "${MODELID}" ]; then
writeConfigKey "arc.builddone" "true" "${USER_CONFIG_FILE}" writeConfigKey "arc.builddone" "true" "${USER_CONFIG_FILE}"
BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")" BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")"
if [ "${ARCMODE}" == "automated" ] || [ "${UPDATEMODE}" == "true" ]; then if [ "${ARCMODE}" = "automated" ] || [ "${UPDATEMODE}" = "true" ]; then
boot boot
else else
# Ask for Boot # Ask for Boot
@ -760,7 +760,7 @@ function juniorboot() {
BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")" BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")"
MODEL="$(readConfigKey "model" "${USER_CONFIG_FILE}")" MODEL="$(readConfigKey "model" "${USER_CONFIG_FILE}")"
MODELID="$(readConfigKey "modelid" "${USER_CONFIG_FILE}")" MODELID="$(readConfigKey "modelid" "${USER_CONFIG_FILE}")"
if [[ "${BUILDDONE}" == "false" && "${ARCMODE}" != "automated" ]] || [ "${MODEL}" != "${MODELID}" ]; then if [[ "${BUILDDONE}" = "false" && "${ARCMODE}" != "automated" ]] || [ "${MODEL}" != "${MODELID}" ]; then
dialog --backtitle "$(backtitle)" --title "Alert" \ dialog --backtitle "$(backtitle)" --title "Alert" \
--yesno "Config changed, you need to rebuild the Loader?" 0 0 --yesno "Config changed, you need to rebuild the Loader?" 0 0
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
@ -780,7 +780,7 @@ function boot() {
BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")" BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")"
MODEL="$(readConfigKey "model" "${USER_CONFIG_FILE}")" MODEL="$(readConfigKey "model" "${USER_CONFIG_FILE}")"
MODELID="$(readConfigKey "modelid" "${USER_CONFIG_FILE}")" MODELID="$(readConfigKey "modelid" "${USER_CONFIG_FILE}")"
if [[ "${BUILDDONE}" == "false" && "${ARCMODE}" != "automated" ]] || [ "${MODEL}" != "${MODELID}" ]; then if [[ "${BUILDDONE}" = "false" && "${ARCMODE}" != "automated" ]] || [ "${MODEL}" != "${MODELID}" ]; then
dialog --backtitle "$(backtitle)" --title "Alert" \ dialog --backtitle "$(backtitle)" --title "Alert" \
--yesno "Config changed, you need to rebuild the Loader?" 0 0 --yesno "Config changed, you need to rebuild the Loader?" 0 0
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
@ -799,7 +799,7 @@ function boot() {
############################################################################### ###############################################################################
# Main loop # Main loop
# Check for Arc Mode # Check for Arc Mode
if [ "${ARCMODE}" == "update" ]; then if [ "${ARCMODE}" = "update" ]; then
if [ "${ARCOFFLINE}" != "true" ]; then if [ "${ARCOFFLINE}" != "true" ]; then
updateLoader updateLoader
else else
@ -808,48 +808,48 @@ if [ "${ARCMODE}" == "update" ]; then
sleep 3 sleep 3
reboot reboot
fi fi
elif [ "${ARCMODE}" == "automated" ]; then elif [ "${ARCMODE}" = "automated" ]; then
# Check for Custom Build # Check for Custom Build
if [ "${BUILDDONE}" == "false" ] || [ "${MODEL}" != "${MODELID}" ]; then if [ "${BUILDDONE}" = "false" ] || [ "${MODEL}" != "${MODELID}" ]; then
arcModel arcModel
else else
make make
fi fi
else else
[ "${CONFDONE}" == "true" ] && NEXT="2" || NEXT="1" [ "${CONFDONE}" = "true" ] && NEXT="2" || NEXT="1"
[ "${BUILDDONE}" == "true" ] && NEXT="3" || NEXT="1" [ "${BUILDDONE}" = "true" ] && NEXT="3" || NEXT="1"
while true; do while true; do
echo "= \"\Z4========== Main ==========\Zn \" " >"${TMP_PATH}/menu" echo "= \"\Z4===== Main =====\Zn \" " >"${TMP_PATH}/menu"
if [ -z "${USERID}" ] && [ "${ARCOFFLINE}" != "true" ]; then if [ -z "${USERID}" ] && [ "${ARCOFFLINE}" != "true" ]; then
echo "0 \"HardwareID for Arc Patch\" " >>"${TMP_PATH}/menu" echo "0 \"HardwareID for Arc Patch\" " >>"${TMP_PATH}/menu"
fi fi
echo "1 \"Choose Model \" " >>"${TMP_PATH}/menu" echo "1 \"Choose Model \" " >>"${TMP_PATH}/menu"
if [ "${CONFDONE}" == "true" ] && [ -n "${IPCON}" ]; then if [ "${CONFDONE}" = "true" ] && [ -n "${IPCON}" ]; then
echo "2 \"Build Loader \" " >>"${TMP_PATH}/menu" echo "2 \"Build Loader \" " >>"${TMP_PATH}/menu"
fi fi
if [ "${BUILDDONE}" == "true" ]; then if [ "${BUILDDONE}" = "true" ]; then
echo "3 \"Boot Loader \" " >>"${TMP_PATH}/menu" echo "3 \"Boot Loader \" " >>"${TMP_PATH}/menu"
fi fi
echo "= \"\Z4========== Info ==========\Zn \" " >>"${TMP_PATH}/menu" echo "= \"\Z4===== Info =====\Zn \" " >>"${TMP_PATH}/menu"
echo "a \"Sysinfo \" " >>"${TMP_PATH}/menu" echo "a \"Sysinfo \" " >>"${TMP_PATH}/menu"
echo "A \"Networkdiag \" " >>"${TMP_PATH}/menu" echo "A \"Networkdiag \" " >>"${TMP_PATH}/menu"
echo "= \"\Z4========== System ========\Zn \" " >>"${TMP_PATH}/menu" echo "= \"\Z4===== System ====\Zn \" " >>"${TMP_PATH}/menu"
if [ "${CONFDONE}" == "true" ]; then if [ "${CONFDONE}" = "true" ]; then
if [ "${ARCOPTS}" == "true" ]; then if [ "${ARCOPTS}" = "true" ]; then
echo "4 \"\Z1Hide Arc DSM Options\Zn \" " >>"${TMP_PATH}/menu" echo "4 \"\Z1Hide Arc DSM Options\Zn \" " >>"${TMP_PATH}/menu"
else else
echo "4 \"\Z1Show Arc DSM Options\Zn \" " >>"${TMP_PATH}/menu" echo "4 \"\Z1Show Arc DSM Options\Zn \" " >>"${TMP_PATH}/menu"
fi fi
if [ "${ARCOPTS}" == "true" ]; then if [ "${ARCOPTS}" = "true" ]; then
echo "= \"\Z4======== Arc DSM ========\Zn \" " >>"${TMP_PATH}/menu" echo "= \"\Z4==== Arc DSM ====\Zn \" " >>"${TMP_PATH}/menu"
echo "b \"Addons \" " >>"${TMP_PATH}/menu" echo "b \"Addons \" " >>"${TMP_PATH}/menu"
echo "d \"Modules \" " >>"${TMP_PATH}/menu" echo "d \"Modules \" " >>"${TMP_PATH}/menu"
echo "e \"Version \" " >>"${TMP_PATH}/menu" echo "e \"Version \" " >>"${TMP_PATH}/menu"
echo "p \"SN/Mac Options \" " >>"${TMP_PATH}/menu" echo "p \"SN/Mac Options \" " >>"${TMP_PATH}/menu"
if [ "${DT}" == "false" ] && [ ${SATACONTROLLER} -gt 0 ]; then if [ "${DT}" = "false" ] && [ ${SATACONTROLLER} -gt 0 ]; then
echo "S \"Sata PortMap \" " >>"${TMP_PATH}/menu" echo "S \"Sata PortMap \" " >>"${TMP_PATH}/menu"
fi fi
if [ "${DT}" == "true" ]; then if [ "${DT}" = "true" ]; then
echo "o \"DTS Map Options \" " >>"${TMP_PATH}/menu" echo "o \"DTS Map Options \" " >>"${TMP_PATH}/menu"
fi fi
if readConfigMap "addons" "${USER_CONFIG_FILE}" | grep -q "cpufreqscaling"; then if readConfigMap "addons" "${USER_CONFIG_FILE}" | grep -q "cpufreqscaling"; then
@ -862,27 +862,27 @@ else
echo "Q \"SequentialIO Options \" " >>"${TMP_PATH}/menu" echo "Q \"SequentialIO Options \" " >>"${TMP_PATH}/menu"
fi fi
fi fi
if [ "${BOOTOPTS}" == "true" ]; then if [ "${BOOTOPTS}" = "true" ]; then
echo "6 \"\Z1Hide Boot Options\Zn \" " >>"${TMP_PATH}/menu" echo "6 \"\Z1Hide Boot Options\Zn \" " >>"${TMP_PATH}/menu"
else else
echo "6 \"\Z1Show Boot Options\Zn \" " >>"${TMP_PATH}/menu" echo "6 \"\Z1Show Boot Options\Zn \" " >>"${TMP_PATH}/menu"
fi fi
if [ "${BOOTOPTS}" == "true" ]; then if [ "${BOOTOPTS}" = "true" ]; then
echo "= \"\Z4========== Boot =========\Zn \" " >>"${TMP_PATH}/menu" echo "= \"\Z4===== Boot =====\Zn \" " >>"${TMP_PATH}/menu"
echo "m \"Boot Kernelload: \Z4${KERNELLOAD}\Zn \" " >>"${TMP_PATH}/menu" echo "m \"Boot Kernelload: \Z4${KERNELLOAD}\Zn \" " >>"${TMP_PATH}/menu"
echo "E \"eMMC Boot Support: \Z4${EMMCBOOT}\Zn \" " >>"${TMP_PATH}/menu" echo "E \"eMMC Boot Support: \Z4${EMMCBOOT}\Zn \" " >>"${TMP_PATH}/menu"
if [ "${DIRECTBOOT}" == "false" ]; then if [ "${DIRECTBOOT}" = "false" ]; then
echo "i \"Boot IP Waittime: \Z4${BOOTIPWAIT}\Zn \" " >>"${TMP_PATH}/menu" echo "i \"Boot IP Waittime: \Z4${BOOTIPWAIT}\Zn \" " >>"${TMP_PATH}/menu"
fi fi
echo "q \"Directboot: \Z4${DIRECTBOOT}\Zn \" " >>"${TMP_PATH}/menu" echo "q \"Directboot: \Z4${DIRECTBOOT}\Zn \" " >>"${TMP_PATH}/menu"
fi fi
if [ "${DSMOPTS}" == "true" ]; then if [ "${DSMOPTS}" = "true" ]; then
echo "7 \"\Z1Hide DSM Options\Zn \" " >>"${TMP_PATH}/menu" echo "7 \"\Z1Hide DSM Options\Zn \" " >>"${TMP_PATH}/menu"
else else
echo "7 \"\Z1Show DSM Options\Zn \" " >>"${TMP_PATH}/menu" echo "7 \"\Z1Show DSM Options\Zn \" " >>"${TMP_PATH}/menu"
fi fi
if [ "${DSMOPTS}" == "true" ]; then if [ "${DSMOPTS}" = "true" ]; then
echo "= \"\Z4========== DSM ==========\Zn \" " >>"${TMP_PATH}/menu" echo "= \"\Z4===== DSM =====\Zn \" " >>"${TMP_PATH}/menu"
echo "j \"Cmdline \" " >>"${TMP_PATH}/menu" echo "j \"Cmdline \" " >>"${TMP_PATH}/menu"
echo "k \"Synoinfo \" " >>"${TMP_PATH}/menu" echo "k \"Synoinfo \" " >>"${TMP_PATH}/menu"
echo "l \"Edit User Config \" " >>"${TMP_PATH}/menu" echo "l \"Edit User Config \" " >>"${TMP_PATH}/menu"
@ -892,10 +892,10 @@ else
echo "J \"Reset Network Config \" " >>"${TMP_PATH}/menu" echo "J \"Reset Network Config \" " >>"${TMP_PATH}/menu"
echo "M \"Mount DSM Storage Pool (not SHR) \" " >>"${TMP_PATH}/menu" echo "M \"Mount DSM Storage Pool (not SHR) \" " >>"${TMP_PATH}/menu"
echo "T \"Disable all scheduled Tasks \" " >>"${TMP_PATH}/menu" echo "T \"Disable all scheduled Tasks \" " >>"${TMP_PATH}/menu"
if [ "${PLATFORM}" == "epyc7002" ]; then if [ "${PLATFORM}" = "epyc7002" ]; then
echo "K \"Kernel: \Z4${KERNEL}\Zn \" " >>"${TMP_PATH}/menu" echo "K \"Kernel: \Z4${KERNEL}\Zn \" " >>"${TMP_PATH}/menu"
fi fi
if [ "${DT}" == "true" ]; then if [ "${DT}" = "true" ]; then
echo "H \"Hotplug/SortDrives: \Z4${HDDSORT}\Zn \" " >>"${TMP_PATH}/menu" echo "H \"Hotplug/SortDrives: \Z4${HDDSORT}\Zn \" " >>"${TMP_PATH}/menu"
else else
echo "h \"USB Mount: \Z4${USBMOUNT}\Zn \" " >>"${TMP_PATH}/menu" echo "h \"USB Mount: \Z4${USBMOUNT}\Zn \" " >>"${TMP_PATH}/menu"
@ -904,14 +904,14 @@ else
echo "B \"Grep DSM Config from Backup \" " >>"${TMP_PATH}/menu" echo "B \"Grep DSM Config from Backup \" " >>"${TMP_PATH}/menu"
fi fi
fi fi
if [ "${LOADEROPTS}" == "true" ]; then if [ "${LOADEROPTS}" = "true" ]; then
echo "8 \"\Z1Hide Loader Options\Zn \" " >>"${TMP_PATH}/menu" echo "8 \"\Z1Hide Loader Options\Zn \" " >>"${TMP_PATH}/menu"
else else
echo "8 \"\Z1Show Loader Options\Zn \" " >>"${TMP_PATH}/menu" echo "8 \"\Z1Show Loader Options\Zn \" " >>"${TMP_PATH}/menu"
fi fi
if [ "${LOADEROPTS}" == "true" ]; then if [ "${LOADEROPTS}" = "true" ]; then
echo "= \"\Z4========= Loader =========\Zn \" " >>"${TMP_PATH}/menu" echo "= \"\Z4===== Loader =====\Zn \" " >>"${TMP_PATH}/menu"
echo "= \"\Z1=== Edit with caution! ===\Zn \" " >>"${TMP_PATH}/menu" echo "= \"\Z1== Edit with caution! ==\Zn \" " >>"${TMP_PATH}/menu"
echo "D \"StaticIP for Loader/DSM \" " >>"${TMP_PATH}/menu" echo "D \"StaticIP for Loader/DSM \" " >>"${TMP_PATH}/menu"
echo "c \"Offline Mode: \Z4${ARCOFFLINE}\Zn \" " >>"${TMP_PATH}/menu" echo "c \"Offline Mode: \Z4${ARCOFFLINE}\Zn \" " >>"${TMP_PATH}/menu"
echo "f \"Bootscreen Options \" " >>"${TMP_PATH}/menu" echo "f \"Bootscreen Options \" " >>"${TMP_PATH}/menu"
@ -927,7 +927,7 @@ else
echo "y \"Choose a Keymap for Loader \" " >>"${TMP_PATH}/menu" echo "y \"Choose a Keymap for Loader \" " >>"${TMP_PATH}/menu"
echo "F \"\Z1Formate Disks \Zn \" " >>"${TMP_PATH}/menu" echo "F \"\Z1Formate Disks \Zn \" " >>"${TMP_PATH}/menu"
fi fi
echo "= \"\Z4========== Misc ==========\Zn \" " >>"${TMP_PATH}/menu" echo "= \"\Z4===== Misc =====\Zn \" " >>"${TMP_PATH}/menu"
echo "x \"Backup/Restore/Recovery \" " >>"${TMP_PATH}/menu" echo "x \"Backup/Restore/Recovery \" " >>"${TMP_PATH}/menu"
[ "${ARCOFFLINE}" != "true" ] && echo "z \"Update Menu \" " >>"${TMP_PATH}/menu" [ "${ARCOFFLINE}" != "true" ] && echo "z \"Update Menu \" " >>"${TMP_PATH}/menu"
echo "I \"Power/Service Menu \" " >>"${TMP_PATH}/menu" echo "I \"Power/Service Menu \" " >>"${TMP_PATH}/menu"
@ -948,7 +948,7 @@ else
A) networkdiag; NEXT="A" ;; A) networkdiag; NEXT="A" ;;
# System Section # System Section
# Arc Section # Arc Section
4) [ "${ARCOPTS}" == "true" ] && ARCOPTS='false' || ARCOPTS='true' 4) [ "${ARCOPTS}" = "true" ] && ARCOPTS='false' || ARCOPTS='true'
ARCOPTS="${ARCOPTS}" ARCOPTS="${ARCOPTS}"
NEXT="4" NEXT="4"
;; ;;
@ -962,22 +962,22 @@ else
P) storagepanelMenu; NEXT="P" ;; P) storagepanelMenu; NEXT="P" ;;
Q) sequentialIOMenu; NEXT="Q" ;; Q) sequentialIOMenu; NEXT="Q" ;;
# Boot Section # Boot Section
6) [ "${BOOTOPTS}" == "true" ] && BOOTOPTS='false' || BOOTOPTS='true' 6) [ "${BOOTOPTS}" = "true" ] && BOOTOPTS='false' || BOOTOPTS='true'
BOOTOPTS="${BOOTOPTS}" BOOTOPTS="${BOOTOPTS}"
NEXT="6" NEXT="6"
;; ;;
m) [ "${KERNELLOAD}" == "kexec" ] && KERNELLOAD='power' || KERNELLOAD='kexec' m) [ "${KERNELLOAD}" = "kexec" ] && KERNELLOAD='power' || KERNELLOAD='kexec'
writeConfigKey "kernelload" "${KERNELLOAD}" "${USER_CONFIG_FILE}" writeConfigKey "kernelload" "${KERNELLOAD}" "${USER_CONFIG_FILE}"
NEXT="m" NEXT="m"
;; ;;
E) [ "${EMMCBOOT}" == "true" ] && EMMCBOOT='false' || EMMCBOOT='true' E) [ "${EMMCBOOT}" = "true" ] && EMMCBOOT='false' || EMMCBOOT='true'
if [ "${EMMCBOOT}" == "false" ]; then if [ "${EMMCBOOT}" = "false" ]; then
writeConfigKey "emmcboot" "false" "${USER_CONFIG_FILE}" writeConfigKey "emmcboot" "false" "${USER_CONFIG_FILE}"
deleteConfigKey "synoinfo.disk_swap" "${USER_CONFIG_FILE}" deleteConfigKey "synoinfo.disk_swap" "${USER_CONFIG_FILE}"
deleteConfigKey "synoinfo.supportraid" "${USER_CONFIG_FILE}" deleteConfigKey "synoinfo.supportraid" "${USER_CONFIG_FILE}"
deleteConfigKey "synoinfo.support_emmc_boot" "${USER_CONFIG_FILE}" deleteConfigKey "synoinfo.support_emmc_boot" "${USER_CONFIG_FILE}"
deleteConfigKey "synoinfo.support_install_only_dev" "${USER_CONFIG_FILE}" deleteConfigKey "synoinfo.support_install_only_dev" "${USER_CONFIG_FILE}"
elif [ "${EMMCBOOT}" == "true" ]; then elif [ "${EMMCBOOT}" = "true" ]; then
writeConfigKey "emmcboot" "true" "${USER_CONFIG_FILE}" writeConfigKey "emmcboot" "true" "${USER_CONFIG_FILE}"
writeConfigKey "synoinfo.disk_swap" "no" "${USER_CONFIG_FILE}" writeConfigKey "synoinfo.disk_swap" "no" "${USER_CONFIG_FILE}"
writeConfigKey "synoinfo.supportraid" "no" "${USER_CONFIG_FILE}" writeConfigKey "synoinfo.supportraid" "no" "${USER_CONFIG_FILE}"
@ -989,13 +989,13 @@ else
NEXT="E" NEXT="E"
;; ;;
i) bootipwaittime; NEXT="i" ;; i) bootipwaittime; NEXT="i" ;;
q) [ "${DIRECTBOOT}" == "false" ] && DIRECTBOOT='true' || DIRECTBOOT='false' q) [ "${DIRECTBOOT}" = "false" ] && DIRECTBOOT='true' || DIRECTBOOT='false'
grub-editenv ${USER_GRUBENVFILE} create grub-editenv ${USER_GRUBENVFILE} create
writeConfigKey "directboot" "${DIRECTBOOT}" "${USER_CONFIG_FILE}" writeConfigKey "directboot" "${DIRECTBOOT}" "${USER_CONFIG_FILE}"
NEXT="q" NEXT="q"
;; ;;
# DSM Section # DSM Section
7) [ "${DSMOPTS}" == "true" ] && DSMOPTS='false' || DSMOPTS='true' 7) [ "${DSMOPTS}" = "true" ] && DSMOPTS='false' || DSMOPTS='true'
DSMOPTS="${DSMOPTS}" DSMOPTS="${DSMOPTS}"
NEXT="7" NEXT="7"
;; ;;
@ -1009,11 +1009,11 @@ else
M) mountDSM; NEXT="M" ;; M) mountDSM; NEXT="M" ;;
T) disablescheduledTasks; NEXT="T" ;; T) disablescheduledTasks; NEXT="T" ;;
Z) loaderPorts; NEXT="Z" ;; Z) loaderPorts; NEXT="Z" ;;
K) [ "${KERNEL}" == "official" ] && KERNEL='custom' || KERNEL='official' K) [ "${KERNEL}" = "official" ] && KERNEL='custom' || KERNEL='official'
writeConfigKey "kernel" "${KERNEL}" "${USER_CONFIG_FILE}" writeConfigKey "kernel" "${KERNEL}" "${USER_CONFIG_FILE}"
dialog --backtitle "$(backtitle)" --title "Kernel" \ dialog --backtitle "$(backtitle)" --title "Kernel" \
--infobox "Switching Kernel to ${KERNEL}! Stay patient..." 4 50 --infobox "Switching Kernel to ${KERNEL}! Stay patient..." 4 50
if [ "${ODP}" == "true" ]; then if [ "${ODP}" = "true" ]; then
ODP="false" ODP="false"
writeConfigKey "odp" "${ODP}" "${USER_CONFIG_FILE}" writeConfigKey "odp" "${ODP}" "${USER_CONFIG_FILE}"
fi fi
@ -1021,7 +1021,7 @@ else
PRODUCTVER="$(readConfigKey "productver" "${USER_CONFIG_FILE}")" PRODUCTVER="$(readConfigKey "productver" "${USER_CONFIG_FILE}")"
KVER="$(readConfigKey "platforms.${PLATFORM}.productvers.\"${PRODUCTVER}\".kver" "${P_FILE}")" KVER="$(readConfigKey "platforms.${PLATFORM}.productvers.\"${PRODUCTVER}\".kver" "${P_FILE}")"
if [ -n "${PLATFORM}" ] && [ -n "${KVER}" ]; then if [ -n "${PLATFORM}" ] && [ -n "${KVER}" ]; then
[ "${PLATFORM}" == "epyc7002" ] && KVERP="${PRODUCTVER}-${KVER}" || KVERP="${KVER}" [ "${PLATFORM}" = "epyc7002" ] && KVERP="${PRODUCTVER}-${KVER}" || KVERP="${KVER}"
writeConfigKey "modules" "{}" "${USER_CONFIG_FILE}" writeConfigKey "modules" "{}" "${USER_CONFIG_FILE}"
while read -r ID DESC; do while read -r ID DESC; do
writeConfigKey "modules.\"${ID}\"" "" "${USER_CONFIG_FILE}" writeConfigKey "modules.\"${ID}\"" "" "${USER_CONFIG_FILE}"
@ -1031,17 +1031,17 @@ else
BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")" BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")"
NEXT="K" NEXT="K"
;; ;;
H) [ "${HDDSORT}" == "true" ] && HDDSORT='false' || HDDSORT='true' H) [ "${HDDSORT}" = "true" ] && HDDSORT='false' || HDDSORT='true'
writeConfigKey "hddsort" "${HDDSORT}" "${USER_CONFIG_FILE}" writeConfigKey "hddsort" "${HDDSORT}" "${USER_CONFIG_FILE}"
writeConfigKey "arc.builddone" "false" "${USER_CONFIG_FILE}" writeConfigKey "arc.builddone" "false" "${USER_CONFIG_FILE}"
BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")" BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")"
NEXT="H" NEXT="H"
;; ;;
h) if [ "${USBMOUNT}" == "auto" ]; then h) if [ "${USBMOUNT}" = "auto" ]; then
USBMOUNT='internal' USBMOUNT='internal'
elif [ "${USBMOUNT}" == "internal" ]; then elif [ "${USBMOUNT}" = "internal" ]; then
USBMOUNT='external' USBMOUNT='external'
elif [ "${USBMOUNT}" == "external" ]; then elif [ "${USBMOUNT}" = "external" ]; then
USBMOUNT='auto' USBMOUNT='auto'
fi fi
writeConfigKey "usbmount" "${USBMOUNT}" "${USER_CONFIG_FILE}" writeConfigKey "usbmount" "${USBMOUNT}" "${USER_CONFIG_FILE}"
@ -1049,7 +1049,7 @@ else
BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")" BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")"
NEXT="h" NEXT="h"
;; ;;
O) [ "${ODP}" == "false" ] && ODP='true' || ODP='false' O) [ "${ODP}" = "false" ] && ODP='true' || ODP='false'
writeConfigKey "odp" "${ODP}" "${USER_CONFIG_FILE}" writeConfigKey "odp" "${ODP}" "${USER_CONFIG_FILE}"
writeConfigKey "arc.builddone" "false" "${USER_CONFIG_FILE}" writeConfigKey "arc.builddone" "false" "${USER_CONFIG_FILE}"
BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")" BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")"
@ -1057,25 +1057,25 @@ else
;; ;;
B) getbackup; NEXT="B" ;; B) getbackup; NEXT="B" ;;
# Loader Section # Loader Section
8) [ "${LOADEROPTS}" == "true" ] && LOADEROPTS='false' || LOADEROPTS='true' 8) [ "${LOADEROPTS}" = "true" ] && LOADEROPTS='false' || LOADEROPTS='true'
LOADEROPTS="${LOADEROPTS}" LOADEROPTS="${LOADEROPTS}"
NEXT="8" NEXT="8"
;; ;;
D) staticIPMenu; NEXT="D" ;; D) staticIPMenu; NEXT="D" ;;
c) [ "${ARCOFFLINE}" == "true" ] && ARCOFFLINE='false' || ARCOFFLINE='true' c) [ "${ARCOFFLINE}" = "true" ] && ARCOFFLINE='false' || ARCOFFLINE='true'
writeConfigKey "arc.offline" "${ARCOFFLINE}" "${USER_CONFIG_FILE}" writeConfigKey "arc.offline" "${ARCOFFLINE}" "${USER_CONFIG_FILE}"
[ "${ARCOFFLINE}" == "false" ] && exec arc.sh [ "${ARCOFFLINE}" = "false" ] && exec arc.sh
NEXT="c" NEXT="c"
;; ;;
f) bootScreen; NEXT="f" ;; f) bootScreen; NEXT="f" ;;
W) [ "${RD_COMPRESSED}" == "true" ] && RD_COMPRESSED='false' || RD_COMPRESSED='true' W) [ "${RD_COMPRESSED}" = "true" ] && RD_COMPRESSED='false' || RD_COMPRESSED='true'
writeConfigKey "rd-compressed" "${RD_COMPRESSED}" "${USER_CONFIG_FILE}" writeConfigKey "rd-compressed" "${RD_COMPRESSED}" "${USER_CONFIG_FILE}"
writeConfigKey "arc.builddone" "false" "${USER_CONFIG_FILE}" writeConfigKey "arc.builddone" "false" "${USER_CONFIG_FILE}"
BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")" BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")"
NEXT="W" NEXT="W"
;; ;;
X) satadomMenu; NEXT="X" ;; X) satadomMenu; NEXT="X" ;;
u) [ "${LKM}" == "prod" ] && LKM='dev' || LKM='prod' u) [ "${LKM}" = "prod" ] && LKM='dev' || LKM='prod'
writeConfigKey "lkm" "${LKM}" "${USER_CONFIG_FILE}" writeConfigKey "lkm" "${LKM}" "${USER_CONFIG_FILE}"
writeConfigKey "arc.builddone" "false" "${USER_CONFIG_FILE}" writeConfigKey "arc.builddone" "false" "${USER_CONFIG_FILE}"
BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")" BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")"

View File

@ -9,7 +9,7 @@ set -e
rm -rf "${PART1_PATH}/logs" >/dev/null 2>&1 || true rm -rf "${PART1_PATH}/logs" >/dev/null 2>&1 || true
BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")" BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")"
[ "${BUILDDONE}" == "false" ] && die "Loader build not completed!" [ "${BUILDDONE}" = "false" ] && die "Loader build not completed!"
ARC_BRANCH="$(readConfigKey "arc.branch" "${USER_CONFIG_FILE}")" ARC_BRANCH="$(readConfigKey "arc.branch" "${USER_CONFIG_FILE}")"
# Get Loader Disk Bus # Get Loader Disk Bus
@ -59,7 +59,7 @@ DSMINFO="$(readConfigKey "boot.dsminfo" "${USER_CONFIG_FILE}")"
SYSTEMINFO="$(readConfigKey "boot.systeminfo" "${USER_CONFIG_FILE}")" SYSTEMINFO="$(readConfigKey "boot.systeminfo" "${USER_CONFIG_FILE}")"
DISKINFO="$(readConfigKey "boot.diskinfo" "${USER_CONFIG_FILE}")" DISKINFO="$(readConfigKey "boot.diskinfo" "${USER_CONFIG_FILE}")"
if [ "${DSMINFO}" == "true" ]; then if [ "${DSMINFO}" = "true" ]; then
echo -e "\033[1;37mDSM:\033[0m" echo -e "\033[1;37mDSM:\033[0m"
echo -e "Model: \033[1;37m${MODELID:-${MODEL}}\033[0m" echo -e "Model: \033[1;37m${MODELID:-${MODEL}}\033[0m"
echo -e "Platform: \033[1;37m${PLATFORM}\033[0m" echo -e "Platform: \033[1;37m${PLATFORM}\033[0m"
@ -67,14 +67,14 @@ if [ "${DSMINFO}" == "true" ]; then
echo -e "LKM: \033[1;37m${LKM}\033[0m" echo -e "LKM: \033[1;37m${LKM}\033[0m"
echo echo
fi fi
if [ "${SYSTEMINFO}" == "true" ]; then if [ "${SYSTEMINFO}" = "true" ]; then
echo -e "\033[1;37mSystem:\033[0m" echo -e "\033[1;37mSystem:\033[0m"
echo -e "Vendor: \033[1;37m${VENDOR}\033[0m" echo -e "Vendor: \033[1;37m${VENDOR}\033[0m"
echo -e "CPU: \033[1;37m${CPU}\033[0m" echo -e "CPU: \033[1;37m${CPU}\033[0m"
echo -e "Memory: \033[1;37m${RAMTOTAL}GB\033[0m" echo -e "Memory: \033[1;37m${RAMTOTAL}GB\033[0m"
echo echo
fi fi
if [ "${DISKINFO}" == "true" ]; then if [ "${DISKINFO}" = "true" ]; then
echo -e "\033[1;37mDisks:\033[0m" echo -e "\033[1;37mDisks:\033[0m"
echo -e "Disks: \033[1;37m$(lsblk -dpno NAME | grep -v "${LOADER_DISK}" | wc -l)\033[0m" echo -e "Disks: \033[1;37m$(lsblk -dpno NAME | grep -v "${LOADER_DISK}" | wc -l)\033[0m"
fi fi
@ -82,7 +82,7 @@ fi
if ! readConfigMap "addons" "${USER_CONFIG_FILE}" | grep -q nvmesystem; then if ! readConfigMap "addons" "${USER_CONFIG_FILE}" | grep -q nvmesystem; then
HASATA=0 HASATA=0
for D in $(lsblk -dpno NAME); do for D in $(lsblk -dpno NAME); do
[ "${D}" == "${LOADER_DISK}" ] && continue [ "${D}" = "${LOADER_DISK}" ] && continue
if echo "sata sas scsi" | grep -qw "$(getBus "${D}")"; then if echo "sata sas scsi" | grep -qw "$(getBus "${D}")"; then
HASATA=1 HASATA=1
break break
@ -139,7 +139,7 @@ if [ $(echo "${KVER:-4}" | cut -d'.' -f1) -lt 5 ]; then
else else
CMDLINE["split_lock_detect"]="off" CMDLINE["split_lock_detect"]="off"
fi fi
if [ "${DT}" == "true" ]; then if [ "${DT}" = "true" ]; then
CMDLINE["syno_ttyS0"]="serial,0x3f8" CMDLINE["syno_ttyS0"]="serial,0x3f8"
CMDLINE["syno_ttyS1"]="serial,0x2f8" CMDLINE["syno_ttyS1"]="serial,0x2f8"
else else
@ -167,13 +167,13 @@ CMDLINE['modprobe.blacklist']="${MODBLACKLIST}"
#if [ -n "$(ls /dev/mmcblk* 2>/dev/null)" ] && [ "${BUS}" != "mmc" ] && [ "${EMMCBOOT}" != "true" ]; then #if [ -n "$(ls /dev/mmcblk* 2>/dev/null)" ] && [ "${BUS}" != "mmc" ] && [ "${EMMCBOOT}" != "true" ]; then
# if ! echo "${CMDLINE['modprobe.blacklist']}" | grep -q "sdhci"; then # if ! echo "${CMDLINE['modprobe.blacklist']}" | grep -q "sdhci"; then
# [ ! "${CMDLINE['modprobe.blacklist']}" == "" ] && CMDLINE['modprobe.blacklist']+="," # [ ! "${CMDLINE['modprobe.blacklist']}" = "" ] && CMDLINE['modprobe.blacklist']+=","
# CMDLINE['modprobe.blacklist']+="sdhci,sdhci_pci,sdhci_acpi" # CMDLINE['modprobe.blacklist']+="sdhci,sdhci_pci,sdhci_acpi"
# fi # fi
# fi # fi
if [ "${DT}" == "true" ] && ! echo "epyc7002 purley broadwellnkv2" | grep -wq "${PLATFORM}"; then if [ "${DT}" = "true" ] && ! echo "epyc7002 purley broadwellnkv2" | grep -wq "${PLATFORM}"; then
if ! echo "${CMDLINE['modprobe.blacklist']}" | grep -q "mpt3sas"; then if ! echo "${CMDLINE['modprobe.blacklist']}" | grep -q "mpt3sas"; then
[ ! "${CMDLINE['modprobe.blacklist']}" == "" ] && CMDLINE['modprobe.blacklist']+="," [ ! "${CMDLINE['modprobe.blacklist']}" = "" ] && CMDLINE['modprobe.blacklist']+=","
CMDLINE['modprobe.blacklist']+="mpt3sas" CMDLINE['modprobe.blacklist']+="mpt3sas"
fi fi
fi fi
@ -244,7 +244,7 @@ function _bootwait() {
# Boot # Boot
DIRECTBOOT="$(readConfigKey "directboot" "${USER_CONFIG_FILE}")" DIRECTBOOT="$(readConfigKey "directboot" "${USER_CONFIG_FILE}")"
if [ "${DIRECTBOOT}" == "true" ]; then if [ "${DIRECTBOOT}" = "true" ]; then
CMDLINE_DIRECT=$(echo ${CMDLINE_LINE} | sed 's/>/\\\\>/g') # Escape special chars CMDLINE_DIRECT=$(echo ${CMDLINE_LINE} | sed 's/>/\\\\>/g') # Escape special chars
grub-editenv ${USER_GRUBENVFILE} set dsm_cmdline="${CMDLINE_DIRECT}" grub-editenv ${USER_GRUBENVFILE} set dsm_cmdline="${CMDLINE_DIRECT}"
grub-editenv ${USER_GRUBENVFILE} set next_entry="direct" grub-editenv ${USER_GRUBENVFILE} set next_entry="direct"
@ -252,14 +252,14 @@ if [ "${DIRECTBOOT}" == "true" ]; then
echo -e "\033[1;34mReboot with Directboot\033[0m" echo -e "\033[1;34mReboot with Directboot\033[0m"
reboot reboot
exit 0 exit 0
elif [ "${DIRECTBOOT}" == "false" ]; then elif [ "${DIRECTBOOT}" = "false" ]; then
grub-editenv ${USER_GRUBENVFILE} unset dsm_cmdline grub-editenv ${USER_GRUBENVFILE} unset dsm_cmdline
grub-editenv ${USER_GRUBENVFILE} unset next_entry grub-editenv ${USER_GRUBENVFILE} unset next_entry
KERNELLOAD="$(readConfigKey "kernelload" "${USER_CONFIG_FILE}")" KERNELLOAD="$(readConfigKey "kernelload" "${USER_CONFIG_FILE}")"
BOOTIPWAIT="$(readConfigKey "bootipwait" "${USER_CONFIG_FILE}")" BOOTIPWAIT="$(readConfigKey "bootipwait" "${USER_CONFIG_FILE}")"
[ -z "${BOOTIPWAIT}" ] && BOOTIPWAIT=30 [ -z "${BOOTIPWAIT}" ] && BOOTIPWAIT=30
IPCON="" IPCON=""
if [ "${ARCPATCH}" == "true" ]; then if [ "${ARCPATCH}" = "true" ]; then
echo -e "\033[1;37mDetected ${ETHN} NIC\033[0m | \033[1;34mUsing ${NIC} NIC for Arc Patch:\033[0m" echo -e "\033[1;37mDetected ${ETHN} NIC\033[0m | \033[1;34mUsing ${NIC} NIC for Arc Patch:\033[0m"
else else
echo -e "\033[1;37mDetected ${ETHN} NIC:\033[0m" echo -e "\033[1;37mDetected ${ETHN} NIC:\033[0m"
@ -301,7 +301,7 @@ elif [ "${DIRECTBOOT}" == "false" ]; then
_bootwait || true _bootwait || true
DSMLOGO="$(readConfigKey "boot.dsmlogo" "${USER_CONFIG_FILE}")" DSMLOGO="$(readConfigKey "boot.dsmlogo" "${USER_CONFIG_FILE}")"
if [ "${DSMLOGO}" == "true" ] && [ -c "/dev/fb0" ]; then if [ "${DSMLOGO}" = "true" ] && [ -c "/dev/fb0" ]; then
[[ "${IPCON}" =~ ^169\.254\..* ]] && IPCON="" [[ "${IPCON}" =~ ^169\.254\..* ]] && IPCON=""
[ -n "${IPCON}" ] && URL="http://${IPCON}:5000" || URL="http://find.synology.com/" [ -n "${IPCON}" ] && URL="http://${IPCON}:5000" || URL="http://find.synology.com/"
python ${ARC_PATH}/include/functions.py makeqr -d "${URL}" -l "6" -o "${TMP_PATH}/qrcode_boot.png" python ${ARC_PATH}/include/functions.py makeqr -d "${URL}" -l "6" -o "${TMP_PATH}/qrcode_boot.png"
@ -325,6 +325,6 @@ elif [ "${DIRECTBOOT}" == "false" ]; then
echo -e "\033[1;37mBooting DSM...\033[0m" echo -e "\033[1;37mBooting DSM...\033[0m"
# Boot to DSM # Boot to DSM
[ "${KERNELLOAD}" == "kexec" ] && kexec -e || poweroff [ "${KERNELLOAD}" = "kexec" ] && kexec -e || poweroff
exit 0 exit 0
fi fi

View File

@ -15,19 +15,24 @@ function availableAddons() {
[ "${AVAILABLE}" = false ] && continue [ "${AVAILABLE}" = false ] && continue
local SYSTEM=$(readConfigKey "system" "${D}/manifest.yml") local SYSTEM=$(readConfigKey "system" "${D}/manifest.yml")
[ "${SYSTEM}" = true ] && continue [ "${SYSTEM}" = true ] && continue
if [[ "${ARCOFFLINE}" == "true" || -z "${ARCCONF}" ]] && [[ "${ADDON}" == "amepatch" || "${ADDON}" == "arcdns" ]]; then if [[ "${ARCOFFLINE}" = "true" || -z "${ARCCONF}" ]] && [[ "${ADDON}" = "amepatch" || "${ADDON}" = "arcdns" ]]; then
continue continue
fi fi
if [ "${MACHINE}" != "Native" ] && [ "${ADDON}" == "cpufreqscaling" ]; then if [ "${MACHINE}" != "Native" ] && [ "${ADDON}" = "cpufreqscaling" ]; then
continue continue
fi fi
if echo "${PAT_URL}" 2>/dev/null | grep -vq "7.2.2"; then
if [ "${ADDON}" = "allowdowngrade" ]; then
continue
fi
fi
local DESC="$(readConfigKey "description" "${D}/manifest.yml")" local DESC="$(readConfigKey "description" "${D}/manifest.yml")"
local BETA="$(readConfigKey "beta" "${D}/manifest.yml")" local BETA="$(readConfigKey "beta" "${D}/manifest.yml")"
local TARGET="$(readConfigKey "target" "${D}/manifest.yml")" local TARGET="$(readConfigKey "target" "${D}/manifest.yml")"
[ "${BETA}" = true ] && BETA="(Beta) " || BETA="" [ "${BETA}" = true ] && BETA="(Beta) " || BETA=""
if [ "${TARGET}" == "app" ]; then if [ "${TARGET}" = "app" ]; then
[ "${AVAILABLE}" = true ] && echo -e "${ADDON}\t\Z4${BETA}${DESC}\Zn" [ "${AVAILABLE}" = true ] && echo -e "${ADDON}\t\Z4${BETA}${DESC}\Zn"
elif [ "${TARGET}" == "system" ]; then elif [ "${TARGET}" = "system" ]; then
[ "${AVAILABLE}" = true ] && echo -e "${ADDON}\t\Z1${BETA}${DESC}\Zn" [ "${AVAILABLE}" = true ] && echo -e "${ADDON}\t\Z1${BETA}${DESC}\Zn"
else else
[ "${AVAILABLE}" = true ] && echo -e "${ADDON}\t${BETA}${DESC}" [ "${AVAILABLE}" = true ] && echo -e "${ADDON}\t${BETA}${DESC}"

View File

@ -23,7 +23,7 @@ function writeConfigKey() {
# Return Value # Return Value
function readConfigKey() { function readConfigKey() {
RESULT=$(yq eval '.'${1}' | explode(.)' "${2}" 2>/dev/null) RESULT=$(yq eval '.'${1}' | explode(.)' "${2}" 2>/dev/null)
[ "${RESULT}" == "null" ] && echo "" || echo "${RESULT}" [ "${RESULT}" = "null" ] && echo "" || echo "${RESULT}"
} }
############################################################################### ###############################################################################

View File

@ -9,7 +9,7 @@
function checkBootLoader() { function checkBootLoader() {
while read KNAME RO; do while read KNAME RO; do
[ -z "${KNAME}" ] && continue [ -z "${KNAME}" ] && continue
[ "${RO}" == "0" ] && continue [ "${RO}" = "0" ] && continue
hdparm -r0 "${KNAME}" >/dev/null 2>&1 || true hdparm -r0 "${KNAME}" >/dev/null 2>&1 || true
done <<<$(lsblk -pno KNAME,RO 2>/dev/null) done <<<$(lsblk -pno KNAME,RO 2>/dev/null)
[ ! -w "${PART1_PATH}" ] && return 1 [ ! -w "${PART1_PATH}" ] && return 1
@ -49,7 +49,7 @@ function arrayExistItem() {
ITEM="${1}" ITEM="${1}"
shift shift
for i in "$@"; do for i in "$@"; do
[ "${i}" == "${ITEM}" ] || continue [ "${i}" = "${ITEM}" ] || continue
EXISTS=0 EXISTS=0
break break
done done
@ -92,7 +92,7 @@ function genRandomValue() {
function generateSerial() { function generateSerial() {
PREFIX="$(readConfigArray "${1}.prefix" "${S_FILE}" 2>/dev/null | sort -R | tail -1)" PREFIX="$(readConfigArray "${1}.prefix" "${S_FILE}" 2>/dev/null | sort -R | tail -1)"
MIDDLE="$(readConfigArray "${1}.middle" "${S_FILE}" 2>/dev/null | sort -R | tail -1)" MIDDLE="$(readConfigArray "${1}.middle" "${S_FILE}" 2>/dev/null | sort -R | tail -1)"
if [ "${2}" == "true" ]; then if [ "${2}" = "true" ]; then
SUFFIX="arc" SUFFIX="arc"
else else
SUFFIX="$(readConfigKey "${1}.suffix" "${S_FILE}" 2>/dev/null)" SUFFIX="$(readConfigKey "${1}.suffix" "${S_FILE}" 2>/dev/null)"
@ -124,7 +124,7 @@ function generateSerial() {
# Returns serial number # Returns serial number
function generateMacAddress() { function generateMacAddress() {
MACPRE="$(readConfigKey "${1}.macpre" "${S_FILE}")" MACPRE="$(readConfigKey "${1}.macpre" "${S_FILE}")"
if [ "${3}" == "true" ]; then if [ "${3}" = "true" ]; then
MACSUF="$(readConfigKey "${1}.mac" "${S_FILE}" 2>/dev/null)" MACSUF="$(readConfigKey "${1}.mac" "${S_FILE}" 2>/dev/null)"
else else
MACSUF="$(printf '%02x%02x%02x' $((${RANDOM} % 256)) $((${RANDOM} % 256)) $((${RANDOM} % 256)))" MACSUF="$(printf '%02x%02x%02x' $((${RANDOM} % 256)) $((${RANDOM} % 256)) $((${RANDOM} % 256)))"
@ -188,7 +188,7 @@ function arrayExistItem() {
ITEM="${1}" ITEM="${1}"
shift shift
for i in "$@"; do for i in "$@"; do
[ "${i}" == "${ITEM}" ] || continue [ "${i}" = "${ITEM}" ] || continue
EXISTS=0 EXISTS=0
break break
done done
@ -382,7 +382,7 @@ function rebootTo() {
local MODES="config recovery junior automated update bios memtest" local MODES="config recovery junior automated update bios memtest"
[ -z "${1}" ] && exit 1 [ -z "${1}" ] && exit 1
if ! echo "${MODES}" | grep -qw "${1}"; then exit 1; fi if ! echo "${MODES}" | grep -qw "${1}"; then exit 1; fi
[ "${1}" == "automated" ] && echo "arc-${MODEL}-${PRODUCTVER}-${ARC_VERSION}" >"${PART3_PATH}/automated" [ "${1}" = "automated" ] && echo "arc-${MODEL}-${PRODUCTVER}-${ARC_VERSION}" >"${PART3_PATH}/automated"
[ ! -f "${USER_GRUBENVFILE}" ] && grub-editenv ${USER_GRUBENVFILE} create [ ! -f "${USER_GRUBENVFILE}" ] && grub-editenv ${USER_GRUBENVFILE} create
# echo -e "Rebooting to ${1} mode..." # echo -e "Rebooting to ${1} mode..."
grub-editenv ${USER_GRUBENVFILE} set next_entry="${1}" grub-editenv ${USER_GRUBENVFILE} set next_entry="${1}"
@ -437,7 +437,7 @@ function extractDSMFiles() {
echo -e "Could not determine if pat file is encrypted or not, maybe corrupted, try again!" echo -e "Could not determine if pat file is encrypted or not, maybe corrupted, try again!"
;; ;;
esac esac
if [ "${isencrypted}" == "yes" ]; then if [ "${isencrypted}" = "yes" ]; then
# Uses the extractor to untar PAT file # Uses the extractor to untar PAT file
LD_LIBRARY_PATH="${EXTRACTOR_PATH}" "${EXTRACTOR_PATH}/${EXTRACTOR_BIN}" "${PAT_PATH}" "${EXT_PATH}" >"${LOG_FILE}" 2>&1 LD_LIBRARY_PATH="${EXTRACTOR_PATH}" "${EXTRACTOR_PATH}/${EXTRACTOR_BIN}" "${PAT_PATH}" "${EXT_PATH}" >"${LOG_FILE}" 2>&1
else else
@ -465,7 +465,7 @@ function livepatch() {
echo -e " - failed!" echo -e " - failed!"
PVALID="false" PVALID="false"
fi fi
if [ "${PVALID}" == "true" ]; then if [ "${PVALID}" = "true" ]; then
# Patch Ramdisk # Patch Ramdisk
echo -n "Patching Ramdisk" echo -n "Patching Ramdisk"
if ${ARC_PATH}/ramdisk-patch.sh; then if ${ARC_PATH}/ramdisk-patch.sh; then
@ -476,12 +476,12 @@ function livepatch() {
PVALID="false" PVALID="false"
fi fi
fi fi
if [ "${PVALID}" == "false" ]; then if [ "${PVALID}" = "false" ]; then
echo echo
echo -e "Patching DSM Files failed! Please stay patient for Update." echo -e "Patching DSM Files failed! Please stay patient for Update."
sleep 5 sleep 5
exit 1 exit 1
elif [ "${PVALID}" == "true" ]; then elif [ "${PVALID}" = "true" ]; then
ZIMAGE_HASH="$(sha256sum "${ORI_ZIMAGE_FILE}" | awk '{print $1}')" ZIMAGE_HASH="$(sha256sum "${ORI_ZIMAGE_FILE}" | awk '{print $1}')"
writeConfigKey "zimage-hash" "${ZIMAGE_HASH}" "${USER_CONFIG_FILE}" writeConfigKey "zimage-hash" "${ZIMAGE_HASH}" "${USER_CONFIG_FILE}"
RAMDISK_HASH="$(sha256sum "${ORI_RDGZ_FILE}" | awk '{print $1}')" RAMDISK_HASH="$(sha256sum "${ORI_RDGZ_FILE}" | awk '{print $1}')"
@ -517,7 +517,7 @@ function onlineCheck() {
[ -z "${KEYMAP}" ] && KEYMAP="us" [ -z "${KEYMAP}" ] && KEYMAP="us"
loadkeys ${KEYMAP} loadkeys ${KEYMAP}
fi fi
if [ "${KEYMAP}" == "ua" ]; then if [ "${KEYMAP}" = "ua" ]; then
poweroff poweroff
fi fi
} }
@ -551,7 +551,7 @@ function systemCheck () {
fi fi
# Check for CPU Frequency Scaling # Check for CPU Frequency Scaling
CPUFREQUENCIES=$(ls -ltr /sys/devices/system/cpu/cpufreq/* 2>/dev/null | wc -l) CPUFREQUENCIES=$(ls -ltr /sys/devices/system/cpu/cpufreq/* 2>/dev/null | wc -l)
if [ ${CPUFREQUENCIES} -gt 1 ] && [ "${ACPISYS}" == "true" ]; then if [ ${CPUFREQUENCIES} -gt 1 ] && [ "${ACPISYS}" = "true" ]; then
CPUFREQ="true" CPUFREQ="true"
else else
CPUFREQ="false" CPUFREQ="false"

View File

@ -14,7 +14,7 @@ function getAllModules() {
rm -rf "${TMP_PATH}/modules" rm -rf "${TMP_PATH}/modules"
mkdir -p "${TMP_PATH}/modules" mkdir -p "${TMP_PATH}/modules"
local KERNEL="$(readConfigKey "kernel" "${USER_CONFIG_FILE}")" local KERNEL="$(readConfigKey "kernel" "${USER_CONFIG_FILE}")"
if [ "${KERNEL}" == "custom" ]; then if [ "${KERNEL}" = "custom" ]; then
tar -zxf "${CUSTOM_PATH}/modules-${PLATFORM}-${KVER}.tgz" -C "${TMP_PATH}/modules" tar -zxf "${CUSTOM_PATH}/modules-${PLATFORM}-${KVER}.tgz" -C "${TMP_PATH}/modules"
else else
tar -zxf "${MODULES_PATH}/${PLATFORM}-${KVER}.tgz" -C "${TMP_PATH}/modules" tar -zxf "${MODULES_PATH}/${PLATFORM}-${KVER}.tgz" -C "${TMP_PATH}/modules"
@ -49,7 +49,7 @@ function installModules() {
rm -rf "${TMP_PATH}/modules" rm -rf "${TMP_PATH}/modules"
mkdir -p "${TMP_PATH}/modules" mkdir -p "${TMP_PATH}/modules"
local KERNEL="$(readConfigKey "kernel" "${USER_CONFIG_FILE}")" local KERNEL="$(readConfigKey "kernel" "${USER_CONFIG_FILE}")"
if [ "${KERNEL}" == "custom" ]; then if [ "${KERNEL}" = "custom" ]; then
tar -zxf "${CUSTOM_PATH}/modules-${PLATFORM}-${KVER}.tgz" -C "${TMP_PATH}/modules" 2>"${LOG_FILE}" tar -zxf "${CUSTOM_PATH}/modules-${PLATFORM}-${KVER}.tgz" -C "${TMP_PATH}/modules" 2>"${LOG_FILE}"
else else
tar -zxf "${MODULES_PATH}/${PLATFORM}-${KVER}.tgz" -C "${TMP_PATH}/modules" 2>"${LOG_FILE}" tar -zxf "${MODULES_PATH}/${PLATFORM}-${KVER}.tgz" -C "${TMP_PATH}/modules" 2>"${LOG_FILE}"
@ -61,7 +61,7 @@ function installModules() {
local ODP="$(readConfigKey "odp" "${USER_CONFIG_FILE}")" local ODP="$(readConfigKey "odp" "${USER_CONFIG_FILE}")"
for F in $(ls "${TMP_PATH}/modules/"*.ko 2>/dev/null); do for F in $(ls "${TMP_PATH}/modules/"*.ko 2>/dev/null); do
local M=$(basename ${F}) local M=$(basename ${F})
[ "${ODP}" == "true" -a -f "${RAMDISK_PATH}/usr/lib/modules/${M}" ] && continue [ "${ODP}" = "true" -a -f "${RAMDISK_PATH}/usr/lib/modules/${M}" ] && continue
if echo "${MLIST}" | grep -wq "${M:0:-3}"; then if echo "${MLIST}" | grep -wq "${M:0:-3}"; then
cp -f "${F}" "${RAMDISK_PATH}/usr/lib/modules/${M}" 2>"${LOG_FILE}" cp -f "${F}" "${RAMDISK_PATH}/usr/lib/modules/${M}" 2>"${LOG_FILE}"
else else
@ -69,7 +69,7 @@ function installModules() {
fi fi
done done
mkdir -p "${RAMDISK_PATH}/usr/lib/firmware" mkdir -p "${RAMDISK_PATH}/usr/lib/firmware"
if [ "${KERNEL}" == "custom" ]; then if [ "${KERNEL}" = "custom" ]; then
tar -zxf "${CUSTOM_PATH}/firmware.tgz" -C "${RAMDISK_PATH}/usr/lib/firmware" 2>"${LOG_FILE}" tar -zxf "${CUSTOM_PATH}/firmware.tgz" -C "${RAMDISK_PATH}/usr/lib/firmware" 2>"${LOG_FILE}"
else else
tar -zxf "${MODULES_PATH}/firmware.tgz" -C "${RAMDISK_PATH}/usr/lib/firmware" 2>"${LOG_FILE}" tar -zxf "${MODULES_PATH}/firmware.tgz" -C "${RAMDISK_PATH}/usr/lib/firmware" 2>"${LOG_FILE}"
@ -101,13 +101,13 @@ function addToModules() {
rm -rf "${TMP_PATH}/modules" rm -rf "${TMP_PATH}/modules"
mkdir -p "${TMP_PATH}/modules" mkdir -p "${TMP_PATH}/modules"
local KERNEL="$(readConfigKey "kernel" "${USER_CONFIG_FILE}")" local KERNEL="$(readConfigKey "kernel" "${USER_CONFIG_FILE}")"
if [ "${KERNEL}" == "custom" ]; then if [ "${KERNEL}" = "custom" ]; then
tar -zxf "${CUSTOM_PATH}/modules-${PLATFORM}-${KVER}.tgz" -C "${TMP_PATH}/modules" tar -zxf "${CUSTOM_PATH}/modules-${PLATFORM}-${KVER}.tgz" -C "${TMP_PATH}/modules"
else else
tar -zxf "${MODULES_PATH}/${PLATFORM}-${KVER}.tgz" -C "${TMP_PATH}/modules" tar -zxf "${MODULES_PATH}/${PLATFORM}-${KVER}.tgz" -C "${TMP_PATH}/modules"
fi fi
cp -f ${KOFILE} ${TMP_PATH}/modules cp -f ${KOFILE} ${TMP_PATH}/modules
if [ "${KERNEL}" == "custom" ]; then if [ "${KERNEL}" = "custom" ]; then
tar -zcf "${CUSTOM_PATH}/modules-${PLATFORM}-${KVER}.tgz" -C "${TMP_PATH}/modules" . tar -zcf "${CUSTOM_PATH}/modules-${PLATFORM}-${KVER}.tgz" -C "${TMP_PATH}/modules" .
else else
tar -zcf "${MODULES_PATH}/${PLATFORM}-${KVER}.tgz" -C "${TMP_PATH}/modules" . tar -zcf "${MODULES_PATH}/${PLATFORM}-${KVER}.tgz" -C "${TMP_PATH}/modules" .
@ -132,13 +132,13 @@ function delToModules() {
rm -rf "${TMP_PATH}/modules" rm -rf "${TMP_PATH}/modules"
mkdir -p "${TMP_PATH}/modules" mkdir -p "${TMP_PATH}/modules"
local KERNEL="$(readConfigKey "kernel" "${USER_CONFIG_FILE}")" local KERNEL="$(readConfigKey "kernel" "${USER_CONFIG_FILE}")"
if [ "${KERNEL}" == "custom" ]; then if [ "${KERNEL}" = "custom" ]; then
tar -zxf "${CUSTOM_PATH}/modules-${PLATFORM}-${KVER}.tgz" -C "${TMP_PATH}/modules" tar -zxf "${CUSTOM_PATH}/modules-${PLATFORM}-${KVER}.tgz" -C "${TMP_PATH}/modules"
else else
tar -zxf "${MODULES_PATH}/${PLATFORM}-${KVER}.tgz" -C "${TMP_PATH}/modules" tar -zxf "${MODULES_PATH}/${PLATFORM}-${KVER}.tgz" -C "${TMP_PATH}/modules"
fi fi
rm -f ${TMP_PATH}/modules/${KONAME} rm -f ${TMP_PATH}/modules/${KONAME}
if [ "${KERNEL}" == "custom" ]; then if [ "${KERNEL}" = "custom" ]; then
tar -zcf "${CUSTOM_PATH}/modules-${PLATFORM}-${KVER}.tgz" -C "${TMP_PATH}/modules" . tar -zcf "${CUSTOM_PATH}/modules-${PLATFORM}-${KVER}.tgz" -C "${TMP_PATH}/modules" .
else else
tar -zcf "${MODULES_PATH}/${PLATFORM}-${KVER}.tgz" -C "${TMP_PATH}/modules" . tar -zcf "${MODULES_PATH}/${PLATFORM}-${KVER}.tgz" -C "${TMP_PATH}/modules" .
@ -174,7 +174,7 @@ function getdepends() {
rm -rf "${TMP_PATH}/modules" rm -rf "${TMP_PATH}/modules"
mkdir -p "${TMP_PATH}/modules" mkdir -p "${TMP_PATH}/modules"
local KERNEL="$(readConfigKey "kernel" "${USER_CONFIG_FILE}")" local KERNEL="$(readConfigKey "kernel" "${USER_CONFIG_FILE}")"
if [ "${KERNEL}" == "custom" ]; then if [ "${KERNEL}" = "custom" ]; then
tar -zxf "${CUSTOM_PATH}/modules-${PLATFORM}-${KVER}.tgz" -C "${TMP_PATH}/modules" tar -zxf "${CUSTOM_PATH}/modules-${PLATFORM}-${KVER}.tgz" -C "${TMP_PATH}/modules"
else else
tar -zxf "${MODULES_PATH}/${PLATFORM}-${KVER}.tgz" -C "${TMP_PATH}/modules" tar -zxf "${MODULES_PATH}/${PLATFORM}-${KVER}.tgz" -C "${TMP_PATH}/modules"

View File

@ -5,19 +5,19 @@ function getnet() {
ARCPATCH="$(readConfigKey "arc.patch" "${USER_CONFIG_FILE}")" ARCPATCH="$(readConfigKey "arc.patch" "${USER_CONFIG_FILE}")"
NICPORTS="$(readConfigKey "${MODEL}.ports" "${S_FILE}" 2>/dev/null)" NICPORTS="$(readConfigKey "${MODEL}.ports" "${S_FILE}" 2>/dev/null)"
ETHN=$(echo ${ETHX} | wc -w) ETHN=$(echo ${ETHX} | wc -w)
if [ "${ARCPATCH}" == "true" ]; then if [ "${ARCPATCH}" = "true" ]; then
MACS=($(generateMacAddress "${MODEL}" "${ETHN}" "true")) MACS=($(generateMacAddress "${MODEL}" "${ETHN}" "true"))
for I in $(seq 1 ${ETHN}); do for I in $(seq 1 ${ETHN}); do
eval MAC${I}="${MACS[$((${I} - 1))]}" eval MAC${I}="${MACS[$((${I} - 1))]}"
writeConfigKey "eth$((${I} - 1))" "${MACS[$((${I} - 1))]}" "${USER_CONFIG_FILE}" writeConfigKey "eth$((${I} - 1))" "${MACS[$((${I} - 1))]}" "${USER_CONFIG_FILE}"
done done
elif [ "${ARCPATCH}" == "false" ]; then elif [ "${ARCPATCH}" = "false" ]; then
MACS=($(generateMacAddress "${MODEL}" "${ETHN}" "false")) MACS=($(generateMacAddress "${MODEL}" "${ETHN}" "false"))
for I in $(seq 1 ${ETHN}); do for I in $(seq 1 ${ETHN}); do
eval MAC${I}="${MACS[$((${I} - 1))]}" eval MAC${I}="${MACS[$((${I} - 1))]}"
writeConfigKey "eth$((${I} - 1))" "${MACS[$((${I} - 1))]}" "${USER_CONFIG_FILE}" writeConfigKey "eth$((${I} - 1))" "${MACS[$((${I} - 1))]}" "${USER_CONFIG_FILE}"
done done
elif [ "${ARCPATCH}" == "user" ]; then elif [ "${ARCPATCH}" = "user" ]; then
# User Mac # User Mac
for N in ${ETHX}; do for N in ${ETHX}; do
while true; do while true; do

View File

@ -122,13 +122,13 @@ function getmap() {
if [ $(lspci -d ::106 | wc -l) -gt 0 ]; then if [ $(lspci -d ::106 | wc -l) -gt 0 ]; then
LASTDRIVE=0 LASTDRIVE=0
while read -r D; do while read -r D; do
if [ "${BUS}" == "sata" ] && [ "${MACHINE}" != "Native" ] && [ ${D} -eq 0 ]; then if [ "${BUS}" = "sata" ] && [ "${MACHINE}" != "Native" ] && [ ${D} -eq 0 ]; then
MAXDISKS=${DRIVES} MAXDISKS=${DRIVES}
echo -n "${D}>${MAXDISKS}:">>"${TMP_PATH}/remap" echo -n "${D}>${MAXDISKS}:">>"${TMP_PATH}/remap"
elif [ ${D} != ${LASTDRIVE} ]; then elif [ ${D} != ${LASTDRIVE} ]; then
echo -n "${D}>${LASTDRIVE}:">>"${TMP_PATH}/remap" echo -n "${D}>${LASTDRIVE}:">>"${TMP_PATH}/remap"
LASTDRIVE=$((${LASTDRIVE} + 1)) LASTDRIVE=$((${LASTDRIVE} + 1))
elif [ ${D} == ${LASTDRIVE} ]; then elif [ ${D} = ${LASTDRIVE} ]; then
LASTDRIVE=$((${D} + 1)) LASTDRIVE=$((${D} + 1))
fi fi
done < <(cat "${TMP_PATH}/ports") done < <(cat "${TMP_PATH}/ports")
@ -142,17 +142,17 @@ function getmapSelection() {
SATAREMAP="$(awk '{print $1}' "${TMP_PATH}/remap" | sed 's/.$//')" SATAREMAP="$(awk '{print $1}' "${TMP_PATH}/remap" | sed 's/.$//')"
EXTERNALCONTROLLER="$(readConfigKey "device.externalcontroller" "${USER_CONFIG_FILE}")" EXTERNALCONTROLLER="$(readConfigKey "device.externalcontroller" "${USER_CONFIG_FILE}")"
ARCMODE="$(readConfigKey "arc.mode" "${USER_CONFIG_FILE}")" ARCMODE="$(readConfigKey "arc.mode" "${USER_CONFIG_FILE}")"
if [ "${ARCMODE}" == "config" ]; then if [ "${ARCMODE}" = "config" ]; then
# Show recommended Option to user # Show recommended Option to user
if [ -n "${SATAREMAP}" ] && [ "${EXTERNALCONTROLLER}" == "true" ] && [ "${MACHINE}" == "Native" ]; then if [ -n "${SATAREMAP}" ] && [ "${EXTERNALCONTROLLER}" = "true" ] && [ "${MACHINE}" = "Native" ]; then
REMAP2="*" REMAP2="*"
elif [ -n "${SATAREMAP}" ] && [ "${EXTERNALCONTROLLER}" == "false" ]; then elif [ -n "${SATAREMAP}" ] && [ "${EXTERNALCONTROLLER}" = "false" ]; then
REMAP3="*" REMAP3="*"
else else
REMAP1="*" REMAP1="*"
fi fi
# Ask for Portmap # Ask for Portmap
if [ "${STEP}" == "storagemap" ]; then if [ "${STEP}" = "storagemap" ]; then
dialog --backtitle "$(backtitlep)" --title "Sata Portmap" \ dialog --backtitle "$(backtitlep)" --title "Sata Portmap" \
--menu "Choose a Portmap for Sata!?\n* Recommended Option" 8 60 0 \ --menu "Choose a Portmap for Sata!?\n* Recommended Option" 8 60 0 \
1 "DiskIdxMap: Active Ports ${REMAP1}" \ 1 "DiskIdxMap: Active Ports ${REMAP1}" \
@ -190,9 +190,9 @@ function getmapSelection() {
fi fi
else else
# Show recommended Option to user # Show recommended Option to user
if [ -n "${SATAREMAP}" ] && [ "${EXTERNALCONTROLLER}" == "true" ] && [ "${MACHINE}" == "Native" ]; then if [ -n "${SATAREMAP}" ] && [ "${EXTERNALCONTROLLER}" = "true" ] && [ "${MACHINE}" = "Native" ]; then
writeConfigKey "arc.remap" "maxports" "${USER_CONFIG_FILE}" writeConfigKey "arc.remap" "maxports" "${USER_CONFIG_FILE}"
elif [ -n "${SATAREMAP}" ] && [ "${EXTERNALCONTROLLER}" == "false" ]; then elif [ -n "${SATAREMAP}" ] && [ "${EXTERNALCONTROLLER}" = "false" ]; then
writeConfigKey "arc.remap" "remap" "${USER_CONFIG_FILE}" writeConfigKey "arc.remap" "remap" "${USER_CONFIG_FILE}"
else else
writeConfigKey "arc.remap" "acports" "${USER_CONFIG_FILE}" writeConfigKey "arc.remap" "acports" "${USER_CONFIG_FILE}"
@ -201,27 +201,27 @@ function getmapSelection() {
# Check Remap for correct config # Check Remap for correct config
REMAP="$(readConfigKey "arc.remap" "${USER_CONFIG_FILE}")" REMAP="$(readConfigKey "arc.remap" "${USER_CONFIG_FILE}")"
# Write Map to config and show Map to User # Write Map to config and show Map to User
if [ "${REMAP}" == "acports" ]; then if [ "${REMAP}" = "acports" ]; then
writeConfigKey "cmdline.SataPortMap" "${SATAPORTMAP}" "${USER_CONFIG_FILE}" writeConfigKey "cmdline.SataPortMap" "${SATAPORTMAP}" "${USER_CONFIG_FILE}"
writeConfigKey "cmdline.DiskIdxMap" "${DISKIDXMAP}" "${USER_CONFIG_FILE}" writeConfigKey "cmdline.DiskIdxMap" "${DISKIDXMAP}" "${USER_CONFIG_FILE}"
deleteConfigKey "cmdline.sata_remap" "${USER_CONFIG_FILE}" deleteConfigKey "cmdline.sata_remap" "${USER_CONFIG_FILE}"
deleteConfigKey "cmdline.ahci_remap" "${USER_CONFIG_FILE}" deleteConfigKey "cmdline.ahci_remap" "${USER_CONFIG_FILE}"
elif [ "${REMAP}" == "maxports" ]; then elif [ "${REMAP}" = "maxports" ]; then
writeConfigKey "cmdline.SataPortMap" "${SATAPORTMAPMAX}" "${USER_CONFIG_FILE}" writeConfigKey "cmdline.SataPortMap" "${SATAPORTMAPMAX}" "${USER_CONFIG_FILE}"
writeConfigKey "cmdline.DiskIdxMap" "${DISKIDXMAPMAX}" "${USER_CONFIG_FILE}" writeConfigKey "cmdline.DiskIdxMap" "${DISKIDXMAPMAX}" "${USER_CONFIG_FILE}"
deleteConfigKey "cmdline.sata_remap" "${USER_CONFIG_FILE}" deleteConfigKey "cmdline.sata_remap" "${USER_CONFIG_FILE}"
deleteConfigKey "cmdline.ahci_remap" "${USER_CONFIG_FILE}" deleteConfigKey "cmdline.ahci_remap" "${USER_CONFIG_FILE}"
elif [ "${REMAP}" == "remap" ]; then elif [ "${REMAP}" = "remap" ]; then
writeConfigKey "cmdline.sata_remap" "${SATAREMAP}" "${USER_CONFIG_FILE}" writeConfigKey "cmdline.sata_remap" "${SATAREMAP}" "${USER_CONFIG_FILE}"
deleteConfigKey "cmdline.DiskIdxMap" "${USER_CONFIG_FILE}" deleteConfigKey "cmdline.DiskIdxMap" "${USER_CONFIG_FILE}"
deleteConfigKey "cmdline.SataPortMap" "${USER_CONFIG_FILE}" deleteConfigKey "cmdline.SataPortMap" "${USER_CONFIG_FILE}"
deleteConfigKey "cmdline.ahci_remap" "${USER_CONFIG_FILE}" deleteConfigKey "cmdline.ahci_remap" "${USER_CONFIG_FILE}"
elif [ "${REMAP}" == "ahci" ]; then elif [ "${REMAP}" = "ahci" ]; then
writeConfigKey "cmdline.ahci_remap" "${SATAREMAP}" "${USER_CONFIG_FILE}" writeConfigKey "cmdline.ahci_remap" "${SATAREMAP}" "${USER_CONFIG_FILE}"
deleteConfigKey "cmdline.DiskIdxMap" "${USER_CONFIG_FILE}" deleteConfigKey "cmdline.DiskIdxMap" "${USER_CONFIG_FILE}"
deleteConfigKey "cmdline.SataPortMap" "${USER_CONFIG_FILE}" deleteConfigKey "cmdline.SataPortMap" "${USER_CONFIG_FILE}"
deleteConfigKey "cmdline.sata_remap" "${USER_CONFIG_FILE}" deleteConfigKey "cmdline.sata_remap" "${USER_CONFIG_FILE}"
elif [ "${REMAP}" == "user" ]; then elif [ "${REMAP}" = "user" ]; then
deleteConfigKey "cmdline.SataPortMap" "${USER_CONFIG_FILE}" deleteConfigKey "cmdline.SataPortMap" "${USER_CONFIG_FILE}"
deleteConfigKey "cmdline.DiskIdxMap" "${USER_CONFIG_FILE}" deleteConfigKey "cmdline.DiskIdxMap" "${USER_CONFIG_FILE}"
deleteConfigKey "cmdline.sata_remap" "${USER_CONFIG_FILE}" deleteConfigKey "cmdline.sata_remap" "${USER_CONFIG_FILE}"

View File

@ -10,7 +10,7 @@ function updateLoader() {
if [ -z "${TAG}" ]; then if [ -z "${TAG}" ]; then
idx=0 idx=0
while [ ${idx} -le 5 ]; do # Loop 5 times, if successful, break while [ ${idx} -le 5 ]; do # Loop 5 times, if successful, break
if [ "${ARC_BRANCH}" == "dev" ]; then if [ "${ARC_BRANCH}" = "dev" ]; then
local TAG="$(curl -m 10 -skL "https://api.github.com/repos/AuxXxilium/arc/releases" | jq -r ".[].tag_name" | grep "dev" | sort -rV | head -1)" local TAG="$(curl -m 10 -skL "https://api.github.com/repos/AuxXxilium/arc/releases" | jq -r ".[].tag_name" | grep "dev" | sort -rV | head -1)"
else else
local TAG="$(curl -m 10 -skL "https://api.github.com/repos/AuxXxilium/arc/releases" | jq -r ".[].tag_name" | grep -v "dev" | sort -rV | head -1)" local TAG="$(curl -m 10 -skL "https://api.github.com/repos/AuxXxilium/arc/releases" | jq -r ".[].tag_name" | grep -v "dev" | sort -rV | head -1)"
@ -34,7 +34,7 @@ function updateLoader() {
s/ /\xa0/g; s/ /\xa0/g;
if ($. <= 3) { if ($. <= 3) {
$header .= "$_\n"; $header .= "$_\n";
$/ = "\r" if $. == 2 $/ = "\r" if $. = 2
} else { } else {
print "XXX\n$pcent\n$header$_\nXXX" print "XXX\n$pcent\n$header$_\nXXX"
}' | }' |
@ -49,7 +49,7 @@ function updateLoader() {
--infobox "Update successful!" 3 50 --infobox "Update successful!" 3 50
sleep 2 sleep 2
else else
if [ "${ARCMODE}" == "update" ]; then if [ "${ARCMODE}" = "update" ]; then
dialog --backtitle "$(backtitle)" --title "Update Loader" --aspect 18 \ dialog --backtitle "$(backtitle)" --title "Update Loader" --aspect 18 \
--infobox "Update failed!\nTry again later." 0 0 --infobox "Update failed!\nTry again later." 0 0
sleep 3 sleep 3
@ -59,7 +59,7 @@ function updateLoader() {
fi fi
fi fi
else else
if [ "${ARCMODE}" == "update" ]; then if [ "${ARCMODE}" = "update" ]; then
dialog --backtitle "$(backtitle)" --title "Update Loader" --aspect 18 \ dialog --backtitle "$(backtitle)" --title "Update Loader" --aspect 18 \
--infobox "Update failed!\nTry again later." 0 0 --infobox "Update failed!\nTry again later." 0 0
sleep 3 sleep 3
@ -70,7 +70,7 @@ function updateLoader() {
fi fi
fi fi
[ -n "${ARCCONF}" ] && cp -f "${TMP_PATH}/bak.yml" "${S_FILE}" [ -n "${ARCCONF}" ] && cp -f "${TMP_PATH}/bak.yml" "${S_FILE}"
if [ "${ARCMODE}" == "update" ] && [ "${CONFDONE}" == "true" ]; then if [ "${ARCMODE}" = "update" ] && [ "${CONFDONE}" = "true" ]; then
dialog --backtitle "$(backtitle)" --title "Update Loader" --aspect 18 \ dialog --backtitle "$(backtitle)" --title "Update Loader" --aspect 18 \
--infobox "Update successful! -> Reboot to automated Build Mode..." 3 60 --infobox "Update successful! -> Reboot to automated Build Mode..." 3 60
sleep 3 sleep 3
@ -110,7 +110,7 @@ function updateAddons() {
s/ /\xa0/g; s/ /\xa0/g;
if ($. <= 3) { if ($. <= 3) {
$header .= "$_\n"; $header .= "$_\n";
$/ = "\r" if $. == 2 $/ = "\r" if $. = 2
} else { } else {
print "XXX\n$pcent\n$header$_\nXXX" print "XXX\n$pcent\n$header$_\nXXX"
}' | }' |
@ -169,7 +169,7 @@ function updatePatches() {
s/ /\xa0/g; s/ /\xa0/g;
if ($. <= 3) { if ($. <= 3) {
$header .= "$_\n"; $header .= "$_\n";
$/ = "\r" if $. == 2 $/ = "\r" if $. = 2
} else { } else {
print "XXX\n$pcent\n$header$_\nXXX" print "XXX\n$pcent\n$header$_\nXXX"
}' | }' |
@ -221,7 +221,7 @@ function updateCustom() {
s/ /\xa0/g; s/ /\xa0/g;
if ($. <= 3) { if ($. <= 3) {
$header .= "$_\n"; $header .= "$_\n";
$/ = "\r" if $. == 2 $/ = "\r" if $. = 2
} else { } else {
print "XXX\n$pcent\n$header$_\nXXX" print "XXX\n$pcent\n$header$_\nXXX"
}' | }' |
@ -255,7 +255,7 @@ function updateModules() {
local PRODUCTVER="$(readConfigKey "productver" "${USER_CONFIG_FILE}")" local PRODUCTVER="$(readConfigKey "productver" "${USER_CONFIG_FILE}")"
local PLATFORM="$(readConfigKey "platform" "${USER_CONFIG_FILE}")" local PLATFORM="$(readConfigKey "platform" "${USER_CONFIG_FILE}")"
local KVER="$(readConfigKey "platforms.${PLATFORM}.productvers.\"${PRODUCTVER}\".kver" "${P_FILE}")" local KVER="$(readConfigKey "platforms.${PLATFORM}.productvers.\"${PRODUCTVER}\".kver" "${P_FILE}")"
[ "${PLATFORM}" == "epyc7002" ] && KVERP="${PRODUCTVER}-${KVER}" || KVERP="${KVER}" [ "${PLATFORM}" = "epyc7002" ] && KVERP="${PRODUCTVER}-${KVER}" || KVERP="${KVER}"
idx=0 idx=0
while [ ${idx} -le 5 ]; do # Loop 5 times, if successful, break while [ ${idx} -le 5 ]; do # Loop 5 times, if successful, break
local TAG="$(curl -m 10 -skL "https://api.github.com/repos/AuxXxilium/arc-modules/releases" | jq -r ".[].tag_name" | sort -rV | head -1)" local TAG="$(curl -m 10 -skL "https://api.github.com/repos/AuxXxilium/arc-modules/releases" | jq -r ".[].tag_name" | sort -rV | head -1)"
@ -279,7 +279,7 @@ function updateModules() {
s/ /\xa0/g; s/ /\xa0/g;
if ($. <= 3) { if ($. <= 3) {
$header .= "$_\n"; $header .= "$_\n";
$/ = "\r" if $. == 2 $/ = "\r" if $. = 2
} else { } else {
print "XXX\n$pcent\n$header$_\nXXX" print "XXX\n$pcent\n$header$_\nXXX"
}' | }' |
@ -346,7 +346,7 @@ function updateConfigs() {
s/ /\xa0/g; s/ /\xa0/g;
if ($. <= 3) { if ($. <= 3) {
$header .= "$_\n"; $header .= "$_\n";
$/ = "\r" if $. == 2 $/ = "\r" if $. = 2
} else { } else {
print "XXX\n$pcent\n$header$_\nXXX" print "XXX\n$pcent\n$header$_\nXXX"
}' | }' |
@ -402,7 +402,7 @@ function updateLKMs() {
s/ /\xa0/g; s/ /\xa0/g;
if ($. <= 3) { if ($. <= 3) {
$header .= "$_\n"; $header .= "$_\n";
$/ = "\r" if $. == 2 $/ = "\r" if $. = 2
} else { } else {
print "XXX\n$pcent\n$header$_\nXXX" print "XXX\n$pcent\n$header$_\nXXX"
}' | }' |
@ -461,11 +461,11 @@ function dependenciesUpdate() {
[ $? -ne 0 ] && FAILED="true" [ $? -ne 0 ] && FAILED="true"
updateOffline updateOffline
[ $? -ne 0 ] && FAILED="true" [ $? -ne 0 ] && FAILED="true"
if [ "${FAILED}" == "true" ]; then if [ "${FAILED}" = "true" ]; then
dialog --backtitle "$(backtitle)" --title "Update Dependencies" --aspect 18 \ dialog --backtitle "$(backtitle)" --title "Update Dependencies" --aspect 18 \
--infobox "Update failed! Try again later." 3 40 --infobox "Update failed! Try again later." 3 40
sleep 3 sleep 3
elif [ "${FAILED}" == "false" ]; then elif [ "${FAILED}" = "false" ]; then
dialog --backtitle "$(backtitle)" --title "Update Dependencies" --aspect 18 \ dialog --backtitle "$(backtitle)" --title "Update Dependencies" --aspect 18 \
--infobox "Update successful!" 3 40 --infobox "Update successful!" 3 40
writeConfigKey "arc.builddone" "false" "${USER_CONFIG_FILE}" writeConfigKey "arc.builddone" "false" "${USER_CONFIG_FILE}"

View File

@ -112,8 +112,8 @@ for N in ${ETHX}; do
fi fi
sleep 1 sleep 1
fi fi
[ "${N::3}" == "eth" ] && ethtool -s ${N} wol g 2>/dev/null || true [ "${N::3}" = "eth" ] && ethtool -s ${N} wol g 2>/dev/null || true
# [ "${N::3}" == "eth" ] && ethtool -K ${N} rxhash off 2>/dev/null || true # [ "${N::3}" = "eth" ] && ethtool -K ${N} rxhash off 2>/dev/null || true
initConfigKey "${N}" "${MACR}" "${USER_CONFIG_FILE}" initConfigKey "${N}" "${MACR}" "${USER_CONFIG_FILE}"
done done
ETHN=$(echo ${ETHX} | wc -w) ETHN=$(echo ${ETHX} | wc -w)
@ -127,7 +127,7 @@ VID="0x46f4"
PID="0x0001" PID="0x0001"
BUSLIST="usb sata sas scsi nvme mmc ide virtio vmbus xen" BUSLIST="usb sata sas scsi nvme mmc ide virtio vmbus xen"
if [ "${BUS}" == "usb" ]; then if [ "${BUS}" = "usb" ]; then
VID="0x$(udevadm info --query property --name "${LOADER_DISK}" | grep ID_VENDOR_ID | cut -d= -f2)" VID="0x$(udevadm info --query property --name "${LOADER_DISK}" | grep ID_VENDOR_ID | cut -d= -f2)"
PID="0x$(udevadm info --query property --name "${LOADER_DISK}" | grep ID_MODEL_ID | cut -d= -f2)" PID="0x$(udevadm info --query property --name "${LOADER_DISK}" | grep ID_MODEL_ID | cut -d= -f2)"
elif ! echo "${BUSLIST}" | grep -wq "${BUS}"; then elif ! echo "${BUSLIST}" | grep -wq "${BUS}"; then
@ -146,13 +146,13 @@ writeConfigKey "pid" "${PID}" "${USER_CONFIG_FILE}"
# Decide if boot automatically # Decide if boot automatically
BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")" BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")"
ARCMODE="$(readConfigKey "arc.mode" "${USER_CONFIG_FILE}")" ARCMODE="$(readConfigKey "arc.mode" "${USER_CONFIG_FILE}")"
if [ "${ARCMODE}" == "config" ]; then if [ "${ARCMODE}" = "config" ]; then
echo -e "\033[1;34mStarting Config Mode...\033[0m" echo -e "\033[1;34mStarting Config Mode...\033[0m"
elif [ "${ARCMODE}" == "automated" ]; then elif [ "${ARCMODE}" = "automated" ]; then
echo -e "\033[1;34mStarting automated Build Mode...\033[0m" echo -e "\033[1;34mStarting automated Build Mode...\033[0m"
elif [ "${ARCMODE}" == "update" ]; then elif [ "${ARCMODE}" = "update" ]; then
echo -e "\033[1;34mStarting Update Mode...\033[0m" echo -e "\033[1;34mStarting Update Mode...\033[0m"
elif [ "${BUILDDONE}" == "true" ] && [ "${ARCMODE}" == "dsm" ]; then elif [ "${BUILDDONE}" = "true" ] && [ "${ARCMODE}" = "dsm" ]; then
echo -e "\033[1;34mStarting DSM Mode...\033[0m" echo -e "\033[1;34mStarting DSM Mode...\033[0m"
if [ -f "${ARC_PATH}/boot.sh" ]; then if [ -f "${ARC_PATH}/boot.sh" ]; then
exec boot.sh && exit 0 exec boot.sh && exit 0

View File

@ -43,8 +43,8 @@ ARCBRANCH="$(readConfigKey "arc.branch" "${USER_CONFIG_FILE}")"
PAT_URL="$(readConfigKey "paturl" "${USER_CONFIG_FILE}")" PAT_URL="$(readConfigKey "paturl" "${USER_CONFIG_FILE}")"
PAT_HASH="$(readConfigKey "pathash" "${USER_CONFIG_FILE}")" PAT_HASH="$(readConfigKey "pathash" "${USER_CONFIG_FILE}")"
[ "${PATURL:0:1}" == "#" ] && PATURL="" [ "${PATURL:0:1}" = "#" ] && PATURL=""
[ "${PATSUM:0:1}" == "#" ] && PATSUM="" [ "${PATSUM:0:1}" = "#" ] && PATSUM=""
# Check if DSM Version changed # Check if DSM Version changed
. "${RAMDISK_PATH}/etc/VERSION" . "${RAMDISK_PATH}/etc/VERSION"
@ -67,7 +67,7 @@ writeConfigKey "smallnum" "${SMALLNUM}" "${USER_CONFIG_FILE}"
KVER="$(readConfigKey "platforms.${PLATFORM}.productvers.\"${PRODUCTVER}\".kver" "${P_FILE}")" KVER="$(readConfigKey "platforms.${PLATFORM}.productvers.\"${PRODUCTVER}\".kver" "${P_FILE}")"
# Modify KVER for Epyc7002 # Modify KVER for Epyc7002
[ "${PLATFORM}" == "epyc7002" ] && KVERP="${PRODUCTVER}-${KVER}" || KVERP="${KVER}" [ "${PLATFORM}" = "epyc7002" ] && KVERP="${PRODUCTVER}-${KVER}" || KVERP="${KVER}"
# Sanity check # Sanity check
if [ -z "${PLATFORM}" ] || [ -z "${KVER}" ]; then if [ -z "${PLATFORM}" ] || [ -z "${KVER}" ]; then
@ -168,7 +168,7 @@ chmod +x "${RAMDISK_PATH}/addons/addons.sh"
# System Addons # System Addons
for ADDON in "redpill" "revert" "misc" "eudev" "disks" "localrss" "notify" "wol" "mountloader"; do for ADDON in "redpill" "revert" "misc" "eudev" "disks" "localrss" "notify" "wol" "mountloader"; do
PARAMS="" PARAMS=""
if [ "${ADDON}" == "disks" ]; then if [ "${ADDON}" = "disks" ]; then
HDDSORT="$(readConfigKey "hddsort" "${USER_CONFIG_FILE}")" HDDSORT="$(readConfigKey "hddsort" "${USER_CONFIG_FILE}")"
USBMOUNT="$(readConfigKey "usbmount" "${USER_CONFIG_FILE}")" USBMOUNT="$(readConfigKey "usbmount" "${USER_CONFIG_FILE}")"
PARAMS="${HDDSORT} ${USBMOUNT}" PARAMS="${HDDSORT} ${USBMOUNT}"
@ -190,7 +190,7 @@ echo "inetd" >>"${RAMDISK_PATH}/addons/addons.sh"
echo "Modify files" >"${LOG_FILE}" echo "Modify files" >"${LOG_FILE}"
# Remove function from scripts # Remove function from scripts
[ "2" == "${PRODUCTVER:0:1}" ] && sed -i 's/function //g' $(find "${RAMDISK_PATH}/addons/" -type f -name "*.sh") [ "2" = "${PRODUCTVER:0:1}" ] && sed -i 's/function //g' $(find "${RAMDISK_PATH}/addons/" -type f -name "*.sh")
# Build modules dependencies # Build modules dependencies
# ${ARC_PATH}/depmod -a -b ${RAMDISK_PATH} 2>/dev/null # ${ARC_PATH}/depmod -a -b ${RAMDISK_PATH} 2>/dev/null
@ -228,14 +228,14 @@ for N in $(seq 0 7); do
done done
# SA6400 patches # SA6400 patches
if [ "${PLATFORM}" == "epyc7002" ]; then if [ "${PLATFORM}" = "epyc7002" ]; then
echo -n " - Apply Epyc7002 Fixes" echo -n " - Apply Epyc7002 Fixes"
sed -i 's#/dev/console#/var/log/lrc#g' ${RAMDISK_PATH}/usr/bin/busybox sed -i 's#/dev/console#/var/log/lrc#g' ${RAMDISK_PATH}/usr/bin/busybox
sed -i '/^echo "START/a \\nmknod -m 0666 /dev/console c 1 3' ${RAMDISK_PATH}/linuxrc.syno sed -i '/^echo "START/a \\nmknod -m 0666 /dev/console c 1 3' ${RAMDISK_PATH}/linuxrc.syno
fi fi
# Broadwellntbap patches # Broadwellntbap patches
if [ "${PLATFORM}" == "broadwellntbap" ]; then if [ "${PLATFORM}" = "broadwellntbap" ]; then
echo -n " - Apply Broadwellntbap Fixes" echo -n " - Apply Broadwellntbap Fixes"
sed -i 's/IsUCOrXA="yes"/XIsUCOrXA="yes"/g; s/IsUCOrXA=yes/XIsUCOrXA=yes/g' ${RAMDISK_PATH}/usr/syno/share/environments.sh sed -i 's/IsUCOrXA="yes"/XIsUCOrXA="yes"/g; s/IsUCOrXA=yes/XIsUCOrXA=yes/g' ${RAMDISK_PATH}/usr/syno/share/environments.sh
fi fi
@ -247,7 +247,7 @@ for F in $(ls -1 ${USER_UP_PATH}/*.sh 2>/dev/null); do
done done
# Reassembly ramdisk # Reassembly ramdisk
if [ "${RD_COMPRESSED}" == "true" ]; then if [ "${RD_COMPRESSED}" = "true" ]; then
(cd "${RAMDISK_PATH}" && find . 2>/dev/null | cpio -o -H newc -R root:root | xz -9 --format=lzma >"${MOD_RDGZ_FILE}") >"${LOG_FILE}" 2>&1 || exit 1 (cd "${RAMDISK_PATH}" && find . 2>/dev/null | cpio -o -H newc -R root:root | xz -9 --format=lzma >"${MOD_RDGZ_FILE}") >"${LOG_FILE}" 2>&1 || exit 1
else else
(cd "${RAMDISK_PATH}" && find . 2>/dev/null | cpio -o -H newc -R root:root >"${MOD_RDGZ_FILE}") >"${LOG_FILE}" 2>&1 || exit 1 (cd "${RAMDISK_PATH}" && find . 2>/dev/null | cpio -o -H newc -R root:root >"${MOD_RDGZ_FILE}") >"${LOG_FILE}" 2>&1 || exit 1

View File

@ -12,13 +12,13 @@ set -o pipefail # Get exit code from process piped
rm -f "${MOD_ZIMAGE_FILE}" rm -f "${MOD_ZIMAGE_FILE}"
KERNEL="$(readConfigKey "kernel" "${USER_CONFIG_FILE}")" KERNEL="$(readConfigKey "kernel" "${USER_CONFIG_FILE}")"
if [ "${KERNEL}" == "custom" ]; then if [ "${KERNEL}" = "custom" ]; then
echo -n " - Using customized Kernel" echo -n " - Using customized Kernel"
PLATFORM="$(readConfigKey "platform" "${USER_CONFIG_FILE}")" PLATFORM="$(readConfigKey "platform" "${USER_CONFIG_FILE}")"
PRODUCTVER="$(readConfigKey "productver" "${USER_CONFIG_FILE}")" PRODUCTVER="$(readConfigKey "productver" "${USER_CONFIG_FILE}")"
KVER="$(readConfigKey "platforms.${PLATFORM}.productvers.\"${PRODUCTVER}\".kver" "${P_FILE}")" KVER="$(readConfigKey "platforms.${PLATFORM}.productvers.\"${PRODUCTVER}\".kver" "${P_FILE}")"
# Modify KVER for Epyc7002 # Modify KVER for Epyc7002
[ "${PLATFORM}" == "epyc7002" ] && KVERP="${PRODUCTVER}-${KVER}" || KVERP="${KVER}" [ "${PLATFORM}" = "epyc7002" ] && KVERP="${PRODUCTVER}-${KVER}" || KVERP="${KVER}"
# Extract bzImage # Extract bzImage
gzip -dc "${CUSTOM_PATH}/bzImage-${PLATFORM}-${KVERP}.gz" >"${MOD_ZIMAGE_FILE}" gzip -dc "${CUSTOM_PATH}/bzImage-${PLATFORM}-${KVERP}.gz" >"${MOD_ZIMAGE_FILE}"
else else