Compare commits

...

16 Commits
1.5.4 ... 1.5.8

Author SHA1 Message Date
AuxXxilium
62b8ec0a0b Merge pull request #6057 from AuxXxilium/dev
grub: update 2025-01-31 20:56:38
2025-01-31 20:57:32 +01:00
AuxXxilium
b4874b6e77 grub: update 2025-01-31 20:56:38 2025-01-31 20:56:38 +01:00
AuxXxilium
5a4d341267 Merge pull request #6056 from AuxXxilium/dev
Dev
2025-01-31 20:48:13 +01:00
AuxXxilium
1ea4215393 grub: shrink it down
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2025-01-31 20:47:52 +01:00
AuxXxilium
95c7032602 boot: add more informations
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2025-01-31 20:39:58 +01:00
AuxXxilium
2877465fb4 boot: back to old
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2025-01-31 20:00:50 +01:00
AuxXxilium
bd156aff6e update: fix
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2025-01-31 19:07:25 +01:00
AuxXxilium
7746eb3ca7 arc: cleanup
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2025-01-31 17:41:55 +01:00
AuxXxilium
c4a6d4ccd3 tree: rewrite menu function
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2025-01-31 16:50:23 +01:00
AuxXxilium
5310500b1a arc/evo: rewrite to "no IP"
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2025-01-31 16:48:41 +01:00
AuxXxilium
b89c67f115 arc: add local backup feature for hardware encryption key
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2025-01-31 16:47:50 +01:00
AuxXxilium
5b7e4e68cc arc: add offline update feature
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2025-01-31 16:22:10 +01:00
AuxXxilium
ac5d39ec71 boot: temp disable boot interrupt
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2025-01-30 23:59:10 +01:00
AuxXxilium
23142cefb5 tree: fix
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2025-01-30 23:56:11 +01:00
AuxXxilium
6d90c3a187 arc: set correct ports
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2025-01-29 21:17:20 +01:00
AuxXxilium
b23429fdc6 tree: more optimization
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2025-01-29 17:19:44 +01:00
11 changed files with 427 additions and 420 deletions

View File

@@ -1,5 +1,5 @@
#
# Copyright (C) 2023 AuxXxilium <https://github.com/AuxXxilium>
# Copyright (C) 2025 AuxXxilium <https://github.com/AuxXxilium>
#
# This is free software, licensed under the MIT License.
# See /LICENSE for more information.
@@ -33,7 +33,7 @@ jobs:
- name: Make Grub
run: |
rm -f grub.img.gz
rm -f "files/initrd/opt/arc/grub.img.gz"
. scripts/grub.sh "grub-2.12" "i386-pc i386-efi x86_64-efi" "ARC"
- name: Check and Push

View File

