Compare commits

...

53 Commits

Author SHA1 Message Date
AuxXxilium
7f9df8f7d7 Merge pull request #4738 from AuxXxilium/dev
Dev
2024-11-17 16:48:34 +01:00
AuxXxilium
902db23960 arc: add warning if arc patch failed
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-17 16:48:17 +01:00
AuxXxilium
2c2286e651 arc: don't show online functions if loader is offline
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-17 16:42:46 +01:00
AuxXxilium
f317e4996a Merge pull request #4737 from AuxXxilium/dev
arc: reinit loader after restore config
2024-11-17 16:40:47 +01:00
AuxXxilium
d274d528bb arc: reinit loader after restore config
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-17 16:40:17 +01:00
AuxXxilium
8011ef1c65 Merge pull request #4736 from AuxXxilium/dev
arc: fix restore from online
2024-11-17 16:38:50 +01:00
AuxXxilium
dabbd3ff81 arc: fix restore from online
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-17 16:38:27 +01:00
AuxXxilium
7eff3975a6 Merge pull request #4735 from AuxXxilium/dev
Dev
2024-11-17 16:24:50 +01:00
AuxXxilium
b2538b24ef tree: cleanup
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-17 16:22:53 +01:00
AuxXxilium
c4ff1ecf1e arc: remove some warnings
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-17 16:17:59 +01:00
AuxXxilium
e218db8511 arc: fix logic
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-16 23:17:59 +01:00
AuxXxilium
8c22d11c49 tree: cleanup
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-16 22:58:57 +01:00
AuxXxilium
422c07be60 Merge pull request #4723 from AuxXxilium/dev
Dev
2024-11-16 22:42:18 +01:00
AuxXxilium
71e7eba6f3 arc: change false message
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-16 22:42:00 +01:00
AuxXxilium
5f030c2349 tree: add some sanity check
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-16 21:53:43 +01:00
AuxXxilium
5fa2c3a1c6 arc: cleanup more
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-16 20:43:46 +01:00
AuxXxilium
c8a6e0e710 Merge pull request #4720 from AuxXxilium/dev
Dev
2024-11-16 19:03:16 +01:00
AuxXxilium
cf2daa9807 networkdiag: add useridapi check
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-16 19:01:58 +01:00
AuxXxilium
167d909e13 arc-functions: add message for user without a brain
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-16 18:27:12 +01:00
AuxXxilium
b4ebd305bd functions: fix typo
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-16 15:45:11 +01:00
AuxXxilium
f4bbb7c5bb tree: rework more logic
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-16 11:31:31 +01:00
AuxXxilium
390f5b11db tree: cleanup
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-16 10:42:03 +01:00
AuxXxilium
8bc3393d55 functions: move to correct file
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-16 00:35:56 +01:00
AuxXxilium
81f436703a Merge pull request #4691 from AuxXxilium/dev
Dev
2024-11-15 16:11:31 +01:00
AuxXxilium
cee2d7d263 tree: cleanup
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-15 15:46:33 +01:00
AuxXxilium
ab508a9eb5 arc-functions: rename update function
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-15 15:35:27 +01:00
AuxXxilium
16a73afe9d arc-functions: more logic fix
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-15 15:25:43 +01:00
AuxXxilium
c4cc0b779a arc-functions: fix logic
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-15 14:57:03 +01:00
AuxXxilium
1844d5291a Merge pull request #4688 from AuxXxilium/dev
arc-functions: more work
2024-11-15 14:28:36 +01:00
AuxXxilium
601547d9db arc-functions: more work
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-15 14:16:47 +01:00
AuxXxilium
2ec8f3654c Merge pull request #4687 from AuxXxilium/dev
Dev
2024-11-15 14:10:19 +01:00
AuxXxilium
a68b5d446e functions: fix hwid for multiple nic
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-15 14:08:09 +01:00
AuxXxilium
3ccb91be9f arc-functions: rework
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-14 20:42:40 +01:00
AuxXxilium
47020c7e56 Merge pull request #4661 from AuxXxilium/dev
Dev
2024-11-13 23:54:00 +01:00
AuxXxilium
3e010b781a arc: fix copy
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-13 23:53:11 +01:00
AuxXxilium
dcd86a4272 build: fix local
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-13 23:43:24 +01:00
AuxXxilium
c287e33aab arc: fix logic
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-13 18:55:07 +01:00
AuxXxilium
95c1eb6897 tree: rework more
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-13 18:05:58 +01:00
AuxXxilium
fb183e437e build: fix local
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-13 17:23:09 +01:00
AuxXxilium
efca3aaf6d arc-functions: rework id check
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-13 01:20:37 +01:00
AuxXxilium
7e5242349c Merge pull request #4636 from AuxXxilium/dev
arc-functions: fix loop
2024-11-13 00:39:22 +01:00
AuxXxilium
46ec4215d7 arc-functions: fix loop
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-13 00:32:59 +01:00
AuxXxilium
cd40c45fa4 Merge pull request #4630 from AuxXxilium/dev
build: update
2024-11-12 17:02:32 +01:00
AuxXxilium
f44a142d01 build: update
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-12 17:02:13 +01:00
AuxXxilium
62e4b267de Merge pull request #4629 from AuxXxilium/dev
build: fix
2024-11-12 16:51:32 +01:00
AuxXxilium
b036a2aef2 build: fix
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-12 16:51:19 +01:00
AuxXxilium
a2c196f453 Merge pull request #4627 from AuxXxilium/dev
functions: more...
2024-11-12 16:11:25 +01:00
AuxXxilium
afb22a6321 functions: more...
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-12 16:11:05 +01:00
AuxXxilium
5e21346aba Merge pull request #4626 from AuxXxilium/dev
Dev
2024-11-12 16:04:52 +01:00
AuxXxilium
fb938806a2 functions: finalize hwid
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-12 16:02:28 +01:00
AuxXxilium
1bde43ca66 functions: make hwid unique
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-11 21:42:40 +01:00
AuxXxilium
d890c54a1b arc: add more features for online
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-11 21:05:07 +01:00
AuxXxilium
d876d274d4 functions: add new
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-11 18:54:25 +01:00
17 changed files with 595 additions and 491 deletions

View File

@@ -11,7 +11,7 @@ on:
workflow_dispatch:
inputs:
runs:
description: "runs-on (ubuntu-latest / self-hosted)"
description: "runs-on"
type: choice
options:
- ubuntu-latest
@@ -38,7 +38,7 @@ jobs:
# Install Dependencies
- name: Install Dependencies
if: ${{ github.event.inputs.runs == 'ubuntu-latest' }}
if: ${{ inputs.runs == 'ubuntu-latest' }}
run: |
git config --global user.email "info@auxxxilium.tech"
git config --global user.name "AuxXxilium"
@@ -83,13 +83,13 @@ jobs:
# Build incremental
- name: Build Next Image
if: inputs.next == true
if: ${{ inputs.next == true }}
run: |
. scripts/func.sh
# Modify Source File
ARC_BUILD="`date +'%y%m%d'`-dev"
ARC_VERSION="${{ inputs.version }}"
ARC_BUILD="`date +'%y%m%d'`"
ARC_VERSION="${{ inputs.version }}-dev"
ARC_BRANCH="next"
echo "${ARC_BUILD}" >files/p1/ARC-BUILD
echo "${ARC_VERSION}" >files/p1/ARC-VERSION
@@ -139,6 +139,7 @@ jobs:
# Zip image and generate checksum
- name: Pack Next Image
if: ${{ inputs.next == true }}
run: |
if [ -n "${{ env.ARC_VERSION }}" ]; then
zip -9 "arc-${{ env.ARC_VERSION }}-${{ env.ARC_BRANCH }}.img.zip" arc.img
@@ -155,13 +156,13 @@ jobs:
# Build incremental
- name: Build Stable Image
if: inputs.stable == true
if: ${{ inputs.stable }}
run: |
. scripts/func.sh
# Modify Source File
ARC_BUILD="`date +'%y%m%d'`-dev"
ARC_VERSION="${{ inputs.version }}"
ARC_BUILD="`date +'%y%m%d'`"
ARC_VERSION="${{ inputs.version }}-dev"
ARC_BRANCH="stable"
echo "${ARC_BUILD}" >files/p1/ARC-BUILD
echo "${ARC_VERSION}" >files/p1/ARC-VERSION
@@ -211,6 +212,7 @@ jobs:
# Zip image and generate checksum
- name: Pack Stable Image
if: ${{ inputs.stable }}
run: |
if [ -n "${{ env.ARC_VERSION }}" ]; then
zip -9 "arc-${{ env.ARC_VERSION }}-${{ env.ARC_BRANCH }}.img.zip" arc.img
@@ -234,7 +236,8 @@ jobs:
- Development Build
### Information:
- Full Changelog and Arc Patch (Decryption Key) are available in my Discord.
- Full Changelog is available in my Discord
- Discord Account for Arc Patch needed
### Dependencies:
- Addons: ${{ env.ADDONTAG }}

View File

@@ -11,7 +11,7 @@ on:
workflow_dispatch:
inputs:
runs:
description: "runs-on (ubuntu-latest / self-hosted)"
description: "runs-on"
type: choice
options:
- ubuntu-latest
@@ -53,7 +53,7 @@ jobs:
uses: actions/checkout@main
- name: Delete releases and workflows runs
if: ${{ inputs.clean }} == 'true'
if: ${{ inputs.clean == true }}
uses: ophub/delete-releases-workflows@main
with:
delete_releases: true
@@ -64,7 +64,7 @@ jobs:
# Install Dependencies
- name: Install Dependencies
if: ${{ github.event.inputs.runs == 'ubuntu-latest' }}
if: ${{ inputs.runs == 'ubuntu-latest' }}
run: |
git config --global user.email "info@auxxxilium.tech"
git config --global user.name "AuxXxilium"
@@ -109,7 +109,7 @@ jobs:
# Build incremental
- name: Build Next Image
if: inputs.next == true
if: ${{ inputs.next == true }}
run: |
. scripts/func.sh
@@ -168,7 +168,7 @@ jobs:
# Zip image and generate checksum
- name: Pack Next Image
if: inputs.next == true
if: ${{ inputs.next == true }}
run: |
if [ -n "${{ env.ARC_VERSION }}" ]; then
zip -9 "arc-${{ env.ARC_VERSION }}-${{ env.ARC_BRANCH }}.img.zip" arc.img
@@ -186,7 +186,7 @@ jobs:
# Build incremental
- name: Build Stable Image
if: inputs.stable == true
if: ${{ inputs.stable == true }}
run: |
. scripts/func.sh
@@ -245,7 +245,7 @@ jobs:
# Zip image and generate checksum
- name: Pack Stable Image
if: inputs.stable == true
if: ${{ inputs.stable == true }}
run: |
if [ -n "${{ env.ARC_VERSION }}" ]; then
zip -9 "arc-${{ env.ARC_VERSION }}-${{ env.ARC_BRANCH }}.img.zip" arc.img
@@ -270,7 +270,8 @@ jobs:
- ${{ inputs.notice }}
### Information:
- Full Changelog and Arc Patch (Decryption Key) are available in my Discord.
- Full Changelog is available in my Discord
- Discord Account for Arc Patch needed
### Versions:
- stable: Stable Image (Full Image, all dependencies are included, less hardware support)

View File

