arc: do more work

Signed-off-by: AuxXxilium <info@auxxxilium.tech>
This commit is contained in:
AuxXxilium
2024-06-29 15:39:23 +02:00
parent 878dc47783
commit eb6336e49c
3 changed files with 53 additions and 39 deletions

View File

@@ -1,4 +1,3 @@
############################################################################### ###############################################################################
# Permits user edit the user config # Permits user edit the user config
function editUserConfig() { function editUserConfig() {
@@ -1094,12 +1093,12 @@ function sysinfo() {
EXTERNALCONTROLLER="$(readConfigKey "device.externalcontroller" "${USER_CONFIG_FILE}")" EXTERNALCONTROLLER="$(readConfigKey "device.externalcontroller" "${USER_CONFIG_FILE}")"
HARDDRIVES="$(readConfigKey "device.harddrives" "${USER_CONFIG_FILE}")" HARDDRIVES="$(readConfigKey "device.harddrives" "${USER_CONFIG_FILE}")"
DRIVES="$(readConfigKey "device.drives" "${USER_CONFIG_FILE}")" DRIVES="$(readConfigKey "device.drives" "${USER_CONFIG_FILE}")"
MODULESINFO=$(lsmod | awk -F' ' '{print $1}' | grep -v 'Module') MODULESINFO="$(lsmod | awk -F' ' '{print $1}' | grep -v 'Module')"
MODULESVERSION=$(cat "${MODULES_PATH}/VERSION") MODULESVERSION="$(cat "${MODULES_PATH}/VERSION")"
ADDONSVERSION=$(cat "${ADDONS_PATH}/VERSION") ADDONSVERSION="$(cat "${ADDONS_PATH}/VERSION")"
LKMVERSION=$(cat "${LKMS_PATH}/VERSION") LKMVERSION="$(cat "${LKMS_PATH}/VERSION")"
CONFIGSVERSION=$(cat "${MODEL_CONFIG_PATH}/VERSION") CONFIGSVERSION="$(cat "${MODEL_CONFIG_PATH}/VERSION")"
PATCHESVERSION=$(cat "${PATCH_PATH}/VERSION") PATCHESVERSION="$(cat "${PATCH_PATH}/VERSION")"
TIMEOUT=5 TIMEOUT=5
TEXT="" TEXT=""
# Print System Informations # Print System Informations
@@ -1277,29 +1276,47 @@ function sysinfo() {
TEXT+="\n Drives total: \Zb${NUMPORTS}\Zn" TEXT+="\n Drives total: \Zb${NUMPORTS}\Zn"
[ -f "${TMP_PATH}/diag" ] && rm -f "${TMP_PATH}/diag" >/dev/null [ -f "${TMP_PATH}/diag" ] && rm -f "${TMP_PATH}/diag" >/dev/null
echo -e "${TEXT}" >"${TMP_PATH}/diag" echo -e "${TEXT}" >"${TMP_PATH}/diag"
dialog --backtitle "$(backtitle)" --colors --title "Sysinfo" \ while true; do
--ok-label "Exit" --help-button --help-label "Networkdiag" --extra-button --extra-label "Upload" \ dialog --backtitle "$(backtitle)" --colors --ok-label "Exit" --help-button --help-label "Show Cmdline" \
--msgbox "${TEXT}" 0 0 --extra-button --extra-label "Upload" --title "Sysinfo" --msgbox "${TEXT}" 0 0
RET=$? RET=$?
case ${RET} in case ${RET} in
0) # ok-button 0) # ok-button
return 0 return 0
;; break
2) # help-button ;;
networkdiag 2) # help-button
;; getCMDline
3) # extra-button ;;
if [ -f "${TMP_PATH}/diag" ]; then 3) # extra-button
GENHASH="$(cat "${TMP_PATH}/diag" | curl -s -F "content=<-" http://dpaste.com/api/v2/ | cut -c 19-)" uploadDiag
dialog --backtitle "$(backtitle)" --title "Sysinfo Upload" --msgbox "Your Code: ${GENHASH}" 0 0 ;;
else 255) # ESC-button
dialog --backtitle "$(backtitle)" --title "Sysinfo Upload" --msgbox "No Diag File found!" 0 0 return 0
fi break
;; ;;
255) # ESC esac
return 0 done
;; return
esac }
function getCMDline () {
if [ -f "${PART1_PATH}/cmdline.yml" ]; then
GETCMDLINE=$(cat "${PART1_PATH}/cmdline.yml")
dialog --backtitle "$(backtitle)" --title "Sysinfo Cmdline" --msgbox "${GETCMDLINE}" 7 100
else
dialog --backtitle "$(backtitle)" --title "Sysinfo Cmdline" --msgbox "Cmdline File found!" 0 0
fi
return
}
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
else
dialog --backtitle "$(backtitle)" --title "Sysinfo Upload" --msgbox "No Diag File found!" 0 0
fi
return return
} }
@@ -1363,7 +1380,7 @@ function networkdiag() {
} }
############################################################################### ###############################################################################
# Shows Systeminfo to user # Shows Credits to user
function credits() { function credits() {
# Print Credits Informations # Print Credits Informations
TEXT="" TEXT=""

View File

@@ -497,7 +497,7 @@ function arcSettings() {
if [ "${CUSTOM}" == "false" ]; then if [ "${CUSTOM}" == "false" ]; then
# Ask for Build # Ask for Build
dialog --clear --backtitle "$(backtitle)" --title "Config done" \ dialog --clear --backtitle "$(backtitle)" --title "Config done" \
--menu "Build now?" 7 40 0 \ --no-cancel --menu "Build now?" 7 40 0 \
1 "Yes - Build Arc Loader now" \ 1 "Yes - Build Arc Loader now" \
2 "No - I want to make changes" \ 2 "No - I want to make changes" \
2>"${TMP_PATH}/resp" 2>"${TMP_PATH}/resp"
@@ -802,7 +802,7 @@ function arcFinish() {
[ -f "${PART3_PATH}/automated" ] && rm -f "${PART3_PATH}/automated" >/dev/null [ -f "${PART3_PATH}/automated" ] && rm -f "${PART3_PATH}/automated" >/dev/null
# Ask for Boot # Ask for Boot
dialog --clear --backtitle "$(backtitle)" --title "Build done"\ dialog --clear --backtitle "$(backtitle)" --title "Build done"\
--menu "Boot now?" 7 40 0 \ --no-cancel --menu "Boot now?" 7 40 0 \
1 "Yes - Boot Arc Loader now" \ 1 "Yes - Boot Arc Loader now" \
2 "No - I want to make changes" \ 2 "No - I want to make changes" \
2>"${TMP_PATH}/resp" 2>"${TMP_PATH}/resp"

View File

@@ -1,11 +1,8 @@
#!/usr/bin/env bash
set -e
[[ -z "${ARC_PATH}" || ! -d "${ARC_PATH}/include" ]] && ARC_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")" 2>/dev/null && pwd)"
############################################################################### ###############################################################################
# Boot # Boot
function bootDSM () { function bootDSM () {
# Check if machine has EFI
[ -d /sys/firmware/efi ] && EFI=1 || EFI=0
# Print Title centralized # Print Title centralized
clear clear
COLUMNS=${COLUMNS:-50} COLUMNS=${COLUMNS:-50}
@@ -181,7 +178,7 @@ function bootDSM () {
[ -n "${VALUE}" ] && CMDLINE_LINE+="=${VALUE}" [ -n "${VALUE}" ] && CMDLINE_LINE+="=${VALUE}"
done done
CMDLINE_LINE=$(echo "${CMDLINE_LINE}" | sed 's/^ //') # Remove leading space CMDLINE_LINE=$(echo "${CMDLINE_LINE}" | sed 's/^ //') # Remove leading space
echo "${CMDLINE_LINE}" >"${PART1_PATH}/cmdline.yml"
# Boot # Boot
DIRECTBOOT="$(readConfigKey "arc.directboot" "${USER_CONFIG_FILE}")" DIRECTBOOT="$(readConfigKey "arc.directboot" "${USER_CONFIG_FILE}")"
if [ "${DIRECTBOOT}" == "true" ]; then if [ "${DIRECTBOOT}" == "true" ]; then