@@ -40,7 +40,7 @@ function arcModel() {
[ "${DT}" = "true" ] && HBAS="" || HBAS="x"
[ "${M}" = "SA6400" ] && HBAS="x"
[ "${DT}" = "false" ] && USBS="int/ext" || USBS="ext"
M_2_CACHE="x"
[[ "${M}" = "DS719+" || "${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+" || "${DT}" = "false" ]] && M_2_STORAGE="" || M_2_STORAGE="+"
# Check id model is compatible with CPU
@@ -267,7 +267,7 @@ function arcVersion() {
if [ ${NVMEDRIVES} -gt 0 ]; then
if [ "${PLATFORM}" = "epyc7002" ] && [ ${SATADRIVES} -eq 0 ] && [ ${SASDRIVES} -eq 0 ]; then
initConfigKey "addons.nvmesystem" "" "${USER_CONFIG_FILE}"
elif [ "${DT}" = "true"]; then
elif [ "${DT}" = "true" ]; then
initConfigKey "addons.nvmevolume" "" "${USER_CONFIG_FILE}"
fi
fi
@@ -547,7 +547,7 @@ function arcSummary() {
0)
make
;;
3|255)
*)
return 0
;;
esac
@@ -680,231 +680,6 @@ function boot() {
fi
}
###############################################################################
# Read Data
function readData() {
# Get DSM Data from Config
MODEL="$(readConfigKey "model" "${USER_CONFIG_FILE}")"
MODELID="$(readConfigKey "modelid" "${USER_CONFIG_FILE}")"
LKM="$(readConfigKey "lkm" "${USER_CONFIG_FILE}")"
if [ -n "${MODEL}" ]; then
DT="$(readConfigKey "platforms.${PLATFORM}.dt" "${P_FILE}")"
PRODUCTVER="$(readConfigKey "productver" "${USER_CONFIG_FILE}")"
PLATFORM="$(readConfigKey "platform" "${USER_CONFIG_FILE}")"
fi
# Get Arc Data from Config
ARCPATCH="$(readConfigKey "arc.patch" "${USER_CONFIG_FILE}")"
HARDWAREID="$(genHWID)"
USERID="$(readConfigKey "arc.userid" "${USER_CONFIG_FILE}")"
EXTERNALCONTROLLER="$(readConfigKey "device.externalcontroller" "${USER_CONFIG_FILE}")"
SATACONTROLLER="$(readConfigKey "device.satacontroller" "${USER_CONFIG_FILE}")"
SCSICONTROLLER="$(readConfigKey "device.scsicontroller" "${USER_CONFIG_FILE}")"
RAIDCONTROLLER="$(readConfigKey "device.raidcontroller" "${USER_CONFIG_FILE}")"
SASCONTROLLER="$(readConfigKey "device.sascontroller" "${USER_CONFIG_FILE}")"
# Advanced Config
if [ "${CONFDONE}" = "true" ]; then
BOOTIPWAIT="$(readConfigKey "bootipwait" "${USER_CONFIG_FILE}")"
DIRECTBOOT="$(readConfigKey "directboot" "${USER_CONFIG_FILE}")"
EMMCBOOT="$(readConfigKey "emmcboot" "${USER_CONFIG_FILE}")"
HDDSORT="$(readConfigKey "hddsort" "${USER_CONFIG_FILE}")"
USBMOUNT="$(readConfigKey "usbmount" "${USER_CONFIG_FILE}")"
KERNEL="$(readConfigKey "kernel" "${USER_CONFIG_FILE}")"
KERNELLOAD="$(readConfigKey "kernelload" "${USER_CONFIG_FILE}")"
KERNELPANIC="$(readConfigKey "kernelpanic" "${USER_CONFIG_FILE}")"
GOVERNOR="$(readConfigKey "governor" "${USER_CONFIG_FILE}")"
STORAGEPANEL="$(readConfigKey "addons.storagepanel" "${USER_CONFIG_FILE}")"
SEQUENTIALIO="$(readConfigKey "addons.sequentialio" "${USER_CONFIG_FILE}")"
ODP="$(readConfigKey "odp" "${USER_CONFIG_FILE}")"
RD_COMPRESSED="$(readConfigKey "rd-compressed" "${USER_CONFIG_FILE}")"
SATADOM="$(readConfigKey "satadom" "${USER_CONFIG_FILE}")"
REMAP="$(readConfigKey "arc.remap" "${USER_CONFIG_FILE}")"
if [ "${REMAP}" = "acports" ] || [ "${REMAP}" = "maxports" ]; then
PORTMAP="$(readConfigKey "cmdline.SataPortMap" "${USER_CONFIG_FILE}")"
DISKMAP="$(readConfigKey "cmdline.DiskIdxMap" "${USER_CONFIG_FILE}")"
elif [ "${REMAP}" = "remap" ]; then
PORTMAP="$(readConfigKey "cmdline.sata_remap" "${USER_CONFIG_FILE}")"
elif [ "${REMAP}" = "ahci" ]; then
PORTMAP="$(readConfigKey "cmdline.ahci_remap" "${USER_CONFIG_FILE}")"
elif [ "${REMAP}" = "user" ]; then
PORTMAP="user"
fi
if [[ "${REMAP}" = "acports" || "${REMAP}" = "maxports" ]]; then
SPORTMAP="SataPortMap: ${PORTMAP} | ${DISKMAP}"
elif [ "${REMAP}" = "remap" ]; then
SPORTMAP="SataRemap: ${PORTMAP}"
elif [ "${REMAP}" = "ahci" ]; then
SPORTMAP="AHCIRemap: ${PORTMAP}"
elif [ "${REMAP}" = "user" ]; then
SPORTMAP=""
[ -n "${PORTMAP}" ] && SPORTMAP+="SataPortMap: ${PORTMAP}"
[ -n "${DISKMAP}" ] && SPORTMAP+="DiskIdxMap: ${DISKMAP}"
[ -n "${PORTREMAP}" ] && SPORTMAP+="SataRemap: ${PORTREMAP}"
[ -n "${AHCIPORTREMAP}" ] && SPORTMAP+="AHCIRemap: ${AHCIPORTREMAP}"
fi
fi
# Get Config/Build Status
CONFDONE="$(readConfigKey "arc.confdone" "${USER_CONFIG_FILE}")"
BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")"
}
###############################################################################
# Advanced Menu
function advancedMenu() {
NEXT="a"
while true; do
rm -f "${TMP_PATH}/menu" "${TMP_PATH}/resp" >/dev/null 2>&1 || true
write_menu "=" "\Z4===== System ====\Zn"
if [ "${CONFDONE}" = "true" ]; then
if [ "${BOOTOPTS}" = "true" ]; then
write_menu "6" "\Z1Hide Boot Options\Zn"
write_menu_with_color "m" "Kernelload" "${KERNELLOAD}"
write_menu_with_color "E" "eMMC Boot Support" "${EMMCBOOT}"
if [ "${DIRECTBOOT}" = "false" ]; then
write_menu_with_color "i" "Boot IP Waittime" "${BOOTIPWAIT}"
fi
write_menu_with_color "q" "Directboot" "${DIRECTBOOT}"
write_menu_with_color "W" "RD Compression" "${RD_COMPRESSED}"
write_menu_with_color "X" "Sata DOM" "${SATADOM}"
write_menu_with_color "u" "LKM Version" "${LKM}"
else
write_menu "6" "\Z1Show Boot Options\Zn"
fi
if [ "${DSMOPTS}" = "true" ]; then
write_menu "7" "\Z1Hide DSM Options\Zn"
write_menu "=" "\Z4===== DSM =====\Zn"
write_menu "j" "Cmdline"
write_menu "k" "Synoinfo"
write_menu "N" "Add new User"
write_menu "t" "Change User Password"
write_menu "J" "Reset Network Config"
write_menu "T" "Disable all scheduled Tasks"
write_menu "M" "Mount DSM Storage Pool"
write_menu "l" "Edit User Config"
write_menu "s" "Allow Downgrade Version"
else
write_menu "7" "\Z1Show DSM Options\Zn"
fi
fi
if [ "${LOADEROPTS}" = "true" ]; then
write_menu "8" "\Z1Hide Loader Options\Zn"
write_menu "=" "\Z4===== Loader =====\Zn"
write_menu "D" "StaticIP for Loader/DSM"
write_menu "f" "Bootscreen Options"
write_menu "U" "Change Loader Password"
write_menu "Z" "Change Loader Ports"
write_menu "w" "Reset Loader to Defaults"
write_menu "L" "Grep Logs from dbgutils"
write_menu "B" "Grep DSM Config from Backup"
write_menu "=" "\Z1== Edit with caution! ==\Zn"
write_menu "C" "Clone Loader to another Disk"
write_menu "n" "Grub Bootloader Config"
write_menu "y" "Choose a Keymap for Loader"
write_menu "F" "\Z1Formate Disks\Zn"
else
write_menu "8" "\Z1Show Loader Options\Zn"
fi
dialog --clear --default-item ${NEXT} --backtitle "$(backtitle)" --title "Arc Config" --colors \
--cancel-label "Exit" \
--menu "" 0 0 0 --file "${TMP_PATH}/menu" \
2>"${TMP_PATH}/resp"
RET=$?
case ${RET} in
0)
resp=$(cat ${TMP_PATH}/resp)
[ -z "${resp}" ] && return
case ${resp} in
# DSM Section
7) [ "${DSMOPTS}" = "true" ] && DSMOPTS='false' || DSMOPTS='true'
DSMOPTS="${DSMOPTS}"
NEXT="7"
;;
j) cmdlineMenu; NEXT="j" ;;
k) synoinfoMenu; NEXT="k" ;;
l) editUserConfig; NEXT="l" ;;
s) downgradeMenu; NEXT="s" ;;
t) resetPassword; NEXT="t" ;;
N) addNewDSMUser; NEXT="N" ;;
J) resetDSMNetwork; NEXT="J" ;;
M) mountDSM; NEXT="M" ;;
T) disablescheduledTasks; NEXT="T" ;;
B) getbackup; NEXT="B" ;;
# Loader Section
8) [ "${LOADEROPTS}" = "true" ] && LOADEROPTS='false' || LOADEROPTS='true'
LOADEROPTS="${LOADEROPTS}"
NEXT="8"
;;
D) staticIPMenu; NEXT="D" ;;
f) bootScreen; NEXT="f" ;;
Z) loaderPorts; NEXT="Z" ;;
U) loaderPassword; NEXT="U" ;;
L) greplogs; NEXT="L" ;;
w) resetLoader; NEXT="w" ;;
C) cloneLoader; NEXT="C" ;;
n) editGrubCfg; NEXT="n" ;;
y) keymapMenu; NEXT="y" ;;
F) formatDisks; NEXT="F" ;;
6) [ "${BOOTOPTS}" = "true" ] && BOOTOPTS='false' || BOOTOPTS='true'
BOOTOPTS="${BOOTOPTS}"
NEXT="6"
;;
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
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
writeConfigKey "emmcboot" "true" "${USER_CONFIG_FILE}"
writeConfigKey "synoinfo.disk_swap" "no" "${USER_CONFIG_FILE}"
writeConfigKey "synoinfo.supportraid" "no" "${USER_CONFIG_FILE}"
writeConfigKey "synoinfo.support_emmc_boot" "yes" "${USER_CONFIG_FILE}"
writeConfigKey "synoinfo.support_install_only_dev" "yes" "${USER_CONFIG_FILE}"
fi
writeConfigKey "arc.builddone" "false" "${USER_CONFIG_FILE}"
BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")"
NEXT="E"
;;
W) RD_COMPRESSED=$([ "${RD_COMPRESSED}" = "true" ] && echo 'false' || echo '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'
writeConfigKey "lkm" "${LKM}" "${USER_CONFIG_FILE}"
writeConfigKey "arc.builddone" "false" "${USER_CONFIG_FILE}"
BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")"
NEXT="u"
;;
i) bootipwaittime; NEXT="i" ;;
q) [ "${DIRECTBOOT}" = "false" ] && DIRECTBOOT='true' || DIRECTBOOT='false'
grub-editenv ${USER_GRUBENVFILE} create
writeConfigKey "directboot" "${DIRECTBOOT}" "${USER_CONFIG_FILE}"
NEXT="q"
;;
esac
;;
*)
break
;;
esac
done
return
}
###############################################################################
# Permits user edit the user config
function editUserConfig() {
@@ -1602,21 +1377,24 @@ function backupMenu() {
while true; do
if [ -n "${USERID}" ] && [ "${ARCOFFLINE}" != "true" ] && [ "${CONFDONE}" = "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 Hardware Key from DSM" \
3 "Restore Arc Config from Online" \
4 "Backup Arc Config to Online" \
1 "Restore Arc Config (from DSM)" \
2 "Restore Hardware Key (local)" \
3 "Backup Hardware Key (local)" \
4 "Restore Arc Config (from Online)" \
5 "Backup Arc Config (to Online)" \
2>"${TMP_PATH}/resp"
elif [ -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 Hardware Key from DSM" \
3 "Restore Arc Config from Online" \
1 "Restore Arc Config (from DSM)" \
2 "Restore Hardware Key (local)" \
3 "Backup Hardware Key (local)" \
4 "Restore Arc Config (from 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 Hardware Key from DSM" \
1 "Restore Arc Config (from DSM)" \
2 "Restore Hardware Key (local)" \
3 "Backup Hardware Key (local)" \
2>"${TMP_PATH}/resp"
fi
[ $? -ne 0 ] && break
@@ -1676,33 +1454,40 @@ function backupMenu() {
rm -f "${HOME}/.initialized" && exec init.sh
;;
2)
DSMROOTS="$(findDSMRoot)"
if [ -z "${DSMROOTS}" ]; then
dialog --backtitle "$(backtitle)" --title "Restore Encryption Key" \
--msgbox "No DSM system partition(md0) found!\nPlease insert all disks before continuing." 0 0
return
fi
mkdir -p "${TMP_PATH}/mdX"
for I in ${DSMROOTS}; do
# fixDSMRootPart "${I}"
mount -t ext4 "${I}" "${TMP_PATH}/mdX"
if [ -f "${TMP_PATH}/mdX/usr/arc/backup/p2/machine.key" ]; then
cp -f "${TMP_PATH}/mdX/usr/arc/backup/p2/machine.key" "${PART2_PATH}/machine.key"
dialog --backtitle "$(backtitle)" --title "Restore Encryption Key" --aspect 18 \
--msgbox "Encryption Key restore successful!" 0 0
break
fi
done
umount "${TMP_PATH}/mdX"
if [ -f "${PART2_PATH}/machine.key" ]; then
dialog --backtitle "$(backtitle)" --title "Restore Encryption Key" \
--msgbox "Upload the machine.key file to ${PART3_PATH}/users\nand press OK after the upload is done." 0 0
[ $? -ne 0 ] && return 1
if [ -f "${PART3_PATH}/users/machine.key" ]; then
mv -f "${PART3_PATH}/users/machine.key" "${PART2_PATH}/machine.key"
dialog --backtitle "$(backtitle)" --title "Restore Encryption Key" --aspect 18 \
--msgbox "Encryption Key restore successful!" 0 0
else
dialog --backtitle "$(backtitle)" --title "Restore Encryption Key" --aspect 18 \
--msgbox "No Encryption Key found!" 0 0
dialog --backtitle "$(backtitle)" --title "Restore Encryption Key" \
--msgbox "File not found!" 0 0
return 1
fi
return
;;
3)
dialog --backtitle "$(backtitle)" --title "Backup Encryption Key" \
--msgbox "To backup the Encryption Key press OK." 0 0
[ $? -ne 0 ] && return 1
if [ -f "${PART2_PATH}/machine.key" ]; then
cp -f "${PART2_PATH}/machine.key" "/var/www/data/machine.key"
URL="http://${IPCON}${HTTPPORT:+:$HTTPPORT}/machine.key"
MSG="Please use ${URL} to download the machine.key file."
else
MSG="File not found!"
fi
dialog --backtitle "$(backtitle)" --colors --title "Backup Encryption Key" \
--msgbox "${MSG}" 0 0
if [ "${MSG}" = "File not found!" ]; then
return 1
fi
return
;;
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
@@ -1734,14 +1519,16 @@ function backupMenu() {
sleep 2
rm -f "${HOME}/.initialized" && exec init.sh
;;
4)
5)
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
return 1
fi
return
;;
*)
break
@@ -1767,11 +1554,12 @@ function updateMenu() {
1)
# Ask for Tag
TAG="$(curl -m 10 -skL "https://api.github.com/repos/AuxXxilium/arc/releases" | jq -r ".[].tag_name" | grep -v "dev" | sort -rV | head -1)"
OLD="$(cat ${PART1_PATH}/ARC-VERSION)"
OLD="${ARC_VERSION}"
dialog --clear --backtitle "$(backtitle)" --title "Update Loader" \
--menu "Current: ${OLD} -> Which Version?" 7 50 0 \
1 "Latest ${TAG}" \
2 "Select Version" \
3 "Upload .zip File" \
2>"${TMP_PATH}/opts"
[ $? -ne 0 ] && break
opts=$(cat ${TMP_PATH}/opts)
@@ -1783,6 +1571,25 @@ function updateMenu() {
2>"${TMP_PATH}/input"
TAG=$(cat "${TMP_PATH}/input")
[ -z "${TAG}" ] && return 1
elif [ ${opts} -eq 3 ]; then
mkdir -p "${PART3_PATH}/users"
dialog --backtitle "$(backtitle)" --title "Update Loader" \
--msgbox "Upload the update-*.zip File to ${PART3_PATH}/users\nand press OK after upload is done." 0 0
[ $? -ne 0 ] && return 1
UPDATEFOUND="false"
for UPDATEFILE in "${PART3_PATH}/users/update-*.zip"; do
if [ -e "${UPDATEFILE}" ]; then
mv -f "${UPDATEFILE}" "${TMP_PATH}/update.zip"
TAG="zip"
UPDATEFOUND="true"
break
fi
done
if [ "${UPDATEFOUND}" = "false" ]; then
dialog --backtitle "$(backtitle)" --title "Update Loader" \
--msgbox "File not found!" 0 0
return 1
fi
fi
updateLoader "${TAG}"
;;
@@ -1796,7 +1603,7 @@ function updateMenu() {
4)
dialog --backtitle "$(backtitle)" --title "Switch Arc Branch" \
--menu "Choose a Branch" 0 0 0 \
1 "evolution - New Evolution System" \
1 "evo - New Evolution System" \
3 "dev - Development System" \
2>"${TMP_PATH}/opts"
[ $? -ne 0 ] && break
@@ -2911,14 +2718,9 @@ function greplogs() {
if [ -n "$(ls -A ${TMP_PATH}/logs 2>/dev/null)" ]; then
tar -czf "${TMP_PATH}/logs.tar.gz" -C "${TMP_PATH}" logs
if [ -z "${SSH_TTY}" ]; then # web
mv -f "${TMP_PATH}/logs.tar.gz" "/var/www/data/logs.tar.gz"
URL="http://${IPCON}:${HTTPPORT:-8080}/logs.tar.gz"
MSG+="Please via ${URL} to download the logs,\nAnd go to Github or Discord to create an issue and upload the logs."
else
sz -be -B 536870912 "${TMP_PATH}/logs.tar.gz"
MSG+="Please go to Github or Discord to create an issue and upload the logs."
fi
mv -f "${TMP_PATH}/logs.tar.gz" "/var/www/data/logs.tar.gz"
URL="http://${IPCON}${HTTPPORT:+:$HTTPPORT}/logs.tar.gz"
MSG+="Please via ${URL} to download the logs,\nAnd go to Github or Discord to create an issue and upload the logs."
fi
dialog --backtitle "$(backtitle)" --colors --title "Grep Logs" \
--msgbox "${MSG}" 0 0
@@ -2931,17 +2733,11 @@ function getbackup() {
if [ -d "${PART1_PATH}/dsmbackup" ]; then
rm -f "${TMP_PATH}/dsmconfig.tar.gz" >/dev/null
tar -czf "${TMP_PATH}/dsmconfig.tar.gz" -C "${PART1_PATH}" dsmbackup
if [ -z "${SSH_TTY}" ]; then # web
cp -f "${TMP_PATH}/dsmconfig.tar.gz" "/var/www/data/dsmconfig.tar.gz"
chmod 644 "/var/www/data/dsmconfig.tar.gz"
URL="http://${IPCON}:${HTTPPORT:-8080}/dsmconfig.tar.gz"
dialog --backtitle "$(backtitle)" --colors --title "DSM Config" \
--msgbox "Please via ${URL}\nto download the dsmconfig and unzip it and back it up in order by file name." 0 0
else
sz -be -B 536870912 "${TMP_PATH}/dsmconfig.tar.gz"
dialog --backtitle "$(backtitle)" --colors --title "DSM Config" \
--msgbox "Please unzip it and back it up in order by file name." 0 0
fi
cp -f "${TMP_PATH}/dsmconfig.tar.gz" "/var/www/data/dsmconfig.tar.gz"
chmod 644 "/var/www/data/dsmconfig.tar.gz"
URL="http://${IPCON}${HTTPPORT:+:$HTTPPORT}/dsmconfig.tar.gz"
dialog --backtitle "$(backtitle)" --colors --title "DSM Config" \
--msgbox "Please via ${URL}\nto download the dsmconfig and unzip it and back it up in order by file name." 0 0
else
MSG=""
MSG+="\Z1No dsmbackup found!\Zn\n\n"
@@ -3009,7 +2805,8 @@ function rebootMenu() {
exit 0
elif [ "${REDEST}" = "network" ]; then
clear
/etc/init.d/S41dhcpcd restart
/etc/init.d/S07network restart
/etc/init.d/S09dhcpcd restart
rm -f "${HOME}/.initialized" && exec init.sh
else
rebootTo ${REDEST}
@@ -3653,5 +3450,5 @@ function getnetinfo() {
[ -n "${IPCON}" ] && break
done
export IPCON="${IPCON:-noip}"
IPCON="${IPCON:-noip}"
}

View File

@@ -23,7 +23,7 @@ function backtitle() {
BACKTITLE="${ARC_TITLE}$([ -n "${NEWTAG}" ] && [ -n "${ARC_VERSION}" ] && [ ${ARC_VERSION//[!0-9]/} -lt ${NEWTAG//[!0-9]/} ] && echo " > ${NEWTAG}") | "
BACKTITLE+="${MODEL:-(Model)} | "
BACKTITLE+="${PRODUCTVER:-(Version)} | "
BACKTITLE+="${IPCON:-(IP)} | "
BACKTITLE+="${IPCON:-(no IP)} | "
BACKTITLE+="Patch: ${ARCPATCH} | "
BACKTITLE+="Config: ${CONFDONE} | "
BACKTITLE+="Build: ${BUILDDONE} | "
@@ -84,12 +84,6 @@ elif [ "${ARCMODE}" = "config" ]; then
if [ "${CONFDONE}" = "true" ]; then
if [ "${ARCOPTS}" = "true" ]; then
write_menu "4" "\Z1Hide Arc DSM Options\Zn"
else
write_menu "4" "\Z1Show Arc DSM Options\Zn"
fi
if [ "${ARCOPTS}" = "true" ]; then
write_menu "=" "\Z4==== Arc DSM ====\Zn"
write_menu "b" "Addons"
write_menu "d" "Modules"
write_menu "e" "Version"
@@ -114,40 +108,32 @@ elif [ "${ARCMODE}" = "config" ]; then
done
if [ "${PLATFORM}" = "epyc7002" ]; then
write_menu_with_color "K" "Kernel" "${KERNEL}"
write_menu_value "K" "Kernel" "${KERNEL}"
fi
if [ "${DT}" = "true" ]; then
write_menu_with_color "H" "Hotplug/SortDrives" "${HDDSORT}"
write_menu_value "H" "Hotplug/SortDrives" "${HDDSORT}"
else
write_menu_with_color "h" "USB as Internal" "${USBMOUNT}"
write_menu_value "h" "USB as Internal" "${USBMOUNT}"
fi
else
write_menu "4" "\Z1Show Arc DSM Options\Zn"
fi
if [ "${BOOTOPTS}" = "true" ]; then
write_menu "6" "\Z1Hide Boot Options\Zn"
write_menu_value "m" "Boot Kernelload" "${KERNELLOAD}"
write_menu_value "E" "eMMC Boot Support" "${EMMCBOOT}"
if [ "${DIRECTBOOT}" = "false" ]; then
write_menu_value "i" "Boot IP Waittime" "${BOOTIPWAIT}"
fi
write_menu_value "q" "Directboot" "${DIRECTBOOT}"
else
write_menu "6" "\Z1Show Boot Options\Zn"
fi
if [ "${BOOTOPTS}" = "true" ]; then
write_menu "=" "\Z4===== Boot =====\Zn"
write_menu_with_color "m" "Boot Kernelload" "${KERNELLOAD}"
write_menu_with_color "E" "eMMC Boot Support" "${EMMCBOOT}"
if [ "${DIRECTBOOT}" = "false" ]; then
write_menu_with_color "i" "Boot IP Waittime" "${BOOTIPWAIT}"
fi
write_menu_with_color "q" "Directboot" "${DIRECTBOOT}"
fi
if [ "${DSMOPTS}" = "true" ]; then
write_menu "7" "\Z1Hide DSM Options\Zn"
else
write_menu "7" "\Z1Show DSM Options\Zn"
fi
if [ "${DSMOPTS}" = "true" ]; then
write_menu "=" "\Z4===== DSM =====\Zn"
write_menu "j" "Cmdline"
write_menu "k" "Synoinfo"
write_menu "N" "Add new User"
@@ -157,19 +143,15 @@ elif [ "${ARCMODE}" = "config" ]; then
write_menu "M" "Mount DSM Storage Pool"
write_menu "l" "Edit User Config"
write_menu "s" "Allow Downgrade Version"
write_menu_with_color "O" "Official Driver Priority" "${ODP}"
write_menu_value "O" "Official Driver Priority" "${ODP}"
else
write_menu "7" "\Z1Show DSM Options\Zn"
fi
fi
if [ "${LOADEROPTS}" = "true" ]; then
write_menu "8" "\Z1Hide Loader Options\Zn"
else
write_menu "8" "\Z1Show Loader Options\Zn"
fi
if [ "${LOADEROPTS}" = "true" ]; then
write_menu "=" "\Z4===== Loader =====\Zn"
write_menu_with_color "c" "Offline Mode" "${ARCOFFLINE}"
write_menu_value "c" "Offline Mode" "${ARCOFFLINE}"
write_menu "D" "StaticIP for Loader/DSM"
write_menu "f" "Bootscreen Options"
write_menu "U" "Change Loader Password"
@@ -178,25 +160,23 @@ elif [ "${ARCMODE}" = "config" ]; then
write_menu "L" "Grep Logs from dbgutils"
write_menu "B" "Grep DSM Config from Backup"
write_menu "=" "\Z1== Edit with caution! ==\Zn"
write_menu_with_color "W" "RD Compression" "${RD_COMPRESSED}"
write_menu_with_color "X" "Sata DOM" "${SATADOM}"
write_menu_with_color "u" "LKM Version" "${LKM}"
write_menu_value "W" "RD Compression" "${RD_COMPRESSED}"
write_menu_value "X" "Sata DOM" "${SATADOM}"
write_menu_value "u" "LKM Version" "${LKM}"
write_menu "C" "Clone Loader to another Disk"
write_menu "n" "Grub Bootloader Config"
write_menu "y" "Choose a Keymap for Loader"
write_menu "F" "\Z1Formate Disks\Zn"
else
write_menu "8" "\Z1Show Loader Options\Zn"
fi
write_menu_with_color "=" "\Z4===== Misc =====\Zn"
write_menu "=" "\Z4===== Misc =====\Zn"
write_menu "x" "Backup/Restore/Recovery"
[ "${ARCOFFLINE}" = "false" ] && write_menu "z" "Update Menu"
write_menu "I" "Power/Service Menu"
write_menu "V" "Credits"
if [ "$TERM" != "xterm-256color" ]; then
WEBCONFIG="Webconfig: http://${IPCON}${HTTPPORT:+:$HTTPPORT}"
else
WEBCONFIG=""
fi
[ "$TERM" != "xterm-256color" ] && WEBCONFIG="Webconfig: http://${IPCON}${HTTPPORT:+:$HTTPPORT}" || WEBCONFIG=""
dialog --clear --default-item ${NEXT} --backtitle "$(backtitle)" --title "Classic UI" --colors \
--cancel-label "Evo" --help-button --help-label "Exit" \
--menu "${WEBCONFIG}" 0 0 0 --file "${TMP_PATH}/menu" \
@@ -365,6 +345,8 @@ elif [ "${ARCMODE}" = "config" ]; then
esac
done
clear
else
echo "Unknown Mode: ${ARCMODE} - Exiting..."
fi
# Inform user

View File

@@ -5,6 +5,8 @@ set -e
. "${ARC_PATH}/include/functions.sh"
arc_mode || die "No bootmode found!"
# Clear logs for dbgutils addons
rm -rf "${PART1_PATH}/logs" >/dev/null 2>&1 || true
@@ -46,6 +48,8 @@ PRODUCTVER="$(readConfigKey "productver" "${USER_CONFIG_FILE}")"
BUILDNUM="$(readConfigKey "buildnum" "${USER_CONFIG_FILE}")"
SMALLNUM="$(readConfigKey "smallnum" "${USER_CONFIG_FILE}")"
LKM="$(readConfigKey "lkm" "${USER_CONFIG_FILE}")"
KERNEL="$(readConfigKey "kernel" "${USER_CONFIG_FILE}")"
KVER="$(readConfigKey "platforms.${PLATFORM}.productvers.\"${PRODUCTVER}\".kver" "${P_FILE}")"
CPU="$(echo $(cat /proc/cpuinfo 2>/dev/null | grep 'model name' | uniq | awk -F':' '{print $2}'))"
RAMTOTAL="$(awk '/MemTotal:/ {printf "%.0f\n", $2 / 1024 / 1024 + 0.5}' /proc/meminfo 2>/dev/null)"
VENDOR="$(dmesg 2>/dev/null | grep -i "DMI:" | head -1 | sed 's/\[.*\] DMI: //i')"
@@ -81,6 +85,7 @@ if [ "${DSMINFO}" = "true" ]; then
echo -e "Model: \033[1;37m${MODELID:-${MODEL}}\033[0m"
echo -e "Platform: \033[1;37m${PLATFORM}\033[0m"
echo -e "Version: \033[1;37m${PRODUCTVER} (${BUILDNUM}$([ ${SMALLNUM:-0} -ne 0 ] && echo "u${SMALLNUM}"))\033[0m"
echo -e "Kernel: \033[1;37m${KVER} (${KERNEL}\033[0m"
echo -e "LKM: \033[1;37m${LKM}\033[0m"
echo
fi
@@ -296,7 +301,7 @@ elif [ "${DIRECTBOOT}" = "false" ]; then
fi
echo
[ ! -f /var/run/dhcpcd/pid ] && /etc/init.d/S41dhcpcd restart >/dev/null 2>&1 || true
[ ! -f /var/run/dhcpcd/pid ] && /etc/init.d/S09dhcpcd restart >/dev/null 2>&1 || true
sleep 3
checkNIC
echo
@@ -310,7 +315,7 @@ elif [ "${DIRECTBOOT}" = "false" ]; then
fi
# Wait for boot interrupt
_bootwait
# _bootwait || true
for T in $(busybox w 2>/dev/null | grep -v 'TTY' | awk '{print $2}'); do
if [ -w "/dev/${T}" ]; then

View File

@@ -23,7 +23,7 @@ function backtitle() {
BACKTITLE="${ARC_TITLE}$([ -n "${NEWTAG}" ] && [ -n "${ARC_VERSION}" ] && [ ${ARC_VERSION//[!0-9]/} -lt ${NEWTAG//[!0-9]/} ] && echo " > ${NEWTAG}") | "
BACKTITLE+="${MODEL:-(Model)} | "
BACKTITLE+="${PRODUCTVER:-(Version)} | "
BACKTITLE+="${IPCON:-(IP)} | "
BACKTITLE+="${IPCON:-(no IP)} | "
BACKTITLE+="Patch: ${ARCPATCH} | "
BACKTITLE+="Config: ${CONFDONE} | "
BACKTITLE+="Build: ${BUILDDONE} | "
@@ -33,6 +33,159 @@ function backtitle() {
echo "${BACKTITLE}"
}
###############################################################################
# Advanced Menu
function advancedMenu() {
NEXT="a"
while true; do
rm -f "${TMP_PATH}/menu" "${TMP_PATH}/resp" >/dev/null 2>&1 || true
write_menu "=" "\Z4===== System ====\Zn"
if [ "${CONFDONE}" = "true" ]; then
if [ "${BOOTOPTS}" = "true" ]; then
write_menu "6" "\Z1Hide Boot Options\Zn"
write_menu_value "m" "Kernelload" "${KERNELLOAD}"
write_menu_value "E" "eMMC Boot Support" "${EMMCBOOT}"
if [ "${DIRECTBOOT}" = "false" ]; then
write_menu_value "i" "Boot IP Waittime" "${BOOTIPWAIT}"
fi
write_menu_value "q" "Directboot" "${DIRECTBOOT}"
write_menu_value "W" "RD Compression" "${RD_COMPRESSED}"
write_menu_value "X" "Sata DOM" "${SATADOM}"
write_menu_value "u" "LKM Version" "${LKM}"
else
write_menu "6" "\Z1Show Boot Options\Zn"
fi
if [ "${DSMOPTS}" = "true" ]; then
write_menu "7" "\Z1Hide DSM Options\Zn"
write_menu "j" "Cmdline"
write_menu "k" "Synoinfo"
write_menu "N" "Add new User"
write_menu "t" "Change User Password"
write_menu "J" "Reset Network Config"
write_menu "T" "Disable all scheduled Tasks"
write_menu "M" "Mount DSM Storage Pool"
write_menu "l" "Edit User Config"
write_menu "s" "Allow Downgrade Version"
else
write_menu "7" "\Z1Show DSM Options\Zn"
fi
fi
if [ "${LOADEROPTS}" = "true" ]; then
write_menu "8" "\Z1Hide Loader Options\Zn"
write_menu "D" "StaticIP for Loader/DSM"
write_menu "f" "Bootscreen Options"
write_menu "U" "Change Loader Password"
write_menu "Z" "Change Loader Ports"
write_menu "w" "Reset Loader to Defaults"
write_menu "L" "Grep Logs from dbgutils"
write_menu "B" "Grep DSM Config from Backup"
write_menu "=" "\Z1== Edit with caution! ==\Zn"
write_menu "C" "Clone Loader to another Disk"
write_menu "n" "Grub Bootloader Config"
write_menu "y" "Choose a Keymap for Loader"
write_menu "F" "\Z1Formate Disks\Zn"
else
write_menu "8" "\Z1Show Loader Options\Zn"
fi
dialog --clear --default-item ${NEXT} --backtitle "$(backtitle)" --title "Evo UI Advanced" --colors \
--cancel-label "Back" \
--menu "" 0 0 0 --file "${TMP_PATH}/menu" \
2>"${TMP_PATH}/resp"
RET=$?
case ${RET} in
0)
resp=$(cat ${TMP_PATH}/resp)
[ -z "${resp}" ] && return
case ${resp} in
# DSM Section
7) [ "${DSMOPTS}" = "true" ] && DSMOPTS='false' || DSMOPTS='true'
DSMOPTS="${DSMOPTS}"
NEXT="7"
;;
j) cmdlineMenu; NEXT="j" ;;
k) synoinfoMenu; NEXT="k" ;;
l) editUserConfig; NEXT="l" ;;
s) downgradeMenu; NEXT="s" ;;
t) resetPassword; NEXT="t" ;;
N) addNewDSMUser; NEXT="N" ;;
J) resetDSMNetwork; NEXT="J" ;;
M) mountDSM; NEXT="M" ;;
T) disablescheduledTasks; NEXT="T" ;;
B) getbackup; NEXT="B" ;;
# Loader Section
8) [ "${LOADEROPTS}" = "true" ] && LOADEROPTS='false' || LOADEROPTS='true'
LOADEROPTS="${LOADEROPTS}"
NEXT="8"
;;
D) staticIPMenu; NEXT="D" ;;
f) bootScreen; NEXT="f" ;;
Z) loaderPorts; NEXT="Z" ;;
U) loaderPassword; NEXT="U" ;;
L) greplogs; NEXT="L" ;;
w) resetLoader; NEXT="w" ;;
C) cloneLoader; NEXT="C" ;;
n) editGrubCfg; NEXT="n" ;;
y) keymapMenu; NEXT="y" ;;
F) formatDisks; NEXT="F" ;;
6) [ "${BOOTOPTS}" = "true" ] && BOOTOPTS='false' || BOOTOPTS='true'
BOOTOPTS="${BOOTOPTS}"
NEXT="6"
;;
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
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
writeConfigKey "emmcboot" "true" "${USER_CONFIG_FILE}"
writeConfigKey "synoinfo.disk_swap" "no" "${USER_CONFIG_FILE}"
writeConfigKey "synoinfo.supportraid" "no" "${USER_CONFIG_FILE}"
writeConfigKey "synoinfo.support_emmc_boot" "yes" "${USER_CONFIG_FILE}"
writeConfigKey "synoinfo.support_install_only_dev" "yes" "${USER_CONFIG_FILE}"
fi
writeConfigKey "arc.builddone" "false" "${USER_CONFIG_FILE}"
BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")"
NEXT="E"
;;
W) RD_COMPRESSED=$([ "${RD_COMPRESSED}" = "true" ] && echo 'false' || echo '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'
writeConfigKey "lkm" "${LKM}" "${USER_CONFIG_FILE}"
writeConfigKey "arc.builddone" "false" "${USER_CONFIG_FILE}"
BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")"
NEXT="u"
;;
i) bootipwaittime; NEXT="i" ;;
q) [ "${DIRECTBOOT}" = "false" ] && DIRECTBOOT='true' || DIRECTBOOT='false'
grub-editenv ${USER_GRUBENVFILE} create
writeConfigKey "directboot" "${DIRECTBOOT}" "${USER_CONFIG_FILE}"
NEXT="q"
;;
esac
;;
*)
break
;;
esac
done
return
}
###############################################################################
###############################################################################
# Main loop
@@ -57,18 +210,18 @@ elif [ "${ARCMODE}" = "config" ]; then
rm -f "${TMP_PATH}/menu" "${TMP_PATH}/resp" >/dev/null 2>&1 || true
write_menu "=" "\Z4===== Main =====\Zn"
if [ -z "${USERID}" ] && [ "${ARCOFFLINE}" = "false" ]; then
write_menu_with_color "0" "HardwareID" "${HARDWAREID}"
write_menu_value "0" "HardwareID" "${HARDWAREID}"
fi
write_menu_with_color "1" "Model" "${MODEL}"
write_menu_value "1" "Model" "${MODEL}"
if [ "${CONFDONE}" = "true" ]; then
write_menu_with_color "e" "Version" "${PRODUCTVER}"
write_menu_with_color "=" "DT" "${DT}"
write_menu_with_color "=" "Platform" "${PLATFORM}"
write_menu_value "e" "Version" "${PRODUCTVER}"
write_menu_value "=" "DT" "${DT}"
write_menu_value "=" "Platform" "${PLATFORM}"
if [ -n "${USERID}" ] && [ "${ARCOFFLINE}" = "false" ]; then
write_menu_with_color "p" "Arc Patch" "${ARCPATCH}"
write_menu_value "p" "Arc Patch" "${ARCPATCH}"
elif [ "${ARCOFFLINE}" = "false" ]; then
write_menu "p" "Arc Patch: \Z4Register HardwareID first\Zn"
else
@@ -80,7 +233,7 @@ elif [ "${ARCMODE}" = "config" ]; then
if [ ${CPUINFO} -gt 24 ]; then
write_menu "=" "Custom Kernel should be used for this CPU"
fi
write_menu_with_color "K" "Kernel" "${KERNEL}"
write_menu_value "K" "Kernel" "${KERNEL}"
fi
write_menu "b" "Addons"
@@ -88,29 +241,29 @@ elif [ "${ARCMODE}" = "config" ]; then
for addon in "cpufreqscaling" "storagepanel" "sequentialio"; do
if readConfigMap "addons" "${USER_CONFIG_FILE}" | grep -q "${addon}"; then
case "${addon}" in
"cpufreqscaling") write_menu_with_color "g" "Scaling Governor" "${GOVERNOR}" ;;
"storagepanel") write_menu_with_color "P" "StoragePanel" "${STORAGEPANEL:-auto}" ;;
"sequentialio") write_menu_with_color "Q" "SequentialIO" "${SEQUENTIALIO}" ;;
"cpufreqscaling") write_menu_value "g" "Scaling Governor" "${GOVERNOR}" ;;
"storagepanel") write_menu_value "P" "StoragePanel" "${STORAGEPANEL:-auto}" ;;
"sequentialio") write_menu_value "Q" "SequentialIO" "${SEQUENTIALIO}" ;;
esac
fi
done
write_menu "d" "Modules"
write_menu_with_color "O" "Official Driver Priority" "${ODP}"
write_menu_value "O" "Official Driver Priority" "${ODP}"
if [ "${DT}" = "false" ] && [ ${SATACONTROLLER} -gt 0 ]; then
write_menu_with_color "S" "PortMap" "${REMAP}"
write_menu_with_color "=" "Mapping" "${PORTMAP}"
write_menu_value "S" "PortMap" "${REMAP}"
write_menu_value "=" "Mapping" "${PORTMAP}"
fi
if [ "${DT}" = "true" ]; then
write_menu_with_color "H" "Hotplug/SortDrives" "${HDDSORT}"
write_menu_value "H" "Hotplug/SortDrives" "${HDDSORT}"
else
write_menu_with_color "h" "USB as Internal" "${USBMOUNT}"
write_menu_value "h" "USB as Internal" "${USBMOUNT}"
fi
fi
write_menu_with_color "c" "Offline Mode" "${ARCOFFLINE}"
write_menu_value "c" "Offline Mode" "${ARCOFFLINE}"
write_menu "9" "Advanced Options"
write_menu "=" "\Z4===== Diag =====\Zn"
write_menu "a" "Sysinfo"
@@ -225,6 +378,8 @@ elif [ "${ARCMODE}" = "config" ]; then
;;
esac
done
else
echo "Unknown Mode: ${ARCMODE} - Exiting..."
fi
# Inform user