@@ -49,15 +49,15 @@ function addonSelection() {
touch "${TMP_PATH}/opts"
while read -r ADDON DESC; do
arrayExistItem "${ADDON}" "${!ADDONS[@]}" && ACT="on" || ACT="off"
if [[ "${ADDON}" == "amepatch" || "${ADDON}" == "arcdns" ]] && [ -z "${ARCCONF}" ]; then
if [[ "${ADDON}" = "amepatch" || "${ADDON}" = "arcdns" ]] && [ -z "${ARCCONF}" ]; then
continue
elif [ "${ADDON}" == "codecpatch" ] && [ -n "${ARCCONF}" ]; then
elif [ "${ADDON}" = "codecpatch" ] && [ -n "${ARCCONF}" ]; then
continue
else
echo -e "${ADDON} \"${DESC}\" ${ACT}" >>"${TMP_PATH}/opts"
fi
done < <(availableAddons "${PLATFORM}")
if [ "${STEP}" == "addons" ]; then
if [ "${STEP}" = "addons" ]; then
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 \
--file "${TMP_PATH}/opts" 2>"${TMP_PATH}/resp"
@@ -78,7 +78,7 @@ function addonSelection() {
writeConfigKey "addons.\"${ADDON}\"" "" "${USER_CONFIG_FILE}"
done
ADDONSINFO="$(readConfigEntriesArray "addons" "${USER_CONFIG_FILE}")"
if [ "${STEP}" == "addons" ]; then
if [ "${STEP}" = "addons" ]; then
dialog --backtitle "$(backtitlep)" --title "Addons" \
--msgbox "Addons selected:\n${ADDONSINFO}" 7 70
else
@@ -95,7 +95,7 @@ function modulesMenu() {
PLATFORM="$(readConfigKey "platform" "${USER_CONFIG_FILE}")"
KVER="$(readConfigKey "platforms.${PLATFORM}.productvers.\"${PRODUCTVER}\".kver" "${P_FILE}")"
# Modify KVER for Epyc7002
[ "${PLATFORM}" == "epyc7002" ] && KVERP="${PRODUCTVER}-${KVER}" || KVERP="${KVER}"
[ "${PLATFORM}" = "epyc7002" ] && KVERP="${PRODUCTVER}-${KVER}" || KVERP="${KVER}"
# menu loop
while true; do
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
for F in $(ls "${TMP_UP_PATH}" 2>/dev/null); do
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}"
dialog --backtitle "$(backtitle)" --title "External Modules" \
--msgbox "Module: ${USER_FILE}\nadded to ${PLATFORM}-${KVERP}" 7 50
@@ -252,7 +252,7 @@ function modulesMenu() {
KOLIST=($(echo ${KOLIST} | tr ' ' '\n' | sort -u))
while read -r ID DESC; 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 < <(getAllModules "${PLATFORM}" "${KVERP}")
[ ! -d "${USER_UP_PATH}" ] && mkdir -p "${USER_UP_PATH}"
@@ -627,7 +627,7 @@ function keymapMenu() {
# Shows storagepanel menu to user
function storagepanelMenu() {
CONFDONE="$(readConfigKey "arc.confdone" "${USER_CONFIG_FILE}")"
if [ "${CONFDONE}" == "true" ]; then
if [ "${CONFDONE}" = "true" ]; then
while true; do
STORAGEPANELUSER="$(readConfigKey "addons.storagepanel" "${USER_CONFIG_FILE}")"
[ -n "${STORAGEPANELUSER}" ] && DISKPANELUSER="$(echo ${STORAGEPANELUSER} | cut -d' ' -f1)" || DISKPANELUSER="RACK_24_Bay"
@@ -660,7 +660,7 @@ function storagepanelMenu() {
# Shows sequentialIO menu to user
function sequentialIOMenu() {
CONFDONE="$(readConfigKey "arc.confdone" "${USER_CONFIG_FILE}")"
if [ "${CONFDONE}" == "true" ]; then
if [ "${CONFDONE}" = "true" ]; then
while true; do
dialog --backtitle "$(backtitle)" --title "SequentialIO" --cancel-label "Exit" --menu "Choose an Option" 0 0 0 \
1 "Enable for SSD Cache" \
@@ -692,12 +692,24 @@ function sequentialIOMenu() {
# Shows backup menu to user
function backupMenu() {
NEXT="1"
USERID="$(readConfigKey "arc.userid" "${USER_CONFIG_FILE}")"
ARCOFFLINE="$(readConfigKey "arc.offline" "${USER_CONFIG_FILE}")"
while true; do
dialog --backtitle "$(backtitle)" --title "Backup" --cancel-label "Exit" --menu "Choose an Option" 0 0 0 \
1 "Restore Arc Config from DSM" \
2 "Restore HW Encryption Key from DSM" \
3 "Backup HW Encryption Key to DSM" \
2>"${TMP_PATH}/resp"
if [ -n "${USERID}" ] && [ "${ARCOFFLINE}" != "true" ]; then
dialog --backtitle "$(backtitle)" --title "Backup" --cancel-label "Exit" --menu "Choose an Option" 0 0 0 \
1 "Restore Arc Config from DSM" \
2 "Restore HW Encryption Key from DSM" \
3 "Backup HW Encryption Key to DSM" \
4 "Restore Arc Config from Online" \
5 "Backup Arc Config to Online" \
2>"${TMP_PATH}/resp"
else
dialog --backtitle "$(backtitle)" --title "Backup" --cancel-label "Exit" --menu "Choose an Option" 0 0 0 \
1 "Restore Arc Config from DSM" \
2 "Restore HW Encryption Key from DSM" \
3 "Backup HW Encryption Key to DSM" \
2>"${TMP_PATH}/resp"
fi
[ $? -ne 0 ] && break
case "$(cat ${TMP_PATH}/resp)" in
1)
@@ -719,7 +731,7 @@ function backupMenu() {
MODELID="$(readConfigKey "modelid" "${USER_CONFIG_FILE}")"
PRODUCTVER="$(readConfigKey "productver" "${USER_CONFIG_FILE}")"
if [ -n "${MODEL}" ] && [ -n "${PRODUCTVER}" ]; then
TEXT="Installation found:\nModel: ${MODELID:-${MODEL}}\nVersion: ${PRODUCTVER}"
TEXT="Config found:\nModel: ${MODELID:-${MODEL}}\nVersion: ${PRODUCTVER}"
SN="$(readConfigKey "sn" "${USER_CONFIG_FILE}")"
TEXT+="\nSerial: ${SN}"
ARCPATCH="$(readConfigKey "arc.patch" "${USER_CONFIG_FILE}")"
@@ -740,7 +752,7 @@ function backupMenu() {
if [ -n "${PRODUCTVER}" ]; then
PLATFORM="$(readConfigKey "platform" "${USER_CONFIG_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
if [ -n "${PLATFORM}" ] && [ -n "${KVERP}" ]; then
writeConfigKey "modules" "{}" "${USER_CONFIG_FILE}"
@@ -802,7 +814,7 @@ function backupMenu() {
rm -rf "${TMP_PATH}/mdX" >/dev/null
) 2>&1 | dialog --backtitle "$(backtitle)" --title "Backup Encrytion Key" \
--progressbox "Backup Encryption Key ..." 20 70
if [ "${BACKUPKEY}" == "true" ]; then
if [ "${BACKUPKEY}" = "true" ]; then
dialog --backtitle "$(backtitle)" --title "Backup Encrytion Key" \
--msgbox "Encryption Key backup successful!" 0 0
else
@@ -810,6 +822,50 @@ function backupMenu() {
--msgbox "No Encryption Key found!" 0 0
fi
;;
4)
[ -f "${USER_CONFIG_FILE}" ] && mv -f "${USER_CONFIG_FILE}" "${USER_CONFIG_FILE}.bak"
HWID="$(genHWID)"
if curl -skL "https://arc.auxxxilium.tech?cdown=${HWID}" -o "${USER_CONFIG_FILE}" 2>/dev/null; then
dialog --backtitle "$(backtitle)" --title "Online Restore" --msgbox "Online Restore successful!" 5 40
else
dialog --backtitle "$(backtitle)" --title "Online Restore" --msgbox "Online Restore failed!" 5 40
[ -f "${USER_CONFIG_FILE}.bak" ] && mv -f "${USER_CONFIG_FILE}.bak" "${USER_CONFIG_FILE}"
fi
MODEL="$(readConfigKey "model" "${USER_CONFIG_FILE}")"
MODELID="$(readConfigKey "modelid" "${USER_CONFIG_FILE}")"
PRODUCTVER="$(readConfigKey "productver" "${USER_CONFIG_FILE}")"
if [ -n "${MODEL}" ] && [ -n "${PRODUCTVER}" ]; then
TEXT="Config found:\nModel: ${MODELID:-${MODEL}}\nVersion: ${PRODUCTVER}"
SN="$(readConfigKey "sn" "${USER_CONFIG_FILE}")"
TEXT+="\nSerial: ${SN}"
ARCPATCH="$(readConfigKey "arc.patch" "${USER_CONFIG_FILE}")"
TEXT+="\nArc Patch: ${ARCPATCH}"
dialog --backtitle "$(backtitle)" --title "Online Restore" \
--aspect 18 --msgbox "${TEXT}" 0 0
PLATFORM="$(readConfigKey "platform" "${USER_CONFIG_FILE}")"
DT="$(readConfigKey "platforms.${PLATFORM}.dt" "${P_FILE}")"
CONFDONE="$(readConfigKey "arc.confdone" "${USER_CONFIG_FILE}")"
writeConfigKey "arc.builddone" "false" "${USER_CONFIG_FILE}"
BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")"
fi
dialog --backtitle "$(backtitle)" --title "Online Restore" \
--aspect 18 --infobox "Restore successful! -> Reload Arc Init now" 5 50
sleep 2
exec init.sh
;;
5)
if [ -f "${USER_CONFIG_FILE}" ]; then
HWID="$(genHWID)"
curl -sk -X POST -F "file=@${USER_CONFIG_FILE}" "https://arc.auxxxilium.tech?cup=${HWID}&userid=${USERID}" 2>/dev/null
if [ $? -eq 0 ]; then
dialog --backtitle "$(backtitle)" --title "Online Backup" --msgbox "Online Backup successful!" 5 40
else
dialog --backtitle "$(backtitle)" --title "Online Backup" --msgbox "Online Backup failed!" 5 40
fi
else
dialog --backtitle "$(backtitle)" --title "Online Backup" --msgbox "No User Config found!" 5 40
fi
;;
esac
done
}
@@ -824,7 +880,7 @@ function updateMenu() {
--menu "Choose an Option" 0 0 0 \
1 "Update Loader \Z1(no reflash)\Zn" \
2 "Update Dependencies" \
3 "Update Arc Patch" \
3 "Update Configs and Arc Patch" \
4 "Switch Arc Branch: \Z1${ARC_BRANCH}\Zn" \
2>"${TMP_PATH}/resp"
[ $? -ne 0 ] && break
@@ -852,9 +908,10 @@ function updateMenu() {
updateLoader "${TAG}"
;;
2)
updateDependencies
dependenciesUpdate
;;
3)
updateConfigs
checkHardwareID
;;
4)
@@ -887,7 +944,7 @@ function storageMenu() {
DT="$(readConfigKey "platforms.${PLATFORM}.dt" "${P_FILE}")"
# Get Portmap for Loader
getmap
if [ "${DT}" == "false" ] && [ $(lspci -d ::106 | wc -l) -gt 0 ]; then
if [ "${DT}" = "false" ] && [ $(lspci -d ::106 | wc -l) -gt 0 ]; then
getmapSelection
fi
writeConfigKey "arc.builddone" "false" "${USER_CONFIG_FILE}"
@@ -910,15 +967,16 @@ function networkMenu() {
function sysinfo() {
# Get System Informations
[ -d /sys/firmware/efi ] && BOOTSYS="UEFI" || BOOTSYS="BIOS"
USERID="$(readConfigKey "arc.userid" "${USER_CONFIG_FILE}")"
CPU="$(cat /proc/cpuinfo 2>/dev/null | grep 'model name' | uniq | awk -F':' '{print $2}')"
SECURE=$(dmesg 2>/dev/null | grep -i "Secure Boot" | awk -F'] ' '{print $2}')
VENDOR=$(dmesg 2>/dev/null | grep -i "DMI:" | head -1 | sed 's/\[.*\] DMI: //i')
ETHX="$(ls /sys/class/net 2>/dev/null | grep eth)"
ETHN="$(echo ${ETHX} | wc -w)"
ETHX=$(ip -o link show | awk -F': ' '{print $2}' | grep eth)
ETHN=$(echo ${ETHX} | wc -w)
ARC_BRANCH="$(readConfigKey "arc.branch" "${USER_CONFIG_FILE}")"
CONFDONE="$(readConfigKey "arc.confdone" "${USER_CONFIG_FILE}")"
BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")"
if [ "${CONFDONE}" == "true" ]; then
if [ "${CONFDONE}" = "true" ]; then
MODEL="$(readConfigKey "model" "${USER_CONFIG_FILE}")"
MODELID="$(readConfigKey "modelid" "${USER_CONFIG_FILE}")"
PRODUCTVER="$(readConfigKey "productver" "${USER_CONFIG_FILE}")"
@@ -928,18 +986,18 @@ function sysinfo() {
ARCPATCH="$(readConfigKey "arc.patch" "${USER_CONFIG_FILE}")"
ADDONSINFO="$(readConfigEntriesArray "addons" "${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}")"
DISKMAP="$(readConfigKey "cmdline.DiskIdxMap" "${USER_CONFIG_FILE}")"
elif [ "${REMAP}" == "remap" ]; then
elif [ "${REMAP}" = "remap" ]; then
PORTMAP="$(readConfigKey "cmdline.sata_remap" "${USER_CONFIG_FILE}")"
elif [ "${REMAP}" == "ahci" ]; then
elif [ "${REMAP}" = "ahci" ]; then
AHCIPORTMAP="$(readConfigKey "cmdline.ahci_remap" "${USER_CONFIG_FILE}")"
fi
USERCMDLINEINFO="$(readConfigMap "cmdline" "${USER_CONFIG_FILE}")"
USERSYNOINFO="$(readConfigMap "synoinfo" "${USER_CONFIG_FILE}")"
fi
[ "${CONFDONE}" == "true" ] && BUILDNUM="$(readConfigKey "buildnum" "${USER_CONFIG_FILE}")"
[ "${CONFDONE}" = "true" ] && BUILDNUM="$(readConfigKey "buildnum" "${USER_CONFIG_FILE}")"
DIRECTBOOT="$(readConfigKey "directboot" "${USER_CONFIG_FILE}")"
LKM="$(readConfigKey "lkm" "${USER_CONFIG_FILE}")"
KERNELLOAD="$(readConfigKey "kernelload" "${USER_CONFIG_FILE}")"
@@ -974,15 +1032,15 @@ function sysinfo() {
TEXT+="\n Bootdisk: \Zb${LOADER_DISK}\Zn"
TEXT+="\n"
TEXT+="\n\Z4> Network: ${ETHN} NIC\Zn"
for ETH in ${ETHX}; do
for N in ${ETHX}; do
COUNT=0
DRIVER=$(ls -ld /sys/class/net/${ETH}/device/driver 2>/dev/null | awk -F '/' '{print $NF}')
DRIVER=$(ls -ld /sys/class/net/${N}/device/driver 2>/dev/null | awk -F '/' '{print $NF}')
while true; do
if ! ip link show ${ETH} 2>/dev/null | grep -q 'UP'; then
if [ -z "$(cat /sys/class/net/${N}/carrier 2>/dev/null)" ]; then
TEXT+="\n${DRIVER}: \ZbDOWN\Zn"
break
fi
if ethtool ${ETH} 2>/dev/null | grep 'Link detected' | grep -q 'no'; then
if [ "0" = "$(cat /sys/class/net/${N}/carrier 2>/dev/null)" ]; then
TEXT+="\n${DRIVER}: \ZbNOT CONNECTED\Zn"
break
fi
@@ -991,9 +1049,9 @@ function sysinfo() {
break
fi
COUNT=$((${COUNT} + 1))
IP="$(getIP ${ETH})"
IP="$(getIP ${N})"
if [ -n "${IP}" ]; then
SPEED=$(ethtool ${ETH} 2>/dev/null | grep "Speed:" | awk '{print $2}')
SPEED=$(ethtool ${N} 2>/dev/null | grep "Speed:" | awk '{print $2}')
if [[ "${IP}" =~ ^169\.254\..* ]]; then
TEXT+="\n$ {DRIVER} (${SPEED}): \ZbLINK LOCAL (No DHCP server found.)\Zn"
else
@@ -1009,8 +1067,8 @@ function sysinfo() {
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 Version: \Zb${CONFIGVER}\Zn"
[ "${ARCOFFLINE}" == "true" ] && TEXT+="\n Offline Mode: \Zb${ARCOFFLINE}\Zn"
if [ "${CONFDONE}" == "true" ]; then
[ "${ARCOFFLINE}" = "true" ] && TEXT+="\n Offline Mode: \Zb${ARCOFFLINE}\Zn"
if [ "${CONFDONE}" = "true" ]; then
TEXT+="\n\Z4> DSM ${PRODUCTVER} (${BUILDNUM}): ${MODELID:-${MODEL}}\Zn"
TEXT+="\n Kernel | LKM: \Zb${KVER} | ${LKM}\Zn"
TEXT+="\n Platform | DeviceTree: \Zb${PLATFORM} | ${DT}\Zn"
@@ -1023,26 +1081,26 @@ function sysinfo() {
TEXT+="\n Config not completed!\n"
fi
TEXT+="\n Modules loaded: \Zb${MODULESINFO}\Zn"
if [ "${CONFDONE}" == "true" ]; then
if [ "${CONFDONE}" = "true" ]; then
[ -n "${USERCMDLINEINFO}" ] && TEXT+="\n User Cmdline: \Zb${USERCMDLINEINFO}\Zn"
TEXT+="\n User Synoinfo: \Zb${USERSYNOINFO}\Zn"
fi
TEXT+="\n"
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"
elif [ "${REMAP}" == "remap" ]; then
elif [ "${REMAP}" = "remap" ]; then
TEXT+="\n SataRemap: \Zb${PORTMAP}\Zn"
elif [ "${REMAP}" == "ahci" ]; then
elif [ "${REMAP}" = "ahci" ]; then
TEXT+="\n AhciRemap: \Zb${AHCIPORTMAP}\Zn"
elif [ "${REMAP}" == "user" ]; then
elif [ "${REMAP}" = "user" ]; then
TEXT+="\n PortMap: \Zb"User"\Zn"
[ -n "${PORTMAP}" ] && TEXT+="\n SataPortmap: \Zb${PORTMAP}\Zn"
[ -n "${DISKMAP}" ] && TEXT+="\n DiskIdxMap: \Zb${DISKMAP}\Zn"
[ -n "${PORTREMAP}" ] && TEXT+="\n SataRemap: \Zb${PORTREMAP}\Zn"
[ -n "${AHCIPORTREMAP}" ] && TEXT+="\n AhciRemap: \Zb${AHCIPORTREMAP}\Zn"
fi
if [ "${DT}" == "true" ]; then
if [ "${DT}" = "true" ]; then
TEXT+="\n Hotplug: \Zb${HDDSORT}\Zn"
else
TEXT+="\n USB Mount: \Zb${USBMOUNT}\Zn"
@@ -1063,8 +1121,8 @@ function sysinfo() {
PORTS=$(ls -l /sys/class/scsi_host | grep "${PCI}" | awk -F'/' '{print $NF}' | sed 's/host//' | sort -n)
for P in ${PORTS}; do
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)"
if [ "$(cat /sys/class/scsi_host/host${P}/ahci_port_cmd)" == "0" ]; then
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
TEXT+="\Z1\Zb$(printf "%02d" ${P})\Zn "
else
TEXT+="\Z2\Zb$(printf "%02d" ${P})\Zn "
@@ -1134,29 +1192,49 @@ function sysinfo() {
NUMPORTS=$((${NUMPORTS} + ${PORTNUM}))
fi
TEXT+="\n Total Disks: \Zb${NUMPORTS}\Zn"
[ -f "${TMP_PATH}/diag" ] && rm -f "${TMP_PATH}/diag" >/dev/null
echo -e "${TEXT}" >"${TMP_PATH}/diag"
while true; do
dialog --backtitle "$(backtitle)" --colors --ok-label "Exit" --help-button --help-label "Show Cmdline" \
--extra-button --extra-label "Upload" --title "Sysinfo" --msgbox "${TEXT}" 0 0
RET=$?
case ${RET} in
0) # ok-button
return 0
break
;;
2) # help-button
getCMDline
;;
3) # extra-button
uploadDiag
;;
255) # ESC-button
return 0
break
;;
esac
done
if [ -n "${USERID}" ]; then
echo -e "${TEXT}" >"${TMP_PATH}/sysinfo.yml"
while true; do
dialog --backtitle "$(backtitle)" --colors --ok-label "Exit" --help-button --help-label "Show Cmdline" \
--extra-button --extra-label "Upload" --title "Sysinfo" --msgbox "${TEXT}" 0 0
RET=$?
case ${RET} in
0) # ok-button
return 0
break
;;
2) # help-button
getCMDline
;;
3) # extra-button
uploadDiag
;;
255) # ESC-button
return 0
break
;;
esac
done
else
while true; do
dialog --backtitle "$(backtitle)" --colors --ok-label "Exit" --help-button --help-label "Show Cmdline" \
--title "Sysinfo" --msgbox "${TEXT}" 0 0
RET=$?
case ${RET} in
0) # ok-button
return 0
break
;;
2) # help-button
getCMDline
;;
255) # ESC-button
return 0
break
;;
esac
done
fi
return
}
@@ -1171,9 +1249,14 @@ function getCMDline () {
}
function uploadDiag () {
if [ -f "${TMP_PATH}/diag" ]; then
GENHASH=$(cat "${TMP_PATH}/diag" | curl -s -F "content=<-" http://dpaste.com/api/v2/ | cut -c 19-)
dialog --backtitle "$(backtitle)" --title "Sysinfo Upload" --msgbox "Your Code: ${GENHASH}" 5 30
if [ -f "${TMP_PATH}/sysinfo.yml" ]; then
HWID="$(genHWID)"
curl -sk -m 20 -X POST -F "file=@${TMP_PATH}/sysinfo.yml" "https://arc.auxxxilium.tech?sysinfo=${HWID}&userid=${USERID}" 2>/dev/null
if [ $? -eq 0 ]; then
dialog --backtitle "$(backtitle)" --title "Sysinfo Upload" --msgbox "Your Code: ${HWID}" 5 40
else
dialog --backtitle "$(backtitle)" --title "Sysinfo Upload" --msgbox "Failed to upload diag file!" 0 0
fi
else
dialog --backtitle "$(backtitle)" --title "Sysinfo Upload" --msgbox "No Diag File found!" 0 0
fi
@@ -1184,22 +1267,22 @@ function uploadDiag () {
# Shows Networkdiag to user
function networkdiag() {
(
ETHX="$(ls /sys/class/net 2>/dev/null | grep eth)"
for ETH in ${ETHX}; do
ETHX=$(ip -o link show | awk -F': ' '{print $2}' | grep eth)
for N in ${ETHX}; do
echo
DRIVER=$(ls -ld /sys/class/net/${ETH}/device/driver 2>/dev/null | awk -F '/' '{print $NF}')
echo -e "Interface: ${ETH} (${DRIVER})"
if ethtool ${ETH} 2>/dev/null | grep 'Link detected' | grep -q 'no'; then
DRIVER=$(ls -ld /sys/class/net/${N}/device/driver 2>/dev/null | awk -F '/' '{print $NF}')
echo -e "Interface: ${N} (${DRIVER})"
if [ "0" = "$(cat /sys/class/net/${N}/carrier 2>/dev/null)" ]; then
echo -e "Link: NOT CONNECTED"
continue
fi
if ! ip link show ${ETH} 2>/dev/null | grep -q 'UP'; then
if [ -z "$(cat /sys/class/net/${N}/carrier 2>/dev/null)" ]; then
echo -e "Link: DOWN"
continue
fi
echo -e "Link: CONNECTED"
addr=$(getIP ${ETH})
netmask=$(ifconfig ${ETH} | grep inet | grep 255 | awk '{print $4}' | cut -f2 -d':')
addr=$(getIP ${N})
netmask=$(ifconfig ${N} | grep inet | grep 255 | awk '{print $4}' | cut -f2 -d':')
echo -e "IP Address: ${addr}"
echo -e "Netmask: ${netmask}"
echo
@@ -1208,7 +1291,7 @@ function networkdiag() {
dnsserver=$(cat /etc/resolv.conf | grep nameserver | awk '{print $2}')
echo -e "DNS Server:\n${dnsserver}"
echo
if [ "${ARCOFFLINE}" == "true" ]; then
if [ "${ARCOFFLINE}" = "true" ]; then
echo -e "Offline Mode: ${ARCOFFLINE}"
else
websites=("google.com" "github.com" "auxxxilium.tech")
@@ -1220,14 +1303,21 @@ function networkdiag() {
fi
done
echo
GITHUBAPI=$(curl --interface ${ETH} -skL "https://api.github.com/repos/AuxXxilium/arc/releases" | jq -r ".[].tag_name" | grep -v "dev" | sort -rV | head -1 2>/dev/null)
HWID="$(genHWID)"
USERIDAPI="$(curl --interface ${N} -skL -m 10 "https://arc.auxxxilium.tech?hwid=${HWID}" 2>/dev/null)"
if [[ $? -ne 0 || -z "${USERIDAPI}" ]]; then
echo -e "Arc UserID API not reachable!"
else
echo -e "Arc UserID API reachable! (${USERIDAPI})"
fi
GITHUBAPI=$(curl --interface ${N} -skL -m 10 "https://api.github.com/repos/AuxXxilium/arc/releases" | jq -r ".[].tag_name" | grep -v "dev" | sort -rV | head -1 2>/dev/null)
if [[ $? -ne 0 || -z "${GITHUBAPI}" ]]; then
echo -e "Github API not reachable!"
else
echo -e "Github API reachable!"
fi
if [ "${CONFDONE}" == "true" ]; then
SYNOAPI=$(curl --interface ${ETH} -m 5 -skL "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 [ "${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')
if [[ $? -ne 0 || -z "${SYNOAPI}" ]]; then
echo -e "Syno API not reachable!"
else
@@ -1279,15 +1369,16 @@ function credits() {
}
###############################################################################
# allow setting Static IP for Loader
# Setting Static IP for Loader
function staticIPMenu() {
ETHX="$(ls /sys/class/net 2>/dev/null | grep eth)"
for ETH in ${ETHX}; do
MACR="$(cat /sys/class/net/${ETH}/address 2>/dev/null | sed 's/://g' | tr '[:lower:]' '[:upper:]')"
ETHX=$(ip -o link show | awk -F': ' '{print $2}' | grep -v lo)
IPCON=""
for N in ${ETHX}; do
MACR="$(cat /sys/class/net/${N}/address 2>/dev/null | sed 's/://g')"
IPR="$(readConfigKey "network.${MACR}" "${USER_CONFIG_FILE}")"
IFS='/' read -r -a IPRA <<<"${IPR}"
MSG="$(printf "Set to %s: (Delete if empty)" "${ETH}(${MACR})")"
MSG="Set ${N}(${MACR}) IP to: (Delete if empty)"
while true; do
dialog --backtitle "$(backtitle)" --title "StaticIP" \
--form "${MSG}" 10 60 4 "address" 1 1 "${IPRA[0]}" 1 9 36 16 "netmask" 2 1 "${IPRA[1]}" 2 9 36 16 "gateway" 3 1 "${IPRA[2]}" 3 9 36 16 "dns" 4 1 "${IPRA[3]}" 4 9 36 16 \
@@ -1295,19 +1386,42 @@ function staticIPMenu() {
RET=$?
case ${RET} in
0) # ok-button
dialog --backtitle "$(backtitle)" --title "StaticIP" \
--infobox "Setting IP ..." 3 25
address="$(cat "${TMP_PATH}/resp" | sed -n '1p')"
netmask="$(cat "${TMP_PATH}/resp" | sed -n '2p')"
gateway="$(cat "${TMP_PATH}/resp" | sed -n '3p')"
dnsname="$(cat "${TMP_PATH}/resp" | sed -n '4p')"
if [ -z "${address}" ]; then
deleteConfigKey "network.${MACR}" "${USER_CONFIG_FILE}"
else
writeConfigKey "network.${MACR}" "${address}/${netmask}/${gateway}/${dnsname}" "${USER_CONFIG_FILE}"
fi
writeConfigKey "arc.builddone" "false" "${USER_CONFIG_FILE}"
BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")"
(
if [ -z "${address}" ]; then
if [ -n "$(readConfigKey "network.${MACR}" "${USER_CONFIG_FILE}")" ]; then
if [ "1" = "$(cat /sys/class/net/${N}/carrier 2>/dev/null)" ]; then
ip addr flush dev ${N}
fi
deleteConfigKey "network.${MACR}" "${USER_CONFIG_FILE}"
IP="$(getIP)"
[ -z "${IPCON}" ] && IPCON="${IP}"
sleep 1
fi
else
if [ "1" = "$(cat /sys/class/net/${N}/carrier 2>/dev/null)" ]; then
ip addr flush dev ${N}
ip addr add ${address}/${netmask:-"255.255.255.0"} dev ${N}
if [ -n "${gateway}" ]; then
ip route add default via ${gateway} dev ${N}
fi
if [ -n "${dnsname:-${gateway}}" ]; then
sed -i "/nameserver ${dnsname:-${gateway}}/d" /etc/resolv.conf
echo "nameserver ${dnsname:-${gateway}}" >>/etc/resolv.conf
fi
fi
writeConfigKey "network.${MACR}" "${address}/${netmask}/${gateway}/${dnsname}" "${USER_CONFIG_FILE}"
IP="$(getIP)"
[ -z "${IPCON}" ] && IPCON="${IP}"
sleep 1
fi
writeConfigKey "arc.builddone" "false" "${USER_CONFIG_FILE}"
BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")"
) 2>&1 | dialog --backtitle "$(backtitle)" --title "StaticIP" \
--progressbox "Setting IP ..." 20 100
break
;;
1) # cancel-button
@@ -1318,28 +1432,6 @@ function staticIPMenu() {
;;
esac
done
sleep 1
done
IPCON=""
dialog --backtitle "$(backtitle)" --title "StaticIP" \
--infobox "Restart Network ..." 3 25
for ETH in ${ETHX}; do
MACR="$(cat /sys/class/net/${ETH}/address 2>/dev/null | sed 's/://g' | tr '[:lower:]' '[:upper:]')"
IPR="$(readConfigKey "network.${MACR}" "${USER_CONFIG_FILE}")"
if [ -n "${IPR}" ]; then
IFS='/' read -r -a IPRA <<<"${IPR}"
ip addr flush dev ${ETH}
ip addr add ${IPRA[0]}/${IPRA[1]:-"255.255.255.0"} dev ${ETH}
[ -z "${IPCON}" ] && IPCON="${IPRA[0]}"
if [ -n "${IPRA[2]}" ]; then
ip route add default via ${IPRA[2]} dev ${ETH}
fi
if [ -n "${IPRA[3]:-${IPRA[2]}}" ]; then
sed -i "/nameserver ${IPRA[3]:-${IPRA[2]}}/d" /etc/resolv.conf
echo "nameserver ${IPRA[3]:-${IPRA[2]}}" >>/etc/resolv.conf
fi
sleep 1
fi
done
}
@@ -1395,7 +1487,7 @@ function resetPassword() {
while read L; do
U=$(echo "${L}" | awk -F ':' '{if ($2 != "*" && $2 != "!!") print $1;}')
[ -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
[ $? -eq 0 ] && S="SecureSignIn" || S=" "
printf "\"%-36s %-10s %-14s\"\n" "${U}" "${E}" "${S}" >>"${TMP_PATH}/menu"
@@ -1433,11 +1525,8 @@ function resetPassword() {
for I in ${DSMROOTS}; do
mount -t ext4 "${I}" "${TMP_PATH}/mdX"
[ $? -ne 0 ] && continue
OLDPASSWD="$(cat "${TMP_PATH}/mdX/etc/shadow" 2>/dev/null | grep "^${USER}:" | awk -F ':' '{print $2}')"
if [ -n "${NEWPASSWD}" -a -n "${OLDPASSWD}" ]; then
sed -i "s|${OLDPASSWD}|${NEWPASSWD}|g" "${TMP_PATH}/mdX/etc/shadow"
sed -i "/^${USER}:/ s/\([^:]*\):\([^:]*\):\([^:]*\):\([^:]*\):\([^:]*\):\([^:]*\):\([^:]*\):\([^:]*\):\([^:]*\)/\1:\2:\3:\4:\5:\6:\7::\9/" "${TMP_PATH}/mdX/etc/shadow"
fi
sed -i "s|^${USER}:[^:]*|${USER}:${NEWPASSWD}|" "${TMP_PATH}/mdX/etc/shadow"
sed -i "/^${USER}:/ s/^\(${USER}:[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\)[^:]*:/\1:/" "${TMP_PATH}/mdX/etc/shadow"
sed -i "s|status=on|status=off|g" "${TMP_PATH}/mdX/usr/syno/etc/packages/SecureSignIn/preference/${USER}/method.config" 2>/dev/null
sync
umount "${TMP_PATH}/mdX"
@@ -1490,7 +1579,7 @@ EOF
rm -rf "${TMP_PATH}/mdX" >/dev/null
) 2>&1 | dialog --backtitle "$(backtitle)" --title "Add DSM User" \
--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" \
--msgbox "${MSG}" 0 0
return
@@ -1551,17 +1640,6 @@ function loaderPorts() {
RET=$?
case ${RET} in
0) # ok-button
function check_port() {
if [ -z "${1}" ]; then
return 0
else
if [[ "${1}" =~ ^[0-9]+$ ]] && [ "${1}" -ge 0 ] && [ "${1}" -le 65535 ]; then
return 0
else
return 1
fi
fi
}
HTTPPORT=$(sed -n '1p' "${TMP_PATH}/resp")
DUFSPORT=$(sed -n '2p' "${TMP_PATH}/resp")
TTYDPORT=$(sed -n '3p' "${TMP_PATH}/resp")
@@ -1573,9 +1651,9 @@ function loaderPorts() {
[ $? -eq 0 ] && continue || break
fi
rm -f "/etc/arc.conf"
[ ! "${HTTPPORT:-8080}" = "8080" ] && echo "HTTP_PORT=${HTTPPORT}" >>"/etc/arc.conf" && /etc/init.d/S90thttpd restart >/dev/null 2>&1
[ ! "${DUFSPORT:-7304}" = "7304" ] && echo "DUFS_PORT=${DUFSPORT}" >>"/etc/arc.conf" && /etc/init.d/S99dufs restart >/dev/null 2>&1
[ ! "${TTYDPORT:-7681}" = "7681" ] && echo "TTYD_PORT=${TTYDPORT}" >>"/etc/arc.conf" && /etc/init.d/S99ttyd restart >/dev/null 2>&1
if [ ! "${HTTPPORT:-8080}" = "8080" ]; then echo "HTTP_PORT=${HTTPPORT}" >>"/etc/arc.conf"; /etc/init.d/S90thttpd restart >/dev/null 2>&1; fi
if [ ! "${DUFSPORT:-7304}" = "7304" ]; then echo "DUFS_PORT=${DUFSPORT}" >>"/etc/arc.conf"; /etc/init.d/S99dufs restart >/dev/null 2>&1; fi
if [ ! "${TTYDPORT:-7681}" = "7681" ]; then echo "TTYD_PORT=${TTYDPORT}" >>"/etc/arc.conf"; /etc/init.d/S99ttyd restart >/dev/null 2>&1; fi
RDXZ_PATH="${TMP_PATH}/rdxz_tmp"
rm -rf "${RDXZ_PATH}"
mkdir -p "${RDXZ_PATH}"
@@ -1666,9 +1744,9 @@ function formatDisks() {
rm -f "${TMP_PATH}/opts"
while read -r KNAME SIZE TYPE PKNAME; do
[ -z "${KNAME}" ] && continue
[ "${KNAME}" == "N/A" ] && continue
[[ "${KNAME}" == /dev/md* ]] && continue
[[ "${KNAME}" == "${LOADER_DISK}" || "${PKNAME}" == "${LOADER_DISK}" ]] && continue
[ "${KNAME}" = "N/A" ] && continue
[[ "${KNAME}" = /dev/md* ]] && continue
[[ "${KNAME}" = "${LOADER_DISK}" || "${PKNAME}" = "${LOADER_DISK}" ]] && continue
[ -z "${SIZE}" ] && SIZE="Unknown"
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)
@@ -1713,10 +1791,10 @@ function cloneLoader() {
rm -f "${TMP_PATH}/opts" >/dev/null
while read -r KNAME SIZE TYPE PKNAME; do
[ -z "${KNAME}" ] && continue
[ "${KNAME}" == "N/A" ] && continue
[ "${KNAME}" = "N/A" ] && continue
[ "${TYPE}" != "disk" ] && continue
[[ "${KNAME}" == /dev/md* ]] && continue
[[ "${KNAME}" == "${LOADER_DISK}" || "${PKNAME}" == "${LOADER_DISK}" ]] && continue
[[ "${KNAME}" = /dev/md* ]] && continue
[[ "${KNAME}" = "${LOADER_DISK}" || "${PKNAME}" = "${LOADER_DISK}" ]] && continue
[ -z "${SIZE}" ] && SIZE="Unknown"
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)
@@ -1735,7 +1813,7 @@ function cloneLoader() {
--msgbox "No disk selected!" 0 0
return
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
dialog --backtitle "$(backtitle)" --colors --title "Clone Loader" \
--msgbox "Disk ${resp} size is less than 1GB and cannot be cloned!" 0 0
@@ -1928,7 +2006,7 @@ function rebootMenu() {
echo -e "config \"Arc: Config Mode\"" >>"${TMP_PATH}/opts"
echo -e "update \"Arc: Automated Update Mode\"" >>"${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 "junior \"DSM: Reinstall Mode\"" >>"${TMP_PATH}/opts"
fi
@@ -1944,13 +2022,13 @@ function rebootMenu() {
REDEST=${resp}
dialog --backtitle "$(backtitle)" --title "Power Menu" \
--infobox "Option: ${REDEST} selected ...!" 3 50
if [ "${REDEST}" == "poweroff" ]; then
exec poweroff
if [ "${REDEST}" = "poweroff" ]; then
poweroff
exit 0
elif [ "${REDEST}" == "shell" ]; then
elif [ "${REDEST}" = "shell" ]; then
clear
exit 0
elif [ "${REDEST}" == "network" ]; then
elif [ "${REDEST}" = "network" ]; then
clear
/etc/init.d/S41dhcpcd restart
exec init.sh
@@ -2029,9 +2107,9 @@ function governorMenu () {
function governorSelection () {
rm -f "${TMP_PATH}/opts" >/dev/null
touch "${TMP_PATH}/opts"
if [ "${ARCMODE}" == "config" ]; then
if [ "${ARCMODE}" = "config" ]; then
# 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 "conservative \"use conservative to scale frequency\"" >>"${TMP_PATH}/opts"
echo -e "performance \"always run at max frequency\"" >>"${TMP_PATH}/opts"
@@ -2044,7 +2122,7 @@ function governorSelection () {
[ -z "${resp}" ] && return
CPUGOVERNOR=${resp}
else
[ "${PLATFORM}" == "epyc7002" ] && CPUGOVERNOR="schedutil"
[ "${PLATFORM}" = "epyc7002" ] && CPUGOVERNOR="schedutil"
[ "${PLATFORM}" != "epyc7002" ] && CPUGOVERNOR="ondemand"
fi
writeConfigKey "addons.cpufreqscaling" "${CPUGOVERNOR}" "${USER_CONFIG_FILE}"
@@ -2157,16 +2235,16 @@ function getpatfiles() {
mkdir -p "${USER_UP_PATH}"
DSM_FILE="${USER_UP_PATH}/${PAT_HASH}.tar"
VALID="false"
if [ ! -f "${DSM_FILE}" ] && [ "${ARCOFFLINE}" == "false" ]; then
if [ ! -f "${DSM_FILE}" ] && [ "${ARCOFFLINE}" = "false" ]; then
rm -f ${USER_UP_PATH}/*.tar
dialog --backtitle "$(backtitlep)" --colors --title "DSM Boot Files" \
--infobox "Downloading DSM Boot Files..." 3 40
# Get new Files
DSM_URL="https://raw.githubusercontent.com/AuxXxilium/arc-dsm/main/files/${MODEL/+/%2B}/${PRODUCTVER}/${PAT_HASH}.tar"
if curl -skL "${DSM_URL}" -o "${DSM_FILE}"; then
if curl -skL "${DSM_URL}" -o "${DSM_FILE}" 2>/dev/null; then
VALID="true"
fi
elif [ ! -f "${DSM_FILE}" ] && [ "${ARCOFFLINE}" == "true" ]; then
elif [ ! -f "${DSM_FILE}" ] && [ "${ARCOFFLINE}" = "true" ]; then
rm -f ${USER_UP_PATH}/*.tar
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
@@ -2178,7 +2256,7 @@ function getpatfiles() {
VALID="true"
fi
mkdir -p "${UNTAR_PAT_PATH}"
if [ "${VALID}" == "true" ]; then
if [ "${VALID}" = "true" ]; then
dialog --backtitle "$(backtitlep)" --title "DSM Boot Files" --aspect 18 \
--infobox "Copying DSM Boot Files..." 3 40
tar -xf "${DSM_FILE}" -C "${UNTAR_PAT_PATH}" 2>/dev/null
@@ -2197,29 +2275,21 @@ function getpatfiles() {
###############################################################################
# Generate HardwareID
function genHardwareID() {
HWID="$(genHWID)"
while true; do
HWID="$(echo $(ifconfig | grep eth0 | awk '{print $NF}' | sed 's/://g') $(cat /proc/cpuinfo | grep "model name" | cut -d':' -f2 | head -1) | sha256sum | awk '{print $1}' | cut -c1-16)" 2>/dev/null
if [ -n "${HWID}" ]; then
USERID="$(curl -skL "https://arc.auxxxilium.tech?hwid=${HWID}")"
if echo "${USERID}" | grep -vq "Hardware ID"; then
dialog --backtitle "$(backtitle)" --title "HardwareID" \
--msgbox "HardwareID: ${HWID}\nYour HardwareID is registered to UserID: ${USERID}!" 6 70
writeConfigKey "arc.hwid" "${HWID}" "${USER_CONFIG_FILE}"
writeConfigKey "arc.userid" "${USERID}" "${USER_CONFIG_FILE}"
break
else
dialog --backtitle "$(backtitle)" --title "HardwareID" \
--yes-label "Retry" --no-label "Cancel" --yesno "HardwareID: ${HWID}\nRegister your HardwareID on\nhttps://arc.auxxxilium.tech (Discord Account needed)." 8 60
writeConfigKey "arc.hwid" "" "${USER_CONFIG_FILE}"
writeConfigKey "arc.userid" "" "${USER_CONFIG_FILE}"
[ $? -ne 0 ] && break
fi
USERID="$(curl -skL -m 10 "https://arc.auxxxilium.tech?hwid=${HWID}" 2>/dev/null)"
if echo "${USERID}" | grep -vq "Hardware ID"; then
dialog --backtitle "$(backtitle)" --title "HardwareID" \
--msgbox "HardwareID: ${HWID}\nYour HardwareID is registered to UserID: ${USERID}!" 6 70
writeConfigKey "arc.hwid" "${HWID}" "${USER_CONFIG_FILE}"
writeConfigKey "arc.userid" "${USERID}" "${USER_CONFIG_FILE}"
break
else
dialog --backtitle "$(backtitle)" --title "HardwareID" \
--msgbox "HardwareID: Verification failed!" 6 50
--yes-label "Retry" --no-label "Cancel" --yesno "HardwareID: ${HWID}\nRegister your HardwareID on\nhttps://arc.auxxxilium.tech (Discord Account needed).\nPress Retry after you registered it." 8 60
[ $? -ne 0 ] && USERID="" && break
writeConfigKey "arc.hwid" "" "${USER_CONFIG_FILE}"
writeConfigKey "arc.userid" "" "${USER_CONFIG_FILE}"
break
fi
done
return
@@ -2228,27 +2298,27 @@ function genHardwareID() {
###############################################################################
# Check HardwareID
function checkHardwareID() {
HWID="$(echo $(ifconfig | grep eth0 | awk '{print $NF}' | sed 's/://g') $(cat /proc/cpuinfo | grep "model name" | cut -d':' -f2 | head -1) | sha256sum | awk '{print $1}' | cut -c1-16)" 2>/dev/null
USERID="$(curl -skL "https://arc.auxxxilium.tech?hwid=${HWID}")"
HWID="$(genHWID)"
USERID="$(curl -skL -m 10 "https://arc.auxxxilium.tech?hwid=${HWID}" 2>/dev/null)"
[ ! -f "${S_FILE}.bak" ] && cp -f "${S_FILE}" "${S_FILE}.bak" 2>/dev/null || true
if echo "${USERID}" | grep -vq "Hardware ID"; then
writeConfigKey "arc.hwid" "${HWID}" "${USER_CONFIG_FILE}"
writeConfigKey "arc.userid" "${USERID}" "${USER_CONFIG_FILE}"
if [ -n "${USERID}" ] && [ -n "${HWID}" ]; then
cp -f "${S_FILE}" "${S_FILE}.bak"
curl -skL "https://arc.auxxxilium.tech?hwid=${HWID}&userid=${USERID}" > "${S_FILE}"
if curl -skL -m 10 "https://arc.auxxxilium.tech?hwid=${HWID}&userid=${USERID}" -o "${S_FILE}" 2>/dev/null; then
writeConfigKey "arc.hwid" "${HWID}" "${USER_CONFIG_FILE}"
writeConfigKey "arc.userid" "${USERID}" "${USER_CONFIG_FILE}"
else
writeConfigKey "arc.hwid" "" "${USER_CONFIG_FILE}"
writeConfigKey "arc.userid" "" "${USER_CONFIG_FILE}"
mv -f "${S_FILE}.bak" "${S_FILE}" 2>/dev/null
fi
else
USERID=""
writeConfigKey "arc.hwid" "" "${USER_CONFIG_FILE}"
writeConfigKey "arc.userid" "" "${USER_CONFIG_FILE}"
dialog --backtitle "$(backtitle)" --title "HardwareID" \
--infobox "Couldn't verify your HardwareID!\nArc Patch not enabled!" 6 40
cp -f "${S_FILE}.bak" "${S_FILE}"
sleep 3
mv -f "${S_FILE}.bak" "${S_FILE}" 2>/dev/null
fi
return
}
###############################################################################
# Bootsreen Menu
function bootScreen () {

View File

@@ -69,19 +69,19 @@ function backtitle() {
BACKTITLE+="Build: ${BUILDDONE} | "
BACKTITLE+="${MACHINE}(${BUS}) | "
[ -n "${KEYMAP}" ] && BACKTITLE+="KB: ${KEYMAP}"
[ "${ARCOFFLINE}" == "true" ] && BACKTITLE+=" | Offline"
[ "${ARCOFFLINE}" = "true" ] && BACKTITLE+=" | Offline"
echo "${BACKTITLE}"
}
function backtitlep() {
[ "${STEP}" == "model" ] && BACKTITLEP="CHOOSE MODEL >>> " || BACKTITLEP="Choose Model >>> "
[ "${STEP}" == "version" ] && BACKTITLEP+="CHOOSE VERSION >>> " || BACKTITLEP+="Choose Version >>> "
[ "${STEP}" == "snmac" ] && BACKTITLEP+="SET SN/MAC >>> " || BACKTITLEP+="Set SN/Mac >>> "
[ "${STEP}" == "network" ] && BACKTITLEP+="SET NETWORK >>> " || BACKTITLEP+="Set Network >>> "
[ "${STEP}" == "storagemap" ] && BACKTITLEP+="SET STORAGEMAP >>> " || BACKTITLEP+="Set StorageMap >>> "
[ "${STEP}" == "addons" ] && BACKTITLEP+="SET ADDONS >>> " || BACKTITLEP+="Set Addons >>> "
[ "${STEP}" == "build" ] && BACKTITLEP+="BUILD LOADER >>> " || BACKTITLEP+="Build Loader >>> "
[ "${STEP}" == "boot" ] && BACKTITLEP+="BOOT DSM" || BACKTITLEP+="Boot DSM"
[ "${STEP}" = "model" ] && BACKTITLEP="CHOOSE MODEL >>> " || BACKTITLEP="Choose Model >>> "
[ "${STEP}" = "version" ] && BACKTITLEP+="CHOOSE VERSION >>> " || BACKTITLEP+="Choose Version >>> "
[ "${STEP}" = "snmac" ] && BACKTITLEP+="SET SN/MAC >>> " || BACKTITLEP+="Set SN/Mac >>> "
[ "${STEP}" = "network" ] && BACKTITLEP+="SET NETWORK >>> " || BACKTITLEP+="Set Network >>> "
[ "${STEP}" = "storagemap" ] && BACKTITLEP+="SET STORAGEMAP >>> " || BACKTITLEP+="Set StorageMap >>> "
[ "${STEP}" = "addons" ] && BACKTITLEP+="SET ADDONS >>> " || BACKTITLEP+="Set Addons >>> "
[ "${STEP}" = "build" ] && BACKTITLEP+="BUILD LOADER >>> " || BACKTITLEP+="Build Loader >>> "
[ "${STEP}" = "boot" ] && BACKTITLEP+="BOOT DSM" || BACKTITLEP+="Boot DSM"
echo "${BACKTITLEP}"
}
@@ -89,11 +89,14 @@ function backtitlep() {
# Model Selection
function arcModel() {
STEP="model"
dialog --backtitle "$(backtitlep)" --title "Model" \
--infobox "Reading Models..." 3 25
if [ ! -f "${S_FILE}" ] || [ ! -f "${P_FILE}" ]; then
updateConfigs
else
checkHardwareID
fi
dialog --backtitle "$(backtitlep)" --title "Model" \
--infobox "Reading Models..." 3 25
ARCCONF="$(readConfigKey "${MODEL:-SA6400}.serial" "${S_FILE}")"
# Loop menu
RESTRICT=1
PS="$(readConfigEntriesArray "platforms" "${P_FILE}" | sort)"
@@ -104,7 +107,7 @@ function arcModel() {
echo "${M} ${P}" >>"${TMP_PATH}/modellist"
done < <(echo "${PM}")
done < <(echo "${PS}")
if [ "${ARCMODE}" == "config" ]; then
if [ "${ARCMODE}" = "config" ]; then
while true; do
echo -n "" >"${TMP_PATH}/menu"
while read -r M A; do
@@ -115,16 +118,16 @@ function arcModel() {
ARC=""
BETA=""
[ -n "${ARCCONFM}" ] && ARC="x" || ARC=""
[ "${DT}" == "true" ] && DTS="x" || DTS=""
[ "${DT}" = "true" ] && DTS="x" || DTS=""
IGPUS=""
[[ "${A}" == "apollolake" || "${A}" == "geminilake" ]] && IGPUS="up to 9th"
[ "${A}" == "epyc7002" ] && IGPUS="up to 14th"
[ "${DT}" == "true" ] && HBAS="" || HBAS="x"
[ "${M}" == "SA6400" ] && HBAS="x"
[ "${DT}" == "false" ] && USBS="int/ext" || USBS="ext"
[[ "${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}" == "DS918+" || "${M}" == "DS1019+" || "${M}" == "DS1621xs+" || "${M}" == "RS1619xs+" ]] && M_2_STORAGE="" || M_2_STORAGE="+"
[[ "${A}" = "apollolake" || "${A}" = "geminilake" ]] && IGPUS="up to 9th"
[ "${A}" = "epyc7002" ] && IGPUS="up to 14th"
[ "${DT}" = "true" ] && HBAS="" || HBAS="x"
[ "${M}" = "SA6400" ] && HBAS="x"
[ "${DT}" = "false" ] && USBS="int/ext" || USBS="ext"
[[ "${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}" = "DS918+" || "${M}" = "DS1019+" || "${M}" = "DS1621xs+" || "${M}" = "RS1619xs+" ]] && M_2_STORAGE="" || M_2_STORAGE="+"
# Check id model is compatible with CPU
if [ ${RESTRICT} -eq 1 ]; then
for F in "${FLAGS}"; do
@@ -133,32 +136,33 @@ function arcModel() {
break
fi
done
if [ "${A}" != "epyc7002" ] && [ "${DT}" == "true" ] && [ "${EXTERNALCONTROLLER}" == "true" ]; then
if [ "${A}" != "epyc7002" ] && [ "${DT}" = "true" ] && [ "${EXTERNALCONTROLLER}" = "true" ]; then
COMPATIBLE=0
fi
if [ "${A}" != "epyc7002" ] && [ ${SATACONTROLLER} -eq 0 ] && [ "${EXTERNALCONTROLLER}" == "false" ]; then
if [ "${A}" != "epyc7002" ] && [ ${SATACONTROLLER} -eq 0 ] && [ "${EXTERNALCONTROLLER}" = "false" ]; then
COMPATIBLE=0
fi
if [ "${A}" == "epyc7002" ] && [[ ${SCSICONTROLLER} -ne 0 || ${RAIDCONTROLLER} -ne 0 ]]; then
if [ "${A}" = "epyc7002" ] && [[ ${SCSICONTROLLER} -ne 0 || ${RAIDCONTROLLER} -ne 0 ]]; then
COMPATIBLE=0
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
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
fi
[ -z "$(grep -w "${M}" "${S_FILE}")" ] && COMPATIBLE=0
fi
[ -n "$(grep -w "${M}" "${S_FILE}")" ] && BETA="Arc" || BETA="Syno"
[ -z "$(grep -w "${A}" "${P_FILE}")" ] && COMPATIBLE=0
if [ -n "${ARCKEY}" ]; then
if [ -n "${ARCCONF}" ]; then
[ ${COMPATIBLE} -eq 1 ] && echo -e "${M} \"\t$(printf "\Zb%-15s\Zn \Zb%-5s\Zn \Zb%-5s\Zn \Zb%-12s\Zn \Zb%-5s\Zn \Zb%-10s\Zn \Zb%-12s\Zn \Zb%-10s\Zn \Zb%-10s\Zn" "${A}" "${DTS}" "${ARC}" "${IGPUS}" "${HBAS}" "${M_2_CACHE}" "${M_2_STORAGE}" "${USBS}" "${BETA}")\" ">>"${TMP_PATH}/menu"
else
[ ${COMPATIBLE} -eq 1 ] && echo -e "${M} \"\t$(printf "\Zb%-15s\Zn \Zb%-5s\Zn \Zb%-12s\Zn \Zb%-5s\Zn \Zb%-10s\Zn \Zb%-12s\Zn \Zb%-10s\Zn \Zb%-10s\Zn" "${A}" "${DTS}" "${IGPUS}" "${HBAS}" "${M_2_CACHE}" "${M_2_STORAGE}" "${USBS}" "${BETA}")\" ">>"${TMP_PATH}/menu"
fi
done < <(cat "${TMP_PATH}/modellist")
[ -n "${ARCKEY}" ] && MSG="Supported Models for your Hardware (x = supported / + = need Addons)\n$(printf "\Zb%-16s\Zn \Zb%-15s\Zn \Zb%-5s\Zn \Zb%-5s\Zn \Zb%-12s\Zn \Zb%-5s\Zn \Zb%-10s\Zn \Zb%-12s\Zn \Zb%-10s\Zn \Zb%-10s\Zn" "Model" "Platform" "DT" "Arc" "Intel iGPU" "HBA" "M.2 Cache" "M.2 Volume" "USB Mount" "Source")" || MSG="Supported Models for your Hardware (x = supported / + = need Addons) | Syno Models can have faulty Values.\n$(printf "\Zb%-16s\Zn \Zb%-15s\Zn \Zb%-5s\Zn \Zb%-12s\Zn \Zb%-5s\Zn \Zb%-10s\Zn \Zb%-12s\Zn \Zb%-10s\Zn \Zb%-10s\Zn" "Model" "Platform" "DT" "Intel iGPU" "HBA" "M.2 Cache" "M.2 Volume" "USB Mount" "Source")"
[ -n "${ARCKEY}" ] && TITLEMSG="Arc Model" || TITLEMSG="Model"
ARCCONF="$(readConfigKey "${MODEL:-SA6400}.serial" "${S_FILE}")"
[ -n "${ARCCONF}" ] && MSG="Supported Models for your Hardware (x = supported / + = need Addons)\n$(printf "\Zb%-16s\Zn \Zb%-15s\Zn \Zb%-5s\Zn \Zb%-5s\Zn \Zb%-12s\Zn \Zb%-5s\Zn \Zb%-10s\Zn \Zb%-12s\Zn \Zb%-10s\Zn \Zb%-10s\Zn" "Model" "Platform" "DT" "Arc" "Intel iGPU" "HBA" "M.2 Cache" "M.2 Volume" "USB Mount" "Source")" || MSG="Supported Models for your Hardware (x = supported / + = need Addons) | Syno Models can have faulty Values.\n$(printf "\Zb%-16s\Zn \Zb%-15s\Zn \Zb%-5s\Zn \Zb%-12s\Zn \Zb%-5s\Zn \Zb%-10s\Zn \Zb%-12s\Zn \Zb%-10s\Zn \Zb%-10s\Zn" "Model" "Platform" "DT" "Intel iGPU" "HBA" "M.2 Cache" "M.2 Volume" "USB Mount" "Source")"
[ -n "${ARCCONF}" ] && TITLEMSG="Arc Model" || TITLEMSG="Model"
dialog --backtitle "$(backtitlep)" --title "${TITLEMSG}" --colors \
--cancel-label "Show all" --help-button --help-label "Exit" \
--extra-button --extra-label "Info" \
@@ -192,7 +196,7 @@ function arcModel() {
done
fi
# Reset Model Config if changed
if [ "${ARCMODE}" == "config" ] && [ "${MODEL}" != "${resp}" ]; then
if [ "${ARCMODE}" = "config" ] && [ "${MODEL}" != "${resp}" ]; then
MODEL="${resp}"
writeConfigKey "addons" "{}" "${USER_CONFIG_FILE}"
writeConfigKey "arc.remap" "" "${USER_CONFIG_FILE}"
@@ -241,7 +245,7 @@ function arcVersion() {
PAT_URL_CONF="$(readConfigKey "paturl" "${USER_CONFIG_FILE}")"
PAT_HASH_CONF="$(readConfigKey "pathash" "${USER_CONFIG_FILE}")"
# Check for Custom Build
if [ "${ARCMODE}" == "config" ] && [ "${ARCRESTORE}" != "true" ]; then
if [ "${ARCMODE}" = "config" ] && [ "${ARCRESTORE}" != "true" ]; then
# Select Build for DSM
ITEMS="$(readConfigEntriesArray "platforms.${PLATFORM}.productvers" "${P_FILE}" | sort -r)"
dialog --clear --no-items --nocancel --title "Version" --backtitle "$(backtitlep)" \
@@ -274,7 +278,7 @@ function arcVersion() {
PVS="$(readConfigEntriesArray "${PLATFORM}.\"${MODEL}\"" "${D_FILE}" | sort -r)"
echo -n "" >"${TMP_PATH}/versions"
while read -r V; do
if [ "${V:0:3}" != "${PRODUCTVER}" ] || [ "${V}" == "${PREV}" ]; then
if [ "${V:0:3}" != "${PRODUCTVER}" ] || [ "${V}" = "${PREV}" ]; then
continue
else
echo "${V}" >>"${TMP_PATH}/versions"
@@ -320,11 +324,11 @@ function arcVersion() {
dialog --backtitle "$(backtitlep)" --colors --title "Automated Mode" \
--yesno "${MSG}" 6 55
[ $? -eq 0 ] && ARCMODE="automated" || ARCMODE="config"
elif [ "${ARCMODE}" == "automated" ] || [ "${ARCRESTORE}" == "true" ]; then
elif [ "${ARCMODE}" = "automated" ] || [ "${ARCRESTORE}" = "true" ]; then
VALID="true"
fi
# Change Config if Files are valid
if [ "${VALID}" == "true" ]; then
if [ "${VALID}" = "true" ]; then
dialog --backtitle "$(backtitlep)" --title "Arc Config" \
--infobox "Reconfiguring Addons, Cmdline, Modules and Synoinfo" 3 60
# Reset Synoinfo
@@ -336,27 +340,27 @@ function arcVersion() {
ADDONS="$(readConfigKey "addons" "${USER_CONFIG_FILE}")"
DEVICENIC="$(readConfigKey "device.nic" "${USER_CONFIG_FILE}")"
ARCCONF="$(readConfigKey "${MODEL}.serial" "${S_FILE}")"
if [ "${ADDONS}" == "{}" ]; then
if [ "${ADDONS}" = "{}" ]; then
initConfigKey "addons.acpid" "" "${USER_CONFIG_FILE}"
initConfigKey "addons.cpuinfo" "" "${USER_CONFIG_FILE}"
initConfigKey "addons.storagepanel" "" "${USER_CONFIG_FILE}"
initConfigKey "addons.updatenotify" "" "${USER_CONFIG_FILE}"
if [ ${NVMEDRIVES} -gt 0 ]; then
if [ "${PLATFORM}" == "epyc7002" ] && [ ${SATADRIVES} -eq 0 ] && [ ${SASDRIVES} -eq 0 ]; then
if [ "${PLATFORM}" = "epyc7002" ] && [ ${SATADRIVES} -eq 0 ] && [ ${SASDRIVES} -eq 0 ]; then
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.nvmevolume" "" "${USER_CONFIG_FILE}"
else
initConfigKey "addons.nvmevolume" "" "${USER_CONFIG_FILE}"
fi
fi
if [ "${MACHINE}" == "Native" ]; then
if [ "${MACHINE}" = "Native" ]; then
initConfigKey "addons.cpufreqscaling" "" "${USER_CONFIG_FILE}"
initConfigKey "addons.powersched" "" "${USER_CONFIG_FILE}"
initConfigKey "addons.sensors" "" "${USER_CONFIG_FILE}"
fi
if [ "${PLATFORM}" == "apollolake" ] || [ "${PLATFORM}" == "geminilake" ]; then
if [ "${PLATFORM}" = "apollolake" ] || [ "${PLATFORM}" = "geminilake" ]; then
initConfigKey "addons.i915" "" "${USER_CONFIG_FILE}"
fi
if echo "${PAT_URL}" 2>/dev/null | grep -q "7.2.2"; then
@@ -373,7 +377,7 @@ function arcVersion() {
fi
done < <(readConfigMap "addons" "${USER_CONFIG_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
writeConfigKey "modules" "{}" "${USER_CONFIG_FILE}"
while read -r ID DESC; do
@@ -381,7 +385,7 @@ function arcVersion() {
done < <(getAllModules "${PLATFORM}" "${KVERP}")
fi
# Check for Only Version
if [ "${ONLYVERSION}" == "true" ]; then
if [ "${ONLYVERSION}" = "true" ]; then
writeConfigKey "arc.builddone" "false" "${USER_CONFIG_FILE}"
BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")"
ONLYVERSION="false"
@@ -408,16 +412,14 @@ function arcPatch() {
MODEL="$(readConfigKey "model" "${USER_CONFIG_FILE}")"
ARCCONF="$(readConfigKey "${MODEL}.serial" "${S_FILE}")"
# Check for Custom Build
if [ "${ARCMODE}" == "automated" ]; then
[ -z "${ARCCONF}" ] && checkHardwareID || true
sleep 1
if [ "${ARCMODE}" = "automated" ]; then
ARCCONF="$(readConfigKey "${MODEL}.serial" "${S_FILE}")"
[ -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}"
elif [ "${ARCMODE}" == "config" ]; then
elif [ "${ARCMODE}" = "config" ]; then
dialog --clear --backtitle "$(backtitlep)" \
--nocancel --title "SN/Mac Options"\
--menu "Choose an Option." 7 60 0 \
--menu "Choose an Option" 7 60 0 \
1 "Use Arc Patch (AME, QC, Push Notify and more)" \
2 "Use random SN/Mac (Reduced DSM Features)" \
3 "Use my own SN/Mac (Be sure your Data is valid)" \
@@ -425,11 +427,20 @@ function arcPatch() {
resp=$(cat ${TMP_PATH}/resp)
[ -z "${resp}" ] && return 1
if [ ${resp} -eq 1 ]; then
[ -z "${ARCCONF}" ] && checkHardwareID || true
sleep 1
ARCCONF="$(readConfigKey "${MODEL}.serial" "${S_FILE}")"
[ -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}"
if [ -n "${ARCCONF}" ]; then
dialog --backtitle "$(backtitlep)" --colors --title "Arc Patch" \
--infobox "Arc Patch successful!" 3 30
sleep 2
SN="$(generateSerial "${MODEL}" "true")"
writeConfigKey "arc.patch" "true" "${USER_CONFIG_FILE}"
else
dialog --backtitle "$(backtitlep)" --colors --title "Arc Patch" \
--infobox "Arc Patch failed!" 3 30
sleep 2
SN="$(generateSerial "${MODEL}" "false")"
writeConfigKey "arc.patch" "false" "${USER_CONFIG_FILE}"
fi
elif [ ${resp} -eq 2 ]; then
# Generate random Serial
SN="$(generateSerial "${MODEL}" "false")"
@@ -472,14 +483,14 @@ function arcSettings() {
sleep 2
getnet
[ $? -ne 0 ] && return 1
if [ "${ONLYPATCH}" == "true" ]; then
if [ "${ONLYPATCH}" = "true" ]; then
writeConfigKey "arc.builddone" "false" "${USER_CONFIG_FILE}"
BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")"
ONLYPATCH="false"
return 0
fi
# 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"
dialog --backtitle "$(backtitlep)" --colors --title "Storage Map" \
--infobox "Generating Storage Map..." 3 40
@@ -488,7 +499,7 @@ function arcSettings() {
[ $? -ne 0 ] && return 1
fi
# Check for Custom Build
if [ "${ARCMODE}" == "config" ]; then
if [ "${ARCMODE}" = "config" ]; then
# Select Addons
STEP="addons"
dialog --backtitle "$(backtitlep)" --colors --title "Addons" \
@@ -497,17 +508,17 @@ function arcSettings() {
[ $? -ne 0 ] && return 1
fi
# 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" \
--infobox "Generating Governor Table..." 3 40
governorSelection
[ $? -ne 0 ] && return 1
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}"
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}"
fi
if [ "${ARCMODE}" == "config" ]; then
if [ "${ARCMODE}" = "config" ]; then
# 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" \
--msgbox "WARN: You use a HBA/Raid Controller and selected a DT Model.\nThis is still an experimental." 6 70
fi
@@ -518,24 +529,24 @@ function arcSettings() {
dialog --backtitle "$(backtitlep)" --title "Arc Warning" \
--msgbox "WARN: You have more NIC (${DEVICENIC}) then 8 NIC.\nOnly 8 supported by DSM." 6 60
fi
if [ ${DEVICENIC} -gt ${MODELNIC} ] && [ "${ARCPATCH}" == "true" ]; then
if [ ${DEVICENIC} -gt ${MODELNIC} ] && [ "${ARCPATCH}" = "true" ]; then
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
fi
# Check for AES
if [ "${AESSYS}" == "false" ]; then
if [ "${AESSYS}" = "false" ]; then
dialog --backtitle "$(backtitlep)" --title "Arc Warning" \
--msgbox "WARN: Your System doesn't support Hardwareencryption in DSM. (AES)" 5 70
fi
# 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" \
--msgbox "WARN: It is possible that CPU Frequency Scaling is not working properly with your System." 6 80
fi
fi
EMMCBOOT="$(readConfigKey "emmcboot" "${USER_CONFIG_FILE}")"
# eMMC Boot Support
if [ "${EMMCBOOT}" == "true" ]; then
if [ "${EMMCBOOT}" = "true" ]; then
writeConfigKey "modules.mmc_block" "" "${USER_CONFIG_FILE}"
writeConfigKey "modules.mmc_core" "" "${USER_CONFIG_FILE}"
else
@@ -547,7 +558,7 @@ function arcSettings() {
writeConfigKey "arc.confdone" "true" "${USER_CONFIG_FILE}"
CONFDONE="$(readConfigKey "arc.confdone" "${USER_CONFIG_FILE}")"
# Check for Custom Build
if [ "${ARCMODE}" == "config" ]; then
if [ "${ARCMODE}" = "config" ]; then
# Ask for Build
dialog --clear --backtitle "$(backtitlep)" --title "Config done" \
--no-cancel --menu "Build now?" 7 40 0 \
@@ -587,12 +598,12 @@ function arcSummary() {
ARCPATCH="$(readConfigKey "arc.patch" "${USER_CONFIG_FILE}")"
ADDONSINFO="$(readConfigEntriesArray "addons" "${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}")"
DISKMAP="$(readConfigKey "cmdline.DiskIdxMap" "${USER_CONFIG_FILE}")"
elif [ "${REMAP}" == "remap" ]; then
elif [ "${REMAP}" = "remap" ]; then
PORTREMAP="$(readConfigKey "cmdline.sata_remap" "${USER_CONFIG_FILE}")"
elif [ "${REMAP}" == "ahci" ]; then
elif [ "${REMAP}" = "ahci" ]; then
AHCIPORTREMAP="$(readConfigKey "cmdline.ahci_remap" "${USER_CONFIG_FILE}")"
else
PORTMAP="$(readConfigKey "cmdline.SataPortMap" "${USER_CONFIG_FILE}")"
@@ -609,7 +620,7 @@ function arcSummary() {
DRIVES="$(readConfigKey "device.drives" "${USER_CONFIG_FILE}")"
EMMCBOOT="$(readConfigKey "emmcboot" "${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
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
@@ -624,7 +635,7 @@ function arcSummary() {
SUMMARY+="\n>> DT: \Zb${DT}\Zn"
SUMMARY+="\n>> PAT URL: \Zb${PAT_URL}\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"
SUMMARY+="\n\Z4> Arc Information\Zn"
@@ -633,7 +644,7 @@ function arcSummary() {
[ -n "${DISKMAP}" ] && SUMMARY+="\n>> DiskIdxMap: \Zb${DISKMAP}\Zn"
[ -n "${PORTREMAP}" ] && SUMMARY+="\n>> SataRemap: \Zb${PORTREMAP}\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>> eMMC Boot: \Zb${EMMCBOOT}\Zn"
SUMMARY+="\n>> Kernelload: \Zb${KERNELLOAD}\Zn"
@@ -667,19 +678,6 @@ function arcSummary() {
# Building Loader
function make() {
STEP="build"
ARCCONF="$(readConfigKey "${MODEL}.serial" "${S_FILE}" 2>/dev/null)"
SN="$(readConfigKey "sn" "${USER_CONFIG_FILE}")"
BOOTMODE="$(readConfigKey "arc.mode" "${USER_CONFIG_FILE}")"
if [ "${BOOTMODE}" != "automated" ] && [ "${ARCOFFLINE}" != "true" ] && [[ "${ARCPATCH}" != "true" || -z "${ARCCONF}" ]]; then
if ! curl -skL "https://auxxxilium.tech/check.yml" -o "${TMP_PATH}/check.yml" 2>/dev/null; then
SN=$(generateSerial "${MODEL}" "false")
else
if grep -q "${SN}" "${TMP_PATH}/check.yml"; then
SN=$(generateSerial "${MODEL}" "false")
fi
fi
writeConfigKey "sn" "${SN}" "${USER_CONFIG_FILE}"
fi
# Read Model Config
MODEL="$(readConfigKey "model" "${USER_CONFIG_FILE}")"
PLATFORM="$(readConfigKey "platform" "${USER_CONFIG_FILE}")"
@@ -691,15 +689,25 @@ function make() {
# Check for Arc Patch
ARCCONF="$(readConfigKey "${MODEL}.serial" "${S_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.arcdns" "${USER_CONFIG_FILE}"
fi
# Max Memory for DSM
RAMCONFIG="$((${RAMTOTAL} * 1024 * 2))"
writeConfigKey "synoinfo.mem_max_mb" "${RAMCONFIG}" "${USER_CONFIG_FILE}"
getpatfiles
if [ -f "${ORI_ZIMAGE_FILE}" ] && [ -f "${ORI_RDGZ_FILE}" ] && [ "${CONFDONE}" == "true" ] && [ -n "${PAT_URL}" ] && [ -n "${PAT_HASH}" ]; then
if [ -n "${IPCON}" ]; then
getpatfiles
else
dialog --backtitle "$(backtitle)" --title "Build Loader" --aspect 18 \
--infobox "Could not build Loader!\nNetwork Connection needed." 4 40
# Set Build to false
writeConfigKey "arc.builddone" "false" "${USER_CONFIG_FILE}"
BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")"
sleep 2
return 1
fi
if [ -f "${ORI_ZIMAGE_FILE}" ] && [ -f "${ORI_RDGZ_FILE}" ] && [ "${CONFDONE}" = "true" ] && [ -n "${PAT_URL}" ] && [ -n "${PAT_HASH}" ]; then
(
livepatch
sleep 3
@@ -739,13 +747,13 @@ function arcFinish() {
if [ -n "${MODELID}" ]; then
writeConfigKey "arc.builddone" "true" "${USER_CONFIG_FILE}"
BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")"
if [ "${ARCMODE}" == "automated" ] || [ "${UPDATEMODE}" == "true" ]; then
if [ "${ARCMODE}" = "automated" ] || [ "${UPDATEMODE}" = "true" ]; then
boot
else
# Ask for Boot
dialog --clear --backtitle "$(backtitle)" --title "Build done"\
--no-cancel --menu "Boot now?" 7 40 0 \
1 "Yes - Boot Arc Loader now" \
1 "Yes - Boot DSM now" \
2 "No - I want to make changes" \
2>"${TMP_PATH}/resp"
resp=$(cat ${TMP_PATH}/resp)
@@ -765,7 +773,7 @@ function juniorboot() {
BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")"
MODEL="$(readConfigKey "model" "${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" \
--yesno "Config changed, you need to rebuild the Loader?" 0 0
if [ $? -eq 0 ]; then
@@ -785,7 +793,7 @@ function boot() {
BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")"
MODEL="$(readConfigKey "model" "${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" \
--yesno "Config changed, you need to rebuild the Loader?" 0 0
if [ $? -eq 0 ]; then
@@ -804,57 +812,57 @@ function boot() {
###############################################################################
# Main loop
# Check for Arc Mode
if [ "${ARCMODE}" == "update" ]; then
if [ "${ARCMODE}" = "update" ]; then
if [ "${ARCOFFLINE}" != "true" ]; then
updateLoader
else
dialog --backtitle "$(backtitle)" --title "Arc Update" \
--infobox "Update is not possible in Offline Mode!" 5 40
sleep 3
exec reboot
reboot
fi
elif [ "${ARCMODE}" == "automated" ]; then
elif [ "${ARCMODE}" = "automated" ]; then
# Check for Custom Build
if [ "${BUILDDONE}" == "false" ] || [ "${MODEL}" != "${MODELID}" ]; then
if [ "${BUILDDONE}" = "false" ] || [ "${MODEL}" != "${MODELID}" ]; then
arcModel
else
make
fi
else
[ "${CONFDONE}" == "true" ] && NEXT="2" || NEXT="1"
[ "${BUILDDONE}" == "true" ] && NEXT="3" || NEXT="1"
[ "${CONFDONE}" = "true" ] && NEXT="2" || NEXT="1"
[ "${BUILDDONE}" = "true" ] && NEXT="3" || NEXT="1"
while true; do
echo "= \"\Z4========== Main ==========\Zn \" " >"${TMP_PATH}/menu"
echo "= \"\Z4===== Main =====\Zn \" " >"${TMP_PATH}/menu"
if [ -z "${USERID}" ] && [ "${ARCOFFLINE}" != "true" ]; then
echo "0 \"HardwareID for Arc Patch\" " >>"${TMP_PATH}/menu"
fi
echo "1 \"Choose Model \" " >>"${TMP_PATH}/menu"
if [ "${CONFDONE}" == "true" ]; then
if [ "${CONFDONE}" = "true" ] && [ -n "${IPCON}" ]; then
echo "2 \"Build Loader \" " >>"${TMP_PATH}/menu"
fi
if [ "${BUILDDONE}" == "true" ]; then
if [ "${BUILDDONE}" = "true" ]; then
echo "3 \"Boot Loader \" " >>"${TMP_PATH}/menu"
fi
echo "= \"\Z4========== Info ==========\Zn \" " >>"${TMP_PATH}/menu"
echo "= \"\Z4===== Info =====\Zn \" " >>"${TMP_PATH}/menu"
echo "a \"Sysinfo \" " >>"${TMP_PATH}/menu"
echo "A \"Networkdiag \" " >>"${TMP_PATH}/menu"
echo "= \"\Z4========== System ========\Zn \" " >>"${TMP_PATH}/menu"
if [ "${CONFDONE}" == "true" ]; then
if [ "${ARCOPTS}" == "true" ]; then
echo "= \"\Z4===== System ====\Zn \" " >>"${TMP_PATH}/menu"
if [ "${CONFDONE}" = "true" ]; then
if [ "${ARCOPTS}" = "true" ]; then
echo "4 \"\Z1Hide Arc DSM Options\Zn \" " >>"${TMP_PATH}/menu"
else
echo "4 \"\Z1Show Arc DSM Options\Zn \" " >>"${TMP_PATH}/menu"
fi
if [ "${ARCOPTS}" == "true" ]; then
echo "= \"\Z4======== Arc DSM ========\Zn \" " >>"${TMP_PATH}/menu"
if [ "${ARCOPTS}" = "true" ]; then
echo "= \"\Z4==== Arc DSM ====\Zn \" " >>"${TMP_PATH}/menu"
echo "b \"Addons \" " >>"${TMP_PATH}/menu"
echo "d \"Modules \" " >>"${TMP_PATH}/menu"
echo "e \"Version \" " >>"${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"
fi
if [ "${DT}" == "true" ]; then
if [ "${DT}" = "true" ]; then
echo "o \"DTS Map Options \" " >>"${TMP_PATH}/menu"
fi
if readConfigMap "addons" "${USER_CONFIG_FILE}" | grep -q "cpufreqscaling"; then
@@ -867,27 +875,27 @@ else
echo "Q \"SequentialIO Options \" " >>"${TMP_PATH}/menu"
fi
fi
if [ "${BOOTOPTS}" == "true" ]; then
if [ "${BOOTOPTS}" = "true" ]; then
echo "6 \"\Z1Hide Boot Options\Zn \" " >>"${TMP_PATH}/menu"
else
echo "6 \"\Z1Show Boot Options\Zn \" " >>"${TMP_PATH}/menu"
fi
if [ "${BOOTOPTS}" == "true" ]; then
echo "= \"\Z4========== Boot =========\Zn \" " >>"${TMP_PATH}/menu"
if [ "${BOOTOPTS}" = "true" ]; then
echo "= \"\Z4===== Boot =====\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"
if [ "${DIRECTBOOT}" == "false" ]; then
if [ "${DIRECTBOOT}" = "false" ]; then
echo "i \"Boot IP Waittime: \Z4${BOOTIPWAIT}\Zn \" " >>"${TMP_PATH}/menu"
fi
echo "q \"Directboot: \Z4${DIRECTBOOT}\Zn \" " >>"${TMP_PATH}/menu"
fi
if [ "${DSMOPTS}" == "true" ]; then
if [ "${DSMOPTS}" = "true" ]; then
echo "7 \"\Z1Hide DSM Options\Zn \" " >>"${TMP_PATH}/menu"
else
echo "7 \"\Z1Show DSM Options\Zn \" " >>"${TMP_PATH}/menu"
fi
if [ "${DSMOPTS}" == "true" ]; then
echo "= \"\Z4========== DSM ==========\Zn \" " >>"${TMP_PATH}/menu"
if [ "${DSMOPTS}" = "true" ]; then
echo "= \"\Z4===== DSM =====\Zn \" " >>"${TMP_PATH}/menu"
echo "j \"Cmdline \" " >>"${TMP_PATH}/menu"
echo "k \"Synoinfo \" " >>"${TMP_PATH}/menu"
echo "l \"Edit User Config \" " >>"${TMP_PATH}/menu"
@@ -897,10 +905,10 @@ else
echo "J \"Reset Network Config \" " >>"${TMP_PATH}/menu"
echo "M \"Mount DSM Storage Pool (not SHR) \" " >>"${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"
fi
if [ "${DT}" == "true" ]; then
if [ "${DT}" = "true" ]; then
echo "H \"Hotplug/SortDrives: \Z4${HDDSORT}\Zn \" " >>"${TMP_PATH}/menu"
else
echo "h \"USB Mount: \Z4${USBMOUNT}\Zn \" " >>"${TMP_PATH}/menu"
@@ -909,14 +917,14 @@ else
echo "B \"Grep DSM Config from Backup \" " >>"${TMP_PATH}/menu"
fi
fi
if [ "${LOADEROPTS}" == "true" ]; then
if [ "${LOADEROPTS}" = "true" ]; then
echo "8 \"\Z1Hide Loader Options\Zn \" " >>"${TMP_PATH}/menu"
else
echo "8 \"\Z1Show Loader Options\Zn \" " >>"${TMP_PATH}/menu"
fi
if [ "${LOADEROPTS}" == "true" ]; then
echo "= \"\Z4========= Loader =========\Zn \" " >>"${TMP_PATH}/menu"
echo "= \"\Z1=== Edit with caution! ===\Zn \" " >>"${TMP_PATH}/menu"
if [ "${LOADEROPTS}" = "true" ]; then
echo "= \"\Z4===== Loader =====\Zn \" " >>"${TMP_PATH}/menu"
echo "= \"\Z1== Edit with caution! ==\Zn \" " >>"${TMP_PATH}/menu"
echo "D \"StaticIP for Loader/DSM \" " >>"${TMP_PATH}/menu"
echo "c \"Offline Mode: \Z4${ARCOFFLINE}\Zn \" " >>"${TMP_PATH}/menu"
echo "f \"Bootscreen Options \" " >>"${TMP_PATH}/menu"
@@ -932,7 +940,7 @@ else
echo "y \"Choose a Keymap for Loader \" " >>"${TMP_PATH}/menu"
echo "F \"\Z1Formate Disks \Zn \" " >>"${TMP_PATH}/menu"
fi
echo "= \"\Z4========== Misc ==========\Zn \" " >>"${TMP_PATH}/menu"
echo "= \"\Z4===== Misc =====\Zn \" " >>"${TMP_PATH}/menu"
echo "x \"Backup/Restore/Recovery \" " >>"${TMP_PATH}/menu"
[ "${ARCOFFLINE}" != "true" ] && echo "z \"Update Menu \" " >>"${TMP_PATH}/menu"
echo "I \"Power/Service Menu \" " >>"${TMP_PATH}/menu"
@@ -953,36 +961,36 @@ else
A) networkdiag; NEXT="A" ;;
# System Section
# Arc Section
4) [ "${ARCOPTS}" == "true" ] && ARCOPTS='false' || ARCOPTS='true'
4) [ "${ARCOPTS}" = "true" ] && ARCOPTS='false' || ARCOPTS='true'
ARCOPTS="${ARCOPTS}"
NEXT="4"
;;
b) addonMenu; NEXT="b" ;;
d) modulesMenu; NEXT="d" ;;
e) ONLYVERSION="true" && arcVersion; NEXT="e" ;;
p) ONLYPATCH="true" && arcPatch; NEXT="p" ;;
p) ONLYPATCH="true" && checkHardwareID && arcPatch; NEXT="p" ;;
S) storageMenu; NEXT="S" ;;
o) dtsMenu; NEXT="o" ;;
g) governorMenu; NEXT="g" ;;
P) storagepanelMenu; NEXT="P" ;;
Q) sequentialIOMenu; NEXT="Q" ;;
# Boot Section
6) [ "${BOOTOPTS}" == "true" ] && BOOTOPTS='false' || BOOTOPTS='true'
6) [ "${BOOTOPTS}" = "true" ] && BOOTOPTS='false' || BOOTOPTS='true'
BOOTOPTS="${BOOTOPTS}"
NEXT="6"
;;
m) [ "${KERNELLOAD}" == "kexec" ] && KERNELLOAD='power' || KERNELLOAD='kexec'
m) [ "${KERNELLOAD}" = "kexec" ] && KERNELLOAD='power' || KERNELLOAD='kexec'
writeConfigKey "kernelload" "${KERNELLOAD}" "${USER_CONFIG_FILE}"
NEXT="m"
;;
E) [ "${EMMCBOOT}" == "true" ] && EMMCBOOT='false' || EMMCBOOT='true'
if [ "${EMMCBOOT}" == "false" ]; then
E) [ "${EMMCBOOT}" = "true" ] && EMMCBOOT='false' || EMMCBOOT='true'
if [ "${EMMCBOOT}" = "false" ]; then
writeConfigKey "emmcboot" "false" "${USER_CONFIG_FILE}"
deleteConfigKey "synoinfo.disk_swap" "${USER_CONFIG_FILE}"
deleteConfigKey "synoinfo.supportraid" "${USER_CONFIG_FILE}"
deleteConfigKey "synoinfo.support_emmc_boot" "${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 "synoinfo.disk_swap" "no" "${USER_CONFIG_FILE}"
writeConfigKey "synoinfo.supportraid" "no" "${USER_CONFIG_FILE}"
@@ -994,13 +1002,13 @@ else
NEXT="E"
;;
i) bootipwaittime; NEXT="i" ;;
q) [ "${DIRECTBOOT}" == "false" ] && DIRECTBOOT='true' || DIRECTBOOT='false'
q) [ "${DIRECTBOOT}" = "false" ] && DIRECTBOOT='true' || DIRECTBOOT='false'
grub-editenv ${USER_GRUBENVFILE} create
writeConfigKey "directboot" "${DIRECTBOOT}" "${USER_CONFIG_FILE}"
NEXT="q"
;;
# DSM Section
7) [ "${DSMOPTS}" == "true" ] && DSMOPTS='false' || DSMOPTS='true'
7) [ "${DSMOPTS}" = "true" ] && DSMOPTS='false' || DSMOPTS='true'
DSMOPTS="${DSMOPTS}"
NEXT="7"
;;
@@ -1014,11 +1022,11 @@ else
M) mountDSM; NEXT="M" ;;
T) disablescheduledTasks; NEXT="T" ;;
Z) loaderPorts; NEXT="Z" ;;
K) [ "${KERNEL}" == "official" ] && KERNEL='custom' || KERNEL='official'
K) [ "${KERNEL}" = "official" ] && KERNEL='custom' || KERNEL='official'
writeConfigKey "kernel" "${KERNEL}" "${USER_CONFIG_FILE}"
dialog --backtitle "$(backtitle)" --title "Kernel" \
--infobox "Switching Kernel to ${KERNEL}! Stay patient..." 4 50
if [ "${ODP}" == "true" ]; then
if [ "${ODP}" = "true" ]; then
ODP="false"
writeConfigKey "odp" "${ODP}" "${USER_CONFIG_FILE}"
fi
@@ -1026,7 +1034,7 @@ else
PRODUCTVER="$(readConfigKey "productver" "${USER_CONFIG_FILE}")"
KVER="$(readConfigKey "platforms.${PLATFORM}.productvers.\"${PRODUCTVER}\".kver" "${P_FILE}")"
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}"
while read -r ID DESC; do
writeConfigKey "modules.\"${ID}\"" "" "${USER_CONFIG_FILE}"
@@ -1036,17 +1044,17 @@ else
BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")"
NEXT="K"
;;
H) [ "${HDDSORT}" == "true" ] && HDDSORT='false' || HDDSORT='true'
H) [ "${HDDSORT}" = "true" ] && HDDSORT='false' || HDDSORT='true'
writeConfigKey "hddsort" "${HDDSORT}" "${USER_CONFIG_FILE}"
writeConfigKey "arc.builddone" "false" "${USER_CONFIG_FILE}"
BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")"
NEXT="H"
;;
h) if [ "${USBMOUNT}" == "auto" ]; then
h) if [ "${USBMOUNT}" = "auto" ]; then
USBMOUNT='internal'
elif [ "${USBMOUNT}" == "internal" ]; then
elif [ "${USBMOUNT}" = "internal" ]; then
USBMOUNT='external'
elif [ "${USBMOUNT}" == "external" ]; then
elif [ "${USBMOUNT}" = "external" ]; then
USBMOUNT='auto'
fi
writeConfigKey "usbmount" "${USBMOUNT}" "${USER_CONFIG_FILE}"
@@ -1054,7 +1062,7 @@ else
BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")"
NEXT="h"
;;
O) [ "${ODP}" == "false" ] && ODP='true' || ODP='false'
O) [ "${ODP}" = "false" ] && ODP='true' || ODP='false'
writeConfigKey "odp" "${ODP}" "${USER_CONFIG_FILE}"
writeConfigKey "arc.builddone" "false" "${USER_CONFIG_FILE}"
BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")"
@@ -1062,25 +1070,25 @@ else
;;
B) getbackup; NEXT="B" ;;
# Loader Section
8) [ "${LOADEROPTS}" == "true" ] && LOADEROPTS='false' || LOADEROPTS='true'
8) [ "${LOADEROPTS}" = "true" ] && LOADEROPTS='false' || LOADEROPTS='true'
LOADEROPTS="${LOADEROPTS}"
NEXT="8"
;;
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}"
[ "${ARCOFFLINE}" == "false" ] && exec arc.sh
[ "${ARCOFFLINE}" = "false" ] && exec arc.sh
NEXT="c"
;;
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 "arc.builddone" "false" "${USER_CONFIG_FILE}"
BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")"
NEXT="W"
;;
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 "arc.builddone" "false" "${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
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}")"
# Get Loader Disk Bus
@@ -59,7 +59,7 @@ DSMINFO="$(readConfigKey "boot.dsminfo" "${USER_CONFIG_FILE}")"
SYSTEMINFO="$(readConfigKey "boot.systeminfo" "${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 "Model: \033[1;37m${MODELID:-${MODEL}}\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
fi
if [ "${SYSTEMINFO}" == "true" ]; then
if [ "${SYSTEMINFO}" = "true" ]; then
echo -e "\033[1;37mSystem:\033[0m"
echo -e "Vendor: \033[1;37m${VENDOR}\033[0m"
echo -e "CPU: \033[1;37m${CPU}\033[0m"
echo -e "Memory: \033[1;37m${RAMTOTAL}GB\033[0m"
echo
fi
if [ "${DISKINFO}" == "true" ]; then
if [ "${DISKINFO}" = "true" ]; then
echo -e "\033[1;37mDisks:\033[0m"
echo -e "Disks: \033[1;37m$(lsblk -dpno NAME | grep -v "${LOADER_DISK}" | wc -l)\033[0m"
fi
@@ -82,7 +82,7 @@ fi
if ! readConfigMap "addons" "${USER_CONFIG_FILE}" | grep -q nvmesystem; then
HASATA=0
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
HASATA=1
break
@@ -139,7 +139,7 @@ if [ $(echo "${KVER:-4}" | cut -d'.' -f1) -lt 5 ]; then
else
CMDLINE["split_lock_detect"]="off"
fi
if [ "${DT}" == "true" ]; then
if [ "${DT}" = "true" ]; then
CMDLINE["syno_ttyS0"]="serial,0x3f8"
CMDLINE["syno_ttyS1"]="serial,0x2f8"
else
@@ -167,13 +167,13 @@ CMDLINE['modprobe.blacklist']="${MODBLACKLIST}"
#if [ -n "$(ls /dev/mmcblk* 2>/dev/null)" ] && [ "${BUS}" != "mmc" ] && [ "${EMMCBOOT}" != "true" ]; 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"
# 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
[ ! "${CMDLINE['modprobe.blacklist']}" == "" ] && CMDLINE['modprobe.blacklist']+=","
[ ! "${CMDLINE['modprobe.blacklist']}" = "" ] && CMDLINE['modprobe.blacklist']+=","
CMDLINE['modprobe.blacklist']+="mpt3sas"
fi
fi
@@ -187,15 +187,14 @@ if echo "purley broadwellnkv2" | grep -wq "${PLATFORM}"; then
fi
# Cmdline NIC Settings
ETHX="$(ls /sys/class/net 2>/dev/null | grep eth)"
ETHM="$(readConfigKey "${MODEL}.ports" "${S_FILE}" 2>/dev/null)"
ETHN="$(echo ${ETHX} | wc -w)"
[ -z "${ETHM}" ] && ETHM="${ETHN}"
ETHX=$(ip -o link show | awk -F': ' '{print $2}' | grep eth)
ETHM=$(readConfigKey "${MODEL}.ports" "${S_FILE}" 2>/dev/null)
ETHN=$(echo ${ETHX} | wc -w)
[ -z "${ETHM}" ] && ETHM=${ETHN}
NIC=0
for ETH in ${ETHX}; do
MAC="$(readConfigKey "${ETH}" "${USER_CONFIG_FILE}")"
[ -z "${MAC}" ] && MAC="$(cat /sys/class/net/${ETH}/address 2>/dev/null | tr '[:lower:]' '[:upper:]')"
NIC=$((${NIC} + 1))
for N in ${ETHX}; do
MAC="$(readConfigKey "${N}" "${USER_CONFIG_FILE}")"
[ -z "${MAC}" ] && MAC="$(cat /sys/class/net/${N}/address 2>/dev/null | tr '[:lower:]' '[:upper:]')" || NIC=$((${NIC} + 1))
[ ${NIC} -le ${ETHM} ] && CMDLINE["mac${NIC}"]="${MAC}"
[ ${NIC} -ge ${ETHM} ] && break
done
@@ -245,22 +244,22 @@ function _bootwait() {
# Boot
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
grub-editenv ${USER_GRUBENVFILE} set dsm_cmdline="${CMDLINE_DIRECT}"
grub-editenv ${USER_GRUBENVFILE} set next_entry="direct"
_bootwait || true
echo -e "\033[1;34mReboot with Directboot\033[0m"
exec reboot
reboot
exit 0
elif [ "${DIRECTBOOT}" == "false" ]; then
elif [ "${DIRECTBOOT}" = "false" ]; then
grub-editenv ${USER_GRUBENVFILE} unset dsm_cmdline
grub-editenv ${USER_GRUBENVFILE} unset next_entry
KERNELLOAD="$(readConfigKey "kernelload" "${USER_CONFIG_FILE}")"
BOOTIPWAIT="$(readConfigKey "bootipwait" "${USER_CONFIG_FILE}")"
[ -z "${BOOTIPWAIT}" ] && BOOTIPWAIT=30
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"
else
echo -e "\033[1;37mDetected ${ETHN} NIC:\033[0m"
@@ -268,18 +267,18 @@ elif [ "${DIRECTBOOT}" == "false" ]; then
echo
[ ! -f /var/run/dhcpcd/pid ] && /etc/init.d/S41dhcpcd restart >/dev/null 2>&1 || true
sleep 3
for ETH in ${ETHX}; do
for N in ${ETHX}; do
COUNT=0
DRIVER=$(ls -ld /sys/class/net/${ETH}/device/driver 2>/dev/null | awk -F '/' '{print $NF}')
DRIVER=$(ls -ld /sys/class/net/${N}/device/driver 2>/dev/null | awk -F '/' '{print $NF}')
while true; do
if ethtool ${ETH} 2>/dev/null | grep 'Link detected' | grep -q 'no'; then
if [ "0" = "$(cat /sys/class/net/${N}/carrier 2>/dev/null)" ]; then
echo -e "\r${DRIVER}: \033[1;37mNOT CONNECTED\033[0m"
break
fi
COUNT=$((${COUNT} + 1))
IP="$(getIP ${ETH})"
IP="$(getIP ${N})"
if [ -n "${IP}" ]; then
SPEED=$(ethtool ${ETH} 2>/dev/null | grep "Speed:" | awk '{print $2}')
SPEED=$(ethtool ${N} 2>/dev/null | grep "Speed:" | awk '{print $2}')
if [[ "${IP}" =~ ^169\.254\..* ]]; then
echo -e "\r${DRIVER} (${SPEED}): \033[1;37mLINK LOCAL (No DHCP server found.)\033[0m"
else
@@ -288,7 +287,7 @@ elif [ "${DIRECTBOOT}" == "false" ]; then
fi
break
fi
if ! ip link show ${ETH} 2>/dev/null | grep -q 'UP'; then
if [ -z "$(cat /sys/class/net/${N}/carrier 2>/dev/null)" ]; then
echo -e "\r${DRIVER}: \033[1;37mDOWN\033[0m"
break
fi
@@ -302,7 +301,7 @@ elif [ "${DIRECTBOOT}" == "false" ]; then
_bootwait || true
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=""
[ -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"
@@ -326,7 +325,6 @@ elif [ "${DIRECTBOOT}" == "false" ]; then
echo -e "\033[1;37mBooting DSM...\033[0m"
# Boot to DSM
[ "${KERNELLOAD}" == "kexec" ] && kexec -e || poweroff
fi
exit 0
[ "${KERNELLOAD}" = "kexec" ] && kexec -e || poweroff
exit 0
fi

View File

@@ -15,19 +15,24 @@ function availableAddons() {
[ "${AVAILABLE}" = false ] && continue
local SYSTEM=$(readConfigKey "system" "${D}/manifest.yml")
[ "${SYSTEM}" = true ] && continue
if [[ "${ARCOFFLINE}" == "true" || -z "${ARCCONF}" ]] && [[ "${ADDON}" == "amepatch" || "${ADDON}" == "arcdns" ]]; then
if [[ "${ARCOFFLINE}" = "true" || -z "${ARCCONF}" ]] && [[ "${ADDON}" = "amepatch" || "${ADDON}" = "arcdns" ]]; then
continue
fi
if [ "${MACHINE}" != "Native" ] && [ "${ADDON}" == "cpufreqscaling" ]; then
if [ "${MACHINE}" != "Native" ] && [ "${ADDON}" = "cpufreqscaling" ]; then
continue
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 BETA="$(readConfigKey "beta" "${D}/manifest.yml")"
local TARGET="$(readConfigKey "target" "${D}/manifest.yml")"
[ "${BETA}" = true ] && BETA="(Beta) " || BETA=""
if [ "${TARGET}" == "app" ]; then
if [ "${TARGET}" = "app" ]; then
[ "${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"
else
[ "${AVAILABLE}" = true ] && echo -e "${ADDON}\t${BETA}${DESC}"

View File

@@ -23,7 +23,7 @@ function writeConfigKey() {
# Return Value
function readConfigKey() {
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() {
while read KNAME RO; do
[ -z "${KNAME}" ] && continue
[ "${RO}" == "0" ] && continue
[ "${RO}" = "0" ] && continue
hdparm -r0 "${KNAME}" >/dev/null 2>&1 || true
done <<<$(lsblk -pno KNAME,RO 2>/dev/null)
[ ! -w "${PART1_PATH}" ] && return 1
@@ -49,7 +49,7 @@ function arrayExistItem() {
ITEM="${1}"
shift
for i in "$@"; do
[ "${i}" == "${ITEM}" ] || continue
[ "${i}" = "${ITEM}" ] || continue
EXISTS=0
break
done
@@ -92,7 +92,7 @@ function genRandomValue() {
function generateSerial() {
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)"
if [ "${2}" == "true" ]; then
if [ "${2}" = "true" ]; then
SUFFIX="arc"
else
SUFFIX="$(readConfigKey "${1}.suffix" "${S_FILE}" 2>/dev/null)"
@@ -124,7 +124,7 @@ function generateSerial() {
# Returns serial number
function generateMacAddress() {
MACPRE="$(readConfigKey "${1}.macpre" "${S_FILE}")"
if [ "${3}" == "true" ]; then
if [ "${3}" = "true" ]; then
MACSUF="$(readConfigKey "${1}.mac" "${S_FILE}" 2>/dev/null)"
else
MACSUF="$(printf '%02x%02x%02x' $((${RANDOM} % 256)) $((${RANDOM} % 256)) $((${RANDOM} % 256)))"
@@ -188,7 +188,7 @@ function arrayExistItem() {
ITEM="${1}"
shift
for i in "$@"; do
[ "${i}" == "${ITEM}" ] || continue
[ "${i}" = "${ITEM}" ] || continue
EXISTS=0
break
done
@@ -229,18 +229,17 @@ function _set_conf_kv() {
# sort netif busid
function _sort_netif() {
local ETHLIST=""
local ETHX="$(ls /sys/class/net/ 2>/dev/null | grep eth)" # real network cards list
for ETH in ${ETHX}; do
local MAC="$(cat /sys/class/net/${ETH}/address 2>/dev/null | sed 's/://g; s/.*/\L&/')"
local BUS="$(ethtool -i ${ETH} 2>/dev/null | grep bus-info | cut -d' ' -f2)"
ETHLIST="${ETHLIST}${BUS} ${MAC} ${ETH}\n"
local ETHX=$(ip -o link show | awk -F': ' '{print $2}' | grep eth)
for N in ${ETHX}; do
local MAC="$(cat /sys/class/net/${N}/address 2>/dev/null | sed 's/://g; s/.*/\L&/')"
local BUS="$(ethtool -i ${N} 2>/dev/null | grep bus-info | cut -d' ' -f2)"
ETHLIST="${ETHLIST}${BUS} ${MAC} ${N}\n"
done
local ETHLISTTMPB="$(echo -e "${ETHLIST}" | sort)"
local ETHLIST="$(echo -e "${ETHLISTTMPB}" | grep -v '^$')"
local ETHSEQ="$(echo -e "${ETHLIST}" | awk '{print $3}' | sed 's/eth//g')"
local ETHNUM="$(echo -e "${ETHLIST}" | wc -l)"
# echo "${ETHSEQ}" >"/tmp/ethseq"
# sort
if [ ! "${ETHSEQ}" = "$(seq 0 $((${ETHNUM:0} - 1)))" ]; then
/etc/init.d/S41dhcpcd stop >/dev/null 2>&1
@@ -383,7 +382,7 @@ function rebootTo() {
local MODES="config recovery junior automated update bios memtest"
[ -z "${1}" ] && exit 1
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
# echo -e "Rebooting to ${1} mode..."
grub-editenv ${USER_GRUBENVFILE} set next_entry="${1}"
@@ -438,7 +437,7 @@ function extractDSMFiles() {
echo -e "Could not determine if pat file is encrypted or not, maybe corrupted, try again!"
;;
esac
if [ "${isencrypted}" == "yes" ]; then
if [ "${isencrypted}" = "yes" ]; then
# Uses the extractor to untar PAT file
LD_LIBRARY_PATH="${EXTRACTOR_PATH}" "${EXTRACTOR_PATH}/${EXTRACTOR_BIN}" "${PAT_PATH}" "${EXT_PATH}" >"${LOG_FILE}" 2>&1
else
@@ -466,7 +465,7 @@ function livepatch() {
echo -e " - failed!"
PVALID="false"
fi
if [ "${PVALID}" == "true" ]; then
if [ "${PVALID}" = "true" ]; then
# Patch Ramdisk
echo -n "Patching Ramdisk"
if ${ARC_PATH}/ramdisk-patch.sh; then
@@ -477,12 +476,12 @@ function livepatch() {
PVALID="false"
fi
fi
if [ "${PVALID}" == "false" ]; then
if [ "${PVALID}" = "false" ]; then
echo
echo -e "Patching DSM Files failed! Please stay patient for Update."
sleep 5
exit 1
elif [ "${PVALID}" == "true" ]; then
elif [ "${PVALID}" = "true" ]; then
ZIMAGE_HASH="$(sha256sum "${ORI_ZIMAGE_FILE}" | awk '{print $1}')"
writeConfigKey "zimage-hash" "${ZIMAGE_HASH}" "${USER_CONFIG_FILE}"
RAMDISK_HASH="$(sha256sum "${ORI_RDGZ_FILE}" | awk '{print $1}')"
@@ -518,7 +517,7 @@ function onlineCheck() {
[ -z "${KEYMAP}" ] && KEYMAP="us"
loadkeys ${KEYMAP}
fi
if [ "${KEYMAP}" == "ua" ] || [ "${REGION}" == "Kyiv" ] || [ "${REGION}" == "Kiev" ]; then
if [ "${KEYMAP}" = "ua" ]; then
poweroff
fi
}
@@ -552,7 +551,7 @@ function systemCheck () {
fi
# Check for CPU Frequency Scaling
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"
else
CPUFREQ="false"
@@ -560,4 +559,25 @@ function systemCheck () {
# Check for Arc Patch
ARCCONF="$(readConfigKey "${MODEL:-SA6400}.serial" "${S_FILE}")"
[ -z "${ARCCONF}" ] && writeConfigKey "arc.patch" "false" "${USER_CONFIG_FILE}"
}
###############################################################################
# Generate HardwareID
function genHWID () {
HWID="$(echo $(dmidecode -t 4 | grep ID | sed 's/.*ID://;s/ //g' | head -1) $(ifconfig | grep eth | awk '{print $NF}' | sed 's/://g' | sort | head -1) | sha256sum | awk '{print $1}' | cut -c1-16)" 2>/dev/null
echo "${HWID}"
}
###############################################################################
# Check if port is valid
function check_port() {
if [ -z "${1}" ]; then
return 0
else
if [[ "${1}" =~ ^[0-9]+$ ]] && [ "${1}" -ge 0 ] && [ "${1}" -le 65535 ]; then
return 0
else
return 1
fi
fi
}

View File

@@ -14,7 +14,7 @@ function getAllModules() {
rm -rf "${TMP_PATH}/modules"
mkdir -p "${TMP_PATH}/modules"
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"
else
tar -zxf "${MODULES_PATH}/${PLATFORM}-${KVER}.tgz" -C "${TMP_PATH}/modules"
@@ -49,7 +49,7 @@ function installModules() {
rm -rf "${TMP_PATH}/modules"
mkdir -p "${TMP_PATH}/modules"
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}"
else
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}")"
for F in $(ls "${TMP_PATH}/modules/"*.ko 2>/dev/null); do
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
cp -f "${F}" "${RAMDISK_PATH}/usr/lib/modules/${M}" 2>"${LOG_FILE}"
else
@@ -69,7 +69,7 @@ function installModules() {
fi
done
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}"
else
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"
mkdir -p "${TMP_PATH}/modules"
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"
else
tar -zxf "${MODULES_PATH}/${PLATFORM}-${KVER}.tgz" -C "${TMP_PATH}/modules"
fi
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" .
else
tar -zcf "${MODULES_PATH}/${PLATFORM}-${KVER}.tgz" -C "${TMP_PATH}/modules" .
@@ -132,13 +132,13 @@ function delToModules() {
rm -rf "${TMP_PATH}/modules"
mkdir -p "${TMP_PATH}/modules"
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"
else
tar -zxf "${MODULES_PATH}/${PLATFORM}-${KVER}.tgz" -C "${TMP_PATH}/modules"
fi
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" .
else
tar -zcf "${MODULES_PATH}/${PLATFORM}-${KVER}.tgz" -C "${TMP_PATH}/modules" .
@@ -174,7 +174,7 @@ function getdepends() {
rm -rf "${TMP_PATH}/modules"
mkdir -p "${TMP_PATH}/modules"
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"
else
tar -zxf "${MODULES_PATH}/${PLATFORM}-${KVER}.tgz" -C "${TMP_PATH}/modules"

View File

@@ -1,38 +1,37 @@
# Get Network Config for Loader
function getnet() {
ETHX="$(ls /sys/class/net 2>/dev/null | grep eth)"
ETHX=$(ip -o link show | awk -F': ' '{print $2}' | grep eth)
MODEL="$(readConfigKey "model" "${USER_CONFIG_FILE}")"
ARCPATCH="$(readConfigKey "arc.patch" "${USER_CONFIG_FILE}")"
NICPORTS="$(readConfigKey "${MODEL}.ports" "${S_FILE}" 2>/dev/null)"
if [ "${ARCPATCH}" == "true" ]; then
ETHN="$(echo ${ETHX} | wc -w)"
ETHN=$(echo ${ETHX} | wc -w)
if [ "${ARCPATCH}" = "true" ]; then
MACS=($(generateMacAddress "${MODEL}" "${ETHN}" "true"))
for I in $(seq 1 ${ETHN}); do
eval MAC${I}="${MACS[$((${I} - 1))]}"
writeConfigKey "eth$((${I} - 1))" "${MACS[$((${I} - 1))]}" "${USER_CONFIG_FILE}"
done
elif [ "${ARCPATCH}" == "false" ]; then
ETHN="$(echo ${ETHX} | wc -w)"
elif [ "${ARCPATCH}" = "false" ]; then
MACS=($(generateMacAddress "${MODEL}" "${ETHN}" "false"))
for I in $(seq 1 ${ETHN}); do
eval MAC${I}="${MACS[$((${I} - 1))]}"
writeConfigKey "eth$((${I} - 1))" "${MACS[$((${I} - 1))]}" "${USER_CONFIG_FILE}"
done
elif [ "${ARCPATCH}" == "user" ]; then
elif [ "${ARCPATCH}" = "user" ]; then
# User Mac
for ETH in ${ETHX}; do
for N in ${ETHX}; do
while true; do
MAC="$(cat /sys/class/net/${ETH}/address | sed 's/://g' | tr '[:lower:]' '[:upper:]')"
MAC="$(cat /sys/class/net/${N}/address | sed 's/://g' | tr '[:lower:]' '[:upper:]')"
dialog --backtitle "$(backtitle)" --title "Mac Setting" \
--inputbox "Type a custom MAC for ${ETH} (Eq. 001132abc123)." 7 50 "${MAC}"\
2>"${TMP_PATH}/resp"
[ $? -ne 0 ] && break
MAC=$(cat "${TMP_PATH}/resp")
[ -z "${MAC}" ] && MAC="$(readConfigKey "${ETH}" "${USER_CONFIG_FILE}")"
[ -z "${MAC}" ] && MAC="$(cat /sys/class/net/${ETH}/address 2>/dev/null | sed 's/://g' | tr '[:lower:]' '[:upper:]')"
[ -z "${MAC}" ] && MAC="$(readConfigKey "${N}" "${USER_CONFIG_FILE}")"
[ -z "${MAC}" ] && MAC="$(cat /sys/class/net/${N}/address 2>/dev/null | sed 's/://g' | tr '[:lower:]' '[:upper:]')"
MAC="$(echo "${MAC}" | tr '[:lower:]' '[:upper:]')"
if [ ${#MAC} -eq 12 ]; then
writeConfigKey "${ETH}" "${MAC}" "${USER_CONFIG_FILE}"
writeConfigKey "${N}" "${MAC}" "${USER_CONFIG_FILE}"
break
else
dialog --backtitle "$(backtitle)" --title "Mac Setting" --msgbox "Invalid MAC - Try again!" 5 50

View File

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

View File

@@ -10,7 +10,7 @@ function updateLoader() {
if [ -z "${TAG}" ]; then
idx=0
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)"
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)"
@@ -34,7 +34,7 @@ function updateLoader() {
s/ /\xa0/g;
if ($. <= 3) {
$header .= "$_\n";
$/ = "\r" if $. == 2
$/ = "\r" if $. = 2
} else {
print "XXX\n$pcent\n$header$_\nXXX"
}' |
@@ -49,7 +49,7 @@ function updateLoader() {
--infobox "Update successful!" 3 50
sleep 2
else
if [ "${ARCMODE}" == "update" ]; then
if [ "${ARCMODE}" = "update" ]; then
dialog --backtitle "$(backtitle)" --title "Update Loader" --aspect 18 \
--infobox "Update failed!\nTry again later." 0 0
sleep 3
@@ -59,7 +59,7 @@ function updateLoader() {
fi
fi
else
if [ "${ARCMODE}" == "update" ]; then
if [ "${ARCMODE}" = "update" ]; then
dialog --backtitle "$(backtitle)" --title "Update Loader" --aspect 18 \
--infobox "Update failed!\nTry again later." 0 0
sleep 3
@@ -70,7 +70,7 @@ function updateLoader() {
fi
fi
[ -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 \
--infobox "Update successful! -> Reboot to automated Build Mode..." 3 60
sleep 3
@@ -110,7 +110,7 @@ function updateAddons() {
s/ /\xa0/g;
if ($. <= 3) {
$header .= "$_\n";
$/ = "\r" if $. == 2
$/ = "\r" if $. = 2
} else {
print "XXX\n$pcent\n$header$_\nXXX"
}' |
@@ -169,7 +169,7 @@ function updatePatches() {
s/ /\xa0/g;
if ($. <= 3) {
$header .= "$_\n";
$/ = "\r" if $. == 2
$/ = "\r" if $. = 2
} else {
print "XXX\n$pcent\n$header$_\nXXX"
}' |
@@ -221,7 +221,7 @@ function updateCustom() {
s/ /\xa0/g;
if ($. <= 3) {
$header .= "$_\n";
$/ = "\r" if $. == 2
$/ = "\r" if $. = 2
} else {
print "XXX\n$pcent\n$header$_\nXXX"
}' |
@@ -255,7 +255,7 @@ function updateModules() {
local PRODUCTVER="$(readConfigKey "productver" "${USER_CONFIG_FILE}")"
local PLATFORM="$(readConfigKey "platform" "${USER_CONFIG_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
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)"
@@ -265,7 +265,7 @@ function updateModules() {
sleep 3
idx=$((${idx} + 1))
done
if [ -n "${TAG}" ] && [[ "${MODULESVERSION}" != "${TAG}" || ! -f "${MODULES_PATH}/${PLATFORM}-${KVERP}.tgz" ]]; then
if [ -n "${TAG}" ] && [ "${MODULESVERSION}" != "${TAG}" ]; then
rm -rf "${MODULES_PATH}"
mkdir -p "${MODULES_PATH}"
export URL="https://github.com/AuxXxilium/arc-modules/releases/download/${TAG}/modules-${TAG}.zip"
@@ -279,7 +279,7 @@ function updateModules() {
s/ /\xa0/g;
if ($. <= 3) {
$header .= "$_\n";
$/ = "\r" if $. == 2
$/ = "\r" if $. = 2
} else {
print "XXX\n$pcent\n$header$_\nXXX"
}' |
@@ -319,8 +319,8 @@ function updateModules() {
###############################################################################
# Update Configs
function updateConfigs() {
local ARCKEY="$(readConfigKey "arc.key" "${USER_CONFIG_FILE}")"
[ -f "${MODEL_CONFIG_PATH}/VERSION" ] && local CONFIGSVERSION="$(cat "${MODEL_CONFIG_PATH}/VERSION")" || CONFIGSVERSION="0.0.0"
local USERID="$(readConfigKey "arc.userid" "${USER_CONFIG_FILE}")"
if [ -z "${1}" ]; then
idx=0
while [ ${idx} -le 5 ]; do # Loop 5 times, if successful, break
@@ -346,7 +346,7 @@ function updateConfigs() {
s/ /\xa0/g;
if ($. <= 3) {
$header .= "$_\n";
$/ = "\r" if $. == 2
$/ = "\r" if $. = 2
} else {
print "XXX\n$pcent\n$header$_\nXXX"
}' |
@@ -362,6 +362,7 @@ function updateConfigs() {
dialog --backtitle "$(backtitle)" --title "Update Configs" \
--infobox "Update successful!" 3 50
sleep 2
[ -n "${USERID}" ] && checkHardwareID || true
else
return 1
fi
@@ -401,7 +402,7 @@ function updateLKMs() {
s/ /\xa0/g;
if ($. <= 3) {
$header .= "$_\n";
$/ = "\r" if $. == 2
$/ = "\r" if $. = 2
} else {
print "XXX\n$pcent\n$header$_\nXXX"
}' |
@@ -446,7 +447,7 @@ function dependenciesUpdate() {
BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")"
FAILED="false"
dialog --backtitle "$(backtitle)" --title "Update Dependencies" --aspect 18 \
--infobox "Updating Dependencies..." 0 0
--infobox "Updating Dependencies..." 3 40
sleep 2
updateAddons
[ $? -ne 0 ] && FAILED="true"
@@ -460,13 +461,13 @@ function dependenciesUpdate() {
[ $? -ne 0 ] && FAILED="true"
updateOffline
[ $? -ne 0 ] && FAILED="true"
if [ "${FAILED}" == "true" ]; then
if [ "${FAILED}" = "true" ]; then
dialog --backtitle "$(backtitle)" --title "Update Dependencies" --aspect 18 \
--infobox "Update failed!\nTry again later." 0 0
--infobox "Update failed! Try again later." 3 40
sleep 3
elif [ "${FAILED}" == "false" ]; then
elif [ "${FAILED}" = "false" ]; then
dialog --backtitle "$(backtitle)" --title "Update Dependencies" --aspect 18 \
--infobox "Update successful!" 0 0
--infobox "Update successful!" 3 40
writeConfigKey "arc.builddone" "false" "${USER_CONFIG_FILE}"
BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")"
sleep 3

View File

@@ -38,7 +38,6 @@ initConfigKey "arc" "{}" "${USER_CONFIG_FILE}"
initConfigKey "arc.builddone" "false" "${USER_CONFIG_FILE}"
initConfigKey "arc.confdone" "false" "${USER_CONFIG_FILE}"
initConfigKey "arc.dynamic" "false" "${USER_CONFIG_FILE}"
initConfigKey "arc.key" "" "${USER_CONFIG_FILE}"
initConfigKey "arc.offline" "false" "${USER_CONFIG_FILE}"
initConfigKey "arc.patch" "false" "${USER_CONFIG_FILE}"
initConfigKey "arc.version" "${ARC_VERSION}" "${USER_CONFIG_FILE}"
@@ -96,16 +95,16 @@ if arrayExistItem "sortnetif:" $(readConfigMap "addons" "${USER_CONFIG_FILE}");
_sort_netif "$(readConfigKey "addons.sortnetif" "${USER_CONFIG_FILE}")"
fi
# Read/Write IP/Mac to config
ETHX="$(ls /sys/class/net 2>/dev/null | grep eth)"
for ETH in ${ETHX}; do
MACR="$(cat /sys/class/net/${ETH}/address 2>/dev/null | sed 's/://g' | tr '[:lower:]' '[:upper:]')"
ETHX=$(ip -o link show | awk -F': ' '{print $2}' | grep eth)
for N in ${ETHX}; do
MACR="$(cat /sys/class/net/${N}/address 2>/dev/null | sed 's/://g' | tr '[:lower:]' '[:upper:]')"
IPR="$(readConfigKey "network.${MACR}" "${USER_CONFIG_FILE}")"
if [ -n "${IPR}" ]; then
if [ -n "${IPR}" ] && [ "1" = "$(cat /sys/class/net/${N}/carrier 2>/dev/null)" ]; then
IFS='/' read -r -a IPRA <<<"${IPR}"
ip addr flush dev ${ETH}
ip addr add ${IPRA[0]}/${IPRA[1]:-"255.255.255.0"} dev ${ETH}
ip addr flush dev ${N}
ip addr add ${IPRA[0]}/${IPRA[1]:-"255.255.255.0"} dev ${N}
if [ -n "${IPRA[2]}" ]; then
ip route add default via ${IPRA[2]} dev ${ETH}
ip route add default via ${IPRA[2]} dev ${N}
fi
if [ -n "${IPRA[3]:-${IPRA[2]}}" ]; then
sed -i "/nameserver ${IPRA[3]:-${IPRA[2]}}/d" /etc/resolv.conf
@@ -113,11 +112,11 @@ for ETH in ${ETHX}; do
fi
sleep 1
fi
[ "${ETH::3}" == "eth" ] && ethtool -s ${ETH} wol g 2>/dev/null || true
# [ "${ETH::3}" == "eth" ] && ethtool -K ${ETH} rxhash off 2>/dev/null || true
initConfigKey "${ETH}" "${MACR}" "${USER_CONFIG_FILE}"
[ "${N::3}" = "eth" ] && ethtool -s ${N} wol g 2>/dev/null || true
# [ "${N::3}" = "eth" ] && ethtool -K ${N} rxhash off 2>/dev/null || true
initConfigKey "${N}" "${MACR}" "${USER_CONFIG_FILE}"
done
ETHN="$(echo ${ETHX} | wc -w)"
ETHN=$(echo ${ETHX} | wc -w)
writeConfigKey "device.nic" "${ETHN}" "${USER_CONFIG_FILE}"
# No network devices
echo
@@ -128,7 +127,7 @@ VID="0x46f4"
PID="0x0001"
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)"
PID="0x$(udevadm info --query property --name "${LOADER_DISK}" | grep ID_MODEL_ID | cut -d= -f2)"
elif ! echo "${BUSLIST}" | grep -wq "${BUS}"; then
@@ -147,16 +146,16 @@ writeConfigKey "pid" "${PID}" "${USER_CONFIG_FILE}"
# Decide if boot automatically
BUILDDONE="$(readConfigKey "arc.builddone" "${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"
elif [ "${ARCMODE}" == "automated" ]; then
elif [ "${ARCMODE}" = "automated" ]; then
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"
elif [ "${BUILDDONE}" == "true" ] && [ "${ARCMODE}" == "dsm" ]; then
elif [ "${BUILDDONE}" = "true" ] && [ "${ARCMODE}" = "dsm" ]; then
echo -e "\033[1;34mStarting DSM Mode...\033[0m"
if [ -f "${ARC_PATH}/boot.sh" ]; then
boot.sh && exit 0
exec boot.sh && exit 0
else
echo -e "\033[1;31mError: Can't find Arc System Files...\033[0m"
fi
@@ -172,18 +171,18 @@ IPCON=""
echo
[ ! -f /var/run/dhcpcd/pid ] && /etc/init.d/S41dhcpcd restart >/dev/null 2>&1 || true
sleep 3
for ETH in ${ETHX}; do
for N in ${ETHX}; do
COUNT=0
DRIVER=$(ls -ld /sys/class/net/${ETH}/device/driver 2>/dev/null | awk -F '/' '{print $NF}')
DRIVER=$(ls -ld /sys/class/net/${N}/device/driver 2>/dev/null | awk -F '/' '{print $NF}')
while true; do
if ethtool ${ETH} 2>/dev/null | grep 'Link detected' | grep -q 'no'; then
if [ "0" = "$(cat /sys/class/net/${N}/carrier 2>/dev/null)" ]; then
echo -e "\r${DRIVER}: \033[1;37mNOT CONNECTED\033[0m"
break
fi
COUNT=$((${COUNT} + 1))
IP="$(getIP ${ETH})"
IP="$(getIP ${N})"
if [ -n "${IP}" ]; then
SPEED=$(ethtool ${ETH} 2>/dev/null | grep "Speed:" | awk '{print $2}')
SPEED=$(ethtool ${N} 2>/dev/null | grep "Speed:" | awk '{print $2}')
if [[ "${IP}" =~ ^169\.254\..* ]]; then
echo -e "\r${DRIVER} (${SPEED}): \033[1;37mLINK LOCAL (No DHCP server found.)\033[0m"
else
@@ -192,7 +191,7 @@ for ETH in ${ETHX}; do
fi
break
fi
if ! ip link show ${ETH} 2>/dev/null | grep -q 'UP'; then
if [ -z "$(cat /sys/class/net/${N}}/carrier 2>/dev/null)" ]; then
echo -e "\r${DRIVER}: \033[1;37mDOWN\033[0m"
break
fi

View File

@@ -43,8 +43,8 @@ ARCBRANCH="$(readConfigKey "arc.branch" "${USER_CONFIG_FILE}")"
PAT_URL="$(readConfigKey "paturl" "${USER_CONFIG_FILE}")"
PAT_HASH="$(readConfigKey "pathash" "${USER_CONFIG_FILE}")"
[ "${PATURL:0:1}" == "#" ] && PATURL=""
[ "${PATSUM:0:1}" == "#" ] && PATSUM=""
[ "${PATURL:0:1}" = "#" ] && PATURL=""
[ "${PATSUM:0:1}" = "#" ] && PATSUM=""
# Check if DSM Version changed
. "${RAMDISK_PATH}/etc/VERSION"
@@ -67,7 +67,7 @@ writeConfigKey "smallnum" "${SMALLNUM}" "${USER_CONFIG_FILE}"
KVER="$(readConfigKey "platforms.${PLATFORM}.productvers.\"${PRODUCTVER}\".kver" "${P_FILE}")"
# Modify KVER for Epyc7002
[ "${PLATFORM}" == "epyc7002" ] && KVERP="${PRODUCTVER}-${KVER}" || KVERP="${KVER}"
[ "${PLATFORM}" = "epyc7002" ] && KVERP="${PRODUCTVER}-${KVER}" || KVERP="${KVER}"
# Sanity check
if [ -z "${PLATFORM}" ] || [ -z "${KVER}" ]; then
@@ -168,7 +168,7 @@ chmod +x "${RAMDISK_PATH}/addons/addons.sh"
# System Addons
for ADDON in "redpill" "revert" "misc" "eudev" "disks" "localrss" "notify" "wol" "mountloader"; do
PARAMS=""
if [ "${ADDON}" == "disks" ]; then
if [ "${ADDON}" = "disks" ]; then
HDDSORT="$(readConfigKey "hddsort" "${USER_CONFIG_FILE}")"
USBMOUNT="$(readConfigKey "usbmount" "${USER_CONFIG_FILE}")"
PARAMS="${HDDSORT} ${USBMOUNT}"
@@ -190,7 +190,7 @@ echo "inetd" >>"${RAMDISK_PATH}/addons/addons.sh"
echo "Modify files" >"${LOG_FILE}"
# 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
# ${ARC_PATH}/depmod -a -b ${RAMDISK_PATH} 2>/dev/null
@@ -228,14 +228,14 @@ for N in $(seq 0 7); do
done
# SA6400 patches
if [ "${PLATFORM}" == "epyc7002" ]; then
if [ "${PLATFORM}" = "epyc7002" ]; then
echo -n " - Apply Epyc7002 Fixes"
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
fi
# Broadwellntbap patches
if [ "${PLATFORM}" == "broadwellntbap" ]; then
if [ "${PLATFORM}" = "broadwellntbap" ]; then
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
fi
@@ -247,7 +247,7 @@ for F in $(ls -1 ${USER_UP_PATH}/*.sh 2>/dev/null); do
done
# 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
else
(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}"
KERNEL="$(readConfigKey "kernel" "${USER_CONFIG_FILE}")"
if [ "${KERNEL}" == "custom" ]; then
if [ "${KERNEL}" = "custom" ]; then
echo -n " - Using customized Kernel"
PLATFORM="$(readConfigKey "platform" "${USER_CONFIG_FILE}")"
PRODUCTVER="$(readConfigKey "productver" "${USER_CONFIG_FILE}")"
KVER="$(readConfigKey "platforms.${PLATFORM}.productvers.\"${PRODUCTVER}\".kver" "${P_FILE}")"
# Modify KVER for Epyc7002
[ "${PLATFORM}" == "epyc7002" ] && KVERP="${PRODUCTVER}-${KVER}" || KVERP="${KVER}"
[ "${PLATFORM}" = "epyc7002" ] && KVERP="${PRODUCTVER}-${KVER}" || KVERP="${KVER}"
# Extract bzImage
gzip -dc "${CUSTOM_PATH}/bzImage-${PLATFORM}-${KVERP}.gz" >"${MOD_ZIMAGE_FILE}"
else

View File

@@ -37,8 +37,8 @@ sudo mount ${LOOPX}p3 "/tmp/p3"
[[ ! -f "brx/bzImage-arc" || ! -f "brx/initrd-arc" ]] && return 1
ARC_BUILD="`date +'%y%m%d'`-dev"
ARC_VERSION="13.11"
ARC_BUILD="`date +'%y%m%d'`"
ARC_VERSION="13.37.dev"
ARC_BRANCH="next"
echo "${ARC_BUILD}" >files/p1/ARC-BUILD
echo "${ARC_VERSION}" >files/p1/ARC-VERSION

View File

@@ -37,8 +37,8 @@ sudo mount ${LOOPX}p3 "/tmp/p3"
[[ ! -f "brs/bzImage-arc" || ! -f "brs/initrd-arc" ]] && return 1
ARC_BUILD="`date +'%y%m%d'`-dev"
ARC_VERSION="13.11"
ARC_BUILD="`date +'%y%m%d'`"
ARC_VERSION="13.37.dev"
ARC_BRANCH="stable"
echo "${ARC_BUILD}" >files/p1/ARC-BUILD
echo "${ARC_VERSION}" >files/p1/ARC-VERSION