Compare commits

..

7 Commits

Author SHA1 Message Date
AuxXxilium
6b2fc8b0a5 Merge pull request #5282 from AuxXxilium/dev
Dev
2024-12-20 16:16:24 +01:00
AuxXxilium
10b0d1c64f tree: fix more logic
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-12-20 16:13:57 +01:00
AuxXxilium
2fdb4a5e69 tree: logic fix
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-12-20 15:35:02 +01:00
AuxXxilium
8f4cb31962 Merge pull request #5255 from AuxXxilium/dev
Dev
2024-12-18 21:25:18 +01:00
AuxXxilium
3b62345e5a grub: update 2024-12-17 23:21:27 2024-12-18 20:50:57 +01:00
AuxXxilium
f564167e9d tree: fix logic
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-12-18 20:50:37 +01:00
AuxXxilium
67e3d5c0f8 tree: cleanup
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-12-16 17:56:28 +01:00
5 changed files with 59 additions and 45 deletions

View File

@@ -286,6 +286,9 @@ function modulesMenu() {
writeConfigKey "arc.builddone" "false" "${USER_CONFIG_FILE}"
BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")"
;;
*)
break
;;
esac
done
return
@@ -496,6 +499,9 @@ function cmdlineMenu() {
writeConfigKey "arc.builddone" "false" "${USER_CONFIG_FILE}"
BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")"
;;
*)
break
;;
esac
done
return
@@ -591,6 +597,9 @@ function synoinfoMenu() {
writeConfigKey "arc.builddone" "false" "${USER_CONFIG_FILE}"
BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")"
;;
*)
break
;;
esac
done
return
@@ -678,6 +687,9 @@ function sequentialIOMenu() {
--msgbox "SequentialIO disabled" 0 0
SEQUENTIAL="false"
;;
*)
break
;;
esac
writeConfigKey "addons.sequentialio" "${SEQUENTIAL}" "${USER_CONFIG_FILE}"
break
@@ -694,8 +706,9 @@ function backupMenu() {
NEXT="1"
USERID="$(readConfigKey "arc.userid" "${USER_CONFIG_FILE}")"
ARCOFFLINE="$(readConfigKey "arc.offline" "${USER_CONFIG_FILE}")"
CONFDONE="$(readConfigKey "arc.confdone" "${USER_CONFIG_FILE}")"
while true; do
if [ -n "${USERID}" ] && [ "${ARCOFFLINE}" != "true" ]; then
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 HW Encryption Key from DSM" \
@@ -703,6 +716,13 @@ function backupMenu() {
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 HW Encryption Key from DSM" \
3 "Backup HW Encryption Key to DSM" \
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" \
@@ -867,6 +887,9 @@ function backupMenu() {
dialog --backtitle "$(backtitle)" --title "Online Backup" --msgbox "Online Backup failed!" 5 40
fi
;;
*)
break
;;
esac
done
}
@@ -933,6 +956,9 @@ function updateMenu() {
fi
writeConfigKey "arc.branch" "${ARC_BRANCH}" "${USER_CONFIG_FILE}"
;;
*)
break
;;
esac
done
return
@@ -1193,24 +1219,20 @@ function sysinfo() {
NUMPORTS=$((${NUMPORTS} + ${PORTNUM}))
fi
TEXT+="\n Total Disks: \Zb${NUMPORTS}\Zn"
if [ -n "${USERID}" ]; then
if [ -n "${USERID}" ] && [ "${CONFDONE}" = "true" ]; 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
2)
getCMDline
;;
3) # extra-button
3)
uploadDiag
;;
255) # ESC-button
*)
return 0
break
;;
@@ -1222,14 +1244,10 @@ function sysinfo() {
--title "Sysinfo" --msgbox "${TEXT}" 0 0
RET=$?
case ${RET} in
0) # ok-button
return 0
break
;;
2) # help-button
2)
getCMDline
;;
255) # ESC-button
*)
return 0
break
;;
@@ -1386,7 +1404,7 @@ function staticIPMenu() {
2>"${TMP_PATH}/resp"
RET=$?
case ${RET} in
0) # ok-button
0)
address="$(sed -n '1p' "${TMP_PATH}/resp" 2>/dev/null)"
netmask="$(sed -n '2p' "${TMP_PATH}/resp" 2>/dev/null)"
gateway="$(sed -n '3p' "${TMP_PATH}/resp" 2>/dev/null)"
@@ -1425,10 +1443,10 @@ function staticIPMenu() {
--progressbox "Setting IP ..." 20 100
break
;;
1) # cancel-button
1)
break
;;
255) # ESC
*)
break 2
;;
esac
@@ -1744,10 +1762,7 @@ function loaderPorts() {
nohup "${TMP_PATH}/restartS.sh" >/dev/null 2>&1
break
;;
1) # cancel-button
break
;;
255) # ESC
*)
break
;;
esac
@@ -2038,7 +2053,7 @@ function greplogs() {
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}/logs.tar.gz"
URL="http://${IPCON}:${HTTP_PORT}/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"
@@ -2057,9 +2072,9 @@ function getbackup() {
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
mv -f "${TMP_PATH}/dsmconfig.tar.gz" "/var/www/data/dsmconfig.tar.gz"
cp -f "${TMP_PATH}/dsmconfig.tar.gz" "/var/www/data/dsmconfig.tar.gz"
chmod 644 "/var/www/data/dsmconfig.tar.gz"
URL="http://${IPCON}/dsmconfig.tar.gz"
URL="http://${IPCON}:${HTTP_PORT}/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
@@ -2248,7 +2263,7 @@ function dtsMenu() {
3 "Edit dts file" \
2>${TMP_PATH}/resp
[ $? -ne 0 ] && break
case "$(cat ${TMP_PATH}/resp)" in %) ;;
case "$(cat ${TMP_PATH}/resp)" in
1)
if ! tty 2>/dev/null | grep -q "/dev/pts"; then #if ! tty 2>/dev/null | grep -q "/dev/pts" || [ -z "${SSH_TTY}" ]; then
MSG=""
@@ -2311,7 +2326,7 @@ function dtsMenu() {
dialog --backtitle "$(backtitle)" --title "Edit with caution" \
--editbox "${TMP_PATH}/model.dts" 0 0 2>"${TMP_PATH}/modelEdit.dts"
[ $? -ne 0 ] && rm -f "${TMP_PATH}/model.dts" "${TMP_PATH}/modelEdit.dts" && return
dtc -q -I dts -O dtb "${TMP_PATH}/modelEdit.dts" >"test.dtb" 2>"${DTC_ERRLOG}"
dtc -q -I dts -O dtb "${TMP_PATH}/modelEdit.dts}" >"test.dtb" 2>"${DTC_ERRLOG}"
if [ $? -ne 0 ]; then
dialog --backtitle "$(backtitle)" --title "Custom DTS" \
--msgbox "Not a valid dts file, please try again!\n\n$(cat "${DTC_ERRLOG}")" 0 0
@@ -2325,6 +2340,9 @@ function dtsMenu() {
fi
done
;;
*)
break
;;
esac
done
}
@@ -2421,7 +2439,7 @@ function checkHardwareID() {
writeConfigKey "arc.userid" "" "${USER_CONFIG_FILE}"
[ -f "${S_FILE}.bak" ] && mv -f "${S_FILE}.bak" "${S_FILE}" 2>/dev/null
fi
return
return 0
}
###############################################################################