Binary file not shown.

View File

@@ -4,6 +4,10 @@ PART2_PATH="/mnt/p2"
PART3_PATH="/mnt/p3"
TMP_PATH="/tmp"
[ -f "${PART3_PATH}/automated" ] && rm -f "${PART3_PATH}/automated" >/dev/null 2>&1 || true
[ -f "${PART1_PATH}/ARC-BRANCH" ] && ARC_BRANCH="$(cat "${PART1_PATH}/ARC-BRANCH")" || ARC_BRANCH="null"
[ -f "${PART1_PATH}/ARC-VERSION" ] && ARC_VERSION="$(cat "${PART1_PATH}/ARC-VERSION")" || ARC_VERSION="null"
[ -f "${PART1_PATH}/ARC-BUILD" ] && ARC_BUILD="$(cat "${PART1_PATH}/ARC-BUILD")" || ARC_BUILD="null"
ARC_TITLE="Arc ${ARC_VERSION}"
RAMDISK_PATH="${TMP_PATH}/ramdisk"

View File

@@ -11,7 +11,7 @@ function checkBootLoader() {
[ -z "${KNAME}" ] && continue
[ "${RO}" = "0" ] && continue
hdparm -r0 "${KNAME}" >/dev/null 2>&1 || true
done <<<$(lsblk -pno KNAME,RO 2>/dev/null)
done < <(lsblk -pno KNAME,RO 2>/dev/null)
[ ! -w "${PART1_PATH}" ] && return 1
[ ! -w "${PART2_PATH}" ] && return 1
[ ! -w "${PART3_PATH}" ] && return 1
@@ -25,21 +25,16 @@ function checkBootLoader() {
###############################################################################
# Check boot mode
function arc_mode() {
unset ARCMODE ARC_BRANCH ARC_VERSION ARC_BUILD ARCCONF
if grep -q 'automated_arc' /proc/cmdline; then
export ARCMODE="automated"
ARCMODE="automated"
elif grep -q 'update_arc' /proc/cmdline; then
export ARCMODE="update"
ARCMODE="update"
elif grep -q 'force_arc' /proc/cmdline; then
export ARCMODE="config"
ARCMODE="config"
else
export ARCMODE="dsm"
ARCMODE="dsm"
fi
[ -f "${PART3_PATH}/automated" ] && rm -f "${PART3_PATH}/automated" >/dev/null 2>&1 || true
[ -f "${PART1_PATH}/ARC-BRANCH" ] && export ARC_BRANCH=$(cat "${PART1_PATH}/ARC-BRANCH") || export ARC_BRANCH="null"
[ -f "${PART1_PATH}/ARC-VERSION" ] && export ARC_VERSION=$(cat "${PART1_PATH}/ARC-VERSION") || export ARC_VERSION="null"
[ -f "${PART1_PATH}/ARC-BUILD" ] && export ARC_BUILD=$(cat "${PART1_PATH}/ARC-BUILD") || export ARC_BUILD="null"
[ "$(readConfigKey "${MODEL:-SA6400}.serial" "${S_FILE}")" ] && export ARCCONF="true" || export ARCCONF=""
[ "$(readConfigKey "${MODEL:-SA6400}.serial" "${S_FILE}")" ] && ARCCONF="true" || true
}
@@ -316,8 +311,8 @@ function _sort_netif() {
# sort
if [ ! "${ETHSEQ}" = "$(seq 0 $((${ETHNUM:0} - 1)))" ]; then
/etc/init.d/S41dhcpcd stop >/dev/null 2>&1
/etc/init.d/S40network stop >/dev/null 2>&1
/etc/init.d/S09dhcpcd stop >/dev/null 2>&1
/etc/init.d/S07network stop >/dev/null 2>&1
for i in $(seq 0 $((${ETHNUM:0} - 1))); do
ip link set dev eth${i} name tmp${i}
done
@@ -326,8 +321,8 @@ function _sort_netif() {
ip link set dev tmp${i} name eth${I}
I=$((${I} + 1))
done
/etc/init.d/S40network start >/dev/null 2>&1
/etc/init.d/S41dhcpcd start >/dev/null 2>&1
/etc/init.d/S07network start >/dev/null 2>&1
/etc/init.d/S09dhcpcd start >/dev/null 2>&1
fi
return 0
}
@@ -479,7 +474,7 @@ function checkBIOS_VT_d() {
###############################################################################
# Rebooting
function rebootTo() {
local MODES="config recovery junior automated update bios memtest"
local MODES="config recovery junior automated update uefi memtest"
[ -z "${1}" ] && exit 1
if ! echo "${MODES}" | grep -wq "${1}"; then exit 1; fi
[ "${1}" = "automated" ] && echo "arc-${MODEL}-${PRODUCTVER}-${ARC_VERSION}" >"${PART3_PATH}/automated"
@@ -623,6 +618,7 @@ function onlineCheck() {
if [ -n "${NEWTAG}" ]; then
writeConfigKey "arc.offline" "false" "${USER_CONFIG_FILE}"
updateOffline
checkHardwareID
else
writeConfigKey "arc.offline" "true" "${USER_CONFIG_FILE}"
fi
@@ -739,12 +735,80 @@ function fixDSMRootPart() {
fi
}
###############################################################################
# Read Data
function readData() {
# Get DSM Data from Config
MODEL="$(readConfigKey "model" "${USER_CONFIG_FILE}")"
MODELID="$(readConfigKey "modelid" "${USER_CONFIG_FILE}")"
LKM="$(readConfigKey "lkm" "${USER_CONFIG_FILE}")"
if [ -n "${MODEL}" ]; then
DT="$(readConfigKey "platforms.${PLATFORM}.dt" "${P_FILE}")"
PRODUCTVER="$(readConfigKey "productver" "${USER_CONFIG_FILE}")"
PLATFORM="$(readConfigKey "platform" "${USER_CONFIG_FILE}")"
fi
# Get Arc Data from Config
ARCPATCH="$(readConfigKey "arc.patch" "${USER_CONFIG_FILE}")"
HARDWAREID="$(genHWID)"
USERID="$(readConfigKey "arc.userid" "${USER_CONFIG_FILE}")"
EXTERNALCONTROLLER="$(readConfigKey "device.externalcontroller" "${USER_CONFIG_FILE}")"
SATACONTROLLER="$(readConfigKey "device.satacontroller" "${USER_CONFIG_FILE}")"
SCSICONTROLLER="$(readConfigKey "device.scsicontroller" "${USER_CONFIG_FILE}")"
RAIDCONTROLLER="$(readConfigKey "device.raidcontroller" "${USER_CONFIG_FILE}")"
SASCONTROLLER="$(readConfigKey "device.sascontroller" "${USER_CONFIG_FILE}")"
# Advanced Config
BOOTIPWAIT="$(readConfigKey "bootipwait" "${USER_CONFIG_FILE}")"
DIRECTBOOT="$(readConfigKey "directboot" "${USER_CONFIG_FILE}")"
EMMCBOOT="$(readConfigKey "emmcboot" "${USER_CONFIG_FILE}")"
HDDSORT="$(readConfigKey "hddsort" "${USER_CONFIG_FILE}")"
USBMOUNT="$(readConfigKey "usbmount" "${USER_CONFIG_FILE}")"
KERNEL="$(readConfigKey "kernel" "${USER_CONFIG_FILE}")"
KERNELLOAD="$(readConfigKey "kernelload" "${USER_CONFIG_FILE}")"
KERNELPANIC="$(readConfigKey "kernelpanic" "${USER_CONFIG_FILE}")"
GOVERNOR="$(readConfigKey "governor" "${USER_CONFIG_FILE}")"
STORAGEPANEL="$(readConfigKey "addons.storagepanel" "${USER_CONFIG_FILE}")"
SEQUENTIALIO="$(readConfigKey "addons.sequentialio" "${USER_CONFIG_FILE}")"
ODP="$(readConfigKey "odp" "${USER_CONFIG_FILE}")"
RD_COMPRESSED="$(readConfigKey "rd-compressed" "${USER_CONFIG_FILE}")"
SATADOM="$(readConfigKey "satadom" "${USER_CONFIG_FILE}")"
REMAP="$(readConfigKey "arc.remap" "${USER_CONFIG_FILE}")"
if [ "${REMAP}" = "acports" ] || [ "${REMAP}" = "maxports" ]; then
PORTMAP="$(readConfigKey "cmdline.SataPortMap" "${USER_CONFIG_FILE}")"
DISKMAP="$(readConfigKey "cmdline.DiskIdxMap" "${USER_CONFIG_FILE}")"
elif [ "${REMAP}" = "remap" ]; then
PORTMAP="$(readConfigKey "cmdline.sata_remap" "${USER_CONFIG_FILE}")"
elif [ "${REMAP}" = "ahci" ]; then
PORTMAP="$(readConfigKey "cmdline.ahci_remap" "${USER_CONFIG_FILE}")"
elif [ "${REMAP}" = "user" ]; then
PORTMAP="user"
fi
if [[ "${REMAP}" = "acports" || "${REMAP}" = "maxports" ]]; then
SPORTMAP="SataPortMap: ${PORTMAP} | ${DISKMAP}"
elif [ "${REMAP}" = "remap" ]; then
SPORTMAP="SataRemap: ${PORTMAP}"
elif [ "${REMAP}" = "ahci" ]; then
SPORTMAP="AHCIRemap: ${PORTMAP}"
elif [ "${REMAP}" = "user" ]; then
SPORTMAP=""
[ -n "${PORTMAP}" ] && SPORTMAP+="SataPortMap: ${PORTMAP}"
[ -n "${DISKMAP}" ] && SPORTMAP+="DiskIdxMap: ${DISKMAP}"
[ -n "${PORTREMAP}" ] && SPORTMAP+="SataRemap: ${PORTREMAP}"
[ -n "${AHCIPORTREMAP}" ] && SPORTMAP+="AHCIRemap: ${AHCIPORTREMAP}"
fi
# Get Config/Build Status
CONFDONE="$(readConfigKey "arc.confdone" "${USER_CONFIG_FILE}")"
BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")"
}
###############################################################################
# Menu functions
function write_menu() {
echo "$1 \"$2\" " >>"${TMP_PATH}/menu"
}
function write_menu_with_color() {
function write_menu_value() {
echo "$1 \"$2: \Z4${3:-none}\Zn\" " >>"${TMP_PATH}/menu"
}

View File

@@ -2,66 +2,66 @@
# Update Loader
function updateLoader() {
CONFDONE="$(readConfigKey "arc.confdone" "${USER_CONFIG_FILE}")"
local ARC_BRANCH="$(readConfigKey "arc.branch" "${USER_CONFIG_FILE}")"
local ARCMODE="$(readConfigKey "arc.mode" "${USER_CONFIG_FILE}")"
local ARCCONF="$(readConfigKey "${MODEL:-SA6400}.serial" "${S_FILE}")"
local TAG="${1}"
[ -n "${ARCCONF}" ] && cp -f "${S_FILE}" "${TMP_PATH}/bak.yml"
if [ -z "${TAG}" ]; then
idx=0
while [ ${idx} -le 5 ]; do # Loop 5 times, if successful, break
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)"
fi
if [ -n "${TAG}" ]; then
break
fi
sleep 3
idx=$((${idx} + 1))
done
fi
if [ -n "${TAG}" ]; then
export URL="https://github.com/AuxXxilium/arc/releases/download/${TAG}/update-${TAG}-${ARC_BRANCH}.zip"
export TAG="${TAG}"
{
{
curl -kL "${URL}" -o ${TMP_PATH}/update.zip 2>&3 3>&-
} 3>&1 >&4 4>&- |
perl -C -lane '
BEGIN {$header = "Downloading $ENV{URL}...\n\n"; $| = 1}
$pcent = $F[0];
$_ = join "", unpack("x3 a7 x4 a9 x8 a9 x7 a*") if length > 20;
s/ /\xa0/g; # replacing space with nbsp as dialog squashes spaces
if ($. <= 3) {
$header .= "$_\n";
$/ = "\r" if $. == 2
} else {
print "XXX\n$pcent\n$header$_\nXXX"
}' 4>&- |
dialog --gauge "Download Update: ${TAG}..." 14 72 4>&-
} 4>&1
if [ -f "${TMP_PATH}/update.zip" ] && [ $(ls -s "${TMP_PATH}/update.zip" | cut -d' ' -f1) -gt 300000 ]; then
HASHURL="https://github.com/AuxXxilium/arc/releases/download/${TAG}/update-${TAG}-${ARC_BRANCH}.hash"
HASH="$(curl -skL "${HASHURL}" | awk '{print $1}')"
if [ "${HASH}" != "$(sha256sum "${TMP_PATH}/update.zip" | awk '{print $1}')" ]; then
dialog --backtitle "$(backtitle)" --title "Update Loader" --aspect 18 \
--infobox "Update failed - Hash mismatch!\nTry again later." 0 0
if [ "${TAG}" != "zip" ]; then
if [ -z "${TAG}" ]; then
idx=0
while [ ${idx} -le 5 ]; do # Loop 5 times, if successful, break
if [ "${ARC_BRANCH}" = "dev" ]; then
TAG="$(curl -m 10 -skL "https://api.github.com/repos/AuxXxilium/arc/releases" | jq -r ".[].tag_name" | grep "dev" | sort -rV | head -1)"
else
TAG="$(curl -m 10 -skL "https://api.github.com/repos/AuxXxilium/arc/releases" | jq -r ".[].tag_name" | grep -v "dev" | sort -rV | head -1)"
fi
if [ -n "${TAG}" ]; then
break
fi
sleep 3
exec reboot
else
rm -rf "/mnt/update"
mkdir -p "${TMP_PATH}/update"
dialog --backtitle "$(backtitle)" --title "Update Loader" \
--infobox "Updating Loader..." 3 50
if unzip -oq "${TMP_PATH}/update.zip" -d "${TMP_PATH}/update"; then
cp -rf "${TMP_PATH}/update"/* "/mnt"
rm -rf "${TMP_PATH}/update"
rm -f "${TMP_PATH}/update.zip"
idx=$((${idx} + 1))
done
fi
if [ -n "${TAG}" ]; then
export URL="https://github.com/AuxXxilium/arc/releases/download/${TAG}/update-${TAG}-${ARC_BRANCH}.zip"
export TAG="${TAG}"
{
{
curl -kL "${URL}" -o ${TMP_PATH}/update.zip 2>&3 3>&-
} 3>&1 >&4 4>&- |
perl -C -lane '
BEGIN {$header = "Downloading $ENV{URL}...\n\n"; $| = 1}
$pcent = $F[0];
$_ = join "", unpack("x3 a7 x4 a9 x8 a9 x7 a*") if length > 20;
s/ /\xa0/g; # replacing space with nbsp as dialog squashes spaces
if ($. <= 3) {
$header .= "$_\n";
$/ = "\r" if $. == 2
} else {
print "XXX\n$pcent\n$header$_\nXXX"
}' 4>&- |
dialog --gauge "Download Update: ${TAG}..." 14 72 4>&-
} 4>&1
fi
if [ -f "${TMP_PATH}/update.zip" ] && [ $(ls -s "${TMP_PATH}/update.zip" | cut -d' ' -f1) -gt 300000 ]; then
if [ "${TAG}" != "zip" ]; then
HASHURL="https://github.com/AuxXxilium/arc/releases/download/${TAG}/update-${TAG}-${ARC_BRANCH}.hash"
HASH="$(curl -skL "${HASHURL}" | awk '{print $1}')"
if [ "${HASH}" != "$(sha256sum "${TMP_PATH}/update.zip" | awk '{print $1}')" ]; then
dialog --backtitle "$(backtitle)" --title "Update Loader" --aspect 18 \
--infobox "Update failed - Hash mismatch!\nTry again later." 0 0
sleep 3
exec reboot
fi
fi
if [ "$(cat "${PART1_PATH}/ARC-VERSION")" = "${TAG}" ]; then
rm -rf "/mnt/update"
mkdir -p "${TMP_PATH}/update"
dialog --backtitle "$(backtitle)" --title "Update Loader" \
--infobox "Updating Loader..." 3 50
if unzip -oq "${TMP_PATH}/update.zip" -d "${TMP_PATH}/update"; then
cp -rf "${TMP_PATH}/update"/* "/mnt"
rm -rf "${TMP_PATH}/update"
rm -f "${TMP_PATH}/update.zip"
fi
if [ "$(cat "${PART1_PATH}/ARC-VERSION")" = "${TAG}" ] || [ "${TAG}" = "zip" ]; then
dialog --backtitle "$(backtitle)" --title "Update Loader" \
--infobox "Update Loader successful!" 3 50
sleep 2

View File

@@ -162,7 +162,7 @@ echo
echo -e "\033[1;37mDetected ${ETHN} NIC:\033[0m"
IPCON=""
echo
[ ! -f /var/run/dhcpcd/pid ] && /etc/init.d/S41dhcpcd restart >/dev/null 2>&1 || true
[ ! -f /var/run/dhcpcd/pid ] && /etc/init.d/S09dhcpcd restart >/dev/null 2>&1 || true
sleep 3
checkNIC
echo

View File

@@ -29,7 +29,7 @@ done
popd
rm -f grub.img
dd if=/dev/zero of=grub.img bs=1M seek=2048 count=0
dd if=/dev/zero of=grub.img bs=1M seek=1000 count=0
echo -e "n\np\n1\n\n+50M\nn\np\n2\n\n+50M\nn\np\n3\n\n\na\n1\nw\nq\n" | fdisk grub.img
fdisk -l grub.img