View File

@@ -59,7 +59,7 @@ BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")"
###############################################################################
# Mounts backtitle dynamically
function backtitle() {
BACKTITLE="${ARC_TITLE}$([ -n "${NEWTAG}" ] && [ ${ARC_VERSION//[!0-9]/} -lt ${NEWTAG//[!0-9]/} ] && echo " > ${NEWTAG}") | "
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)} | "
@@ -165,25 +165,21 @@ function arcModel() {
--file "${TMP_PATH}/menu" 2>"${TMP_PATH}/resp"
RET=$?
case ${RET} in
0) # ok-button
0)
resp=$(cat ${TMP_PATH}/resp)
[ -z "${resp}" ] && return 1
break
;;
1) # cancel-button -> Show all Models
1)
[ ${RESTRICT} -eq 1 ] && RESTRICT=0 || RESTRICT=1
;;
2) # help-button -> Exit
return 1
break
;;
3) # extra-button -> Platform Info
3)
resp=$(cat ${TMP_PATH}/resp)
PLATFORM="$(grep -w "${resp}" "${TMP_PATH}/modellist" | awk '{print $2}' | head -n 1)"
dialog --backtitle "$(backtitlep)" --colors \
--title "Platform Info" --textbox "./informations/${PLATFORM}.yml" 70 80
;;
255) # ESC -> Exit
*)
return 1
break
;;
@@ -663,13 +659,13 @@ function arcSummary() {
--extra-button --extra-label "Cancel" --msgbox "${SUMMARY}" 0 0
RET=$?
case ${RET} in
0) # ok-button
0)
make
;;
3) # extra-button
3)
return 0
;;
255) # ESC
255)
return 0
;;
esac
@@ -723,9 +719,8 @@ function make() {
sleep 2
return 1
fi
STEP="boot"
if [ -f "${ORI_ZIMAGE_FILE}" ] && [ -f "${ORI_RDGZ_FILE}" ] && [ -f "${MOD_ZIMAGE_FILE}" ] && [ -f "${MOD_RDGZ_FILE}" ]; then
MODELID=$(echo ${MODEL} | sed 's/d$/D/; s/rp$/RP/; s/rp+/RP+/')
MODELID="$(echo ${MODEL} | sed 's/d$/D/; s/rp$/RP/; s/rp+/RP+/')"
writeConfigKey "modelid" "${MODELID}" "${USER_CONFIG_FILE}"
writeConfigKey "arc.version" "${ARC_VERSION}" "${USER_CONFIG_FILE}"
arcFinish
@@ -743,6 +738,7 @@ function make() {
###############################################################################
# Finish Building Loader
function arcFinish() {
STEP="boot"
rm -f "${LOG_FILE}" >/dev/null 2>&1 || true
MODELID="$(readConfigKey "modelid" "${USER_CONFIG_FILE}")"
if [ -n "${MODELID}" ]; then

Binary file not shown.

View File

@@ -519,7 +519,7 @@ function onlineCheck() {
writeConfigKey "keymap" "${KEYMAP}" "${USER_CONFIG_FILE}"
fi
fi
[ $(echo "${ARC_VERSION}" | grep "dev" | wc -l) -eq 0 ] && NEWTAG="$(curl -m 10 -skL "https://api.github.com/repos/AuxXxilium/arc/releases" | jq -r ".[].tag_name" | grep -v "dev" | sort -rV | head -1)" || NEWTAG="$(curl -m 10 -skL "https://api.github.com/repos/AuxXxilium/arc/releases" | jq -r ".[].tag_name" | grep "dev" | sort -rV | head -1)"
NEWTAG="$(curl -m 10 -skL "https://api.github.com/repos/AuxXxilium/arc/releases" | jq -r ".[].tag_name" | grep -v "dev" | sort -rV | head -1)"
if [ -n "${NEWTAG}" ]; then
writeConfigKey "arc.offline" "false" "${USER_CONFIG_FILE}"
updateOffline

View File

@@ -166,8 +166,8 @@ mkdir -p "${RAMDISK_PATH}/addons"
echo "export PRODUCTVER=\"${PRODUCTVER}\""
echo "export MLINK=\"${PAT_URL}\""
echo "export MCHECKSUM=\"${PAT_HASH}\""
echo "export LAYOUT=\"${LAYOUT}\""
echo "export KEYMAP=\"${KEYMAP}\""
echo "export LAYOUT=\"${LAYOUT:-qwerty}\""
echo "export KEYMAP=\"${KEYMAP:-en}\""
} >"${RAMDISK_PATH}/addons/addons.sh"
chmod +x "${RAMDISK_PATH}/addons/addons.sh"