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
function editUserConfig() {
@@ -1094,12 +1093,12 @@ function sysinfo() {
EXTERNALCONTROLLER="$(readConfigKey "device.externalcontroller" "${USER_CONFIG_FILE}")"
HARDDRIVES="$(readConfigKey "device.harddrives" "${USER_CONFIG_FILE}")"
DRIVES="$(readConfigKey "device.drives" "${USER_CONFIG_FILE}")"
MODULESINFO=$(lsmod | awk -F' ' '{print $1}' | grep -v 'Module')
MODULESVERSION=$(cat "${MODULES_PATH}/VERSION")
ADDONSVERSION=$(cat "${ADDONS_PATH}/VERSION")
LKMVERSION=$(cat "${LKMS_PATH}/VERSION")
CONFIGSVERSION=$(cat "${MODEL_CONFIG_PATH}/VERSION")
PATCHESVERSION=$(cat "${PATCH_PATH}/VERSION")
MODULESINFO="$(lsmod | awk -F' ' '{print $1}' | grep -v 'Module')"
MODULESVERSION="$(cat "${MODULES_PATH}/VERSION")"
ADDONSVERSION="$(cat "${ADDONS_PATH}/VERSION")"
LKMVERSION="$(cat "${LKMS_PATH}/VERSION")"
CONFIGSVERSION="$(cat "${MODEL_CONFIG_PATH}/VERSION")"
PATCHESVERSION="$(cat "${PATCH_PATH}/VERSION")"
TIMEOUT=5
TEXT=""
# Print System Informations
@@ -1277,29 +1276,47 @@ function sysinfo() {
TEXT+="\n Drives total: \Zb${NUMPORTS}\Zn"
[ -f "${TMP_PATH}/diag" ] && rm -f "${TMP_PATH}/diag" >/dev/null
echo -e "${TEXT}" >"${TMP_PATH}/diag"
dialog --backtitle "$(backtitle)" --colors --title "Sysinfo" \
--ok-label "Exit" --help-button --help-label "Networkdiag" --extra-button --extra-label "Upload" \
--msgbox "${TEXT}" 0 0
RET=$?
case ${RET} in
0) # ok-button
return 0
;;
2) # help-button
networkdiag
;;
3) # extra-button
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}" 0 0
else
dialog --backtitle "$(backtitle)" --title "Sysinfo Upload" --msgbox "No Diag File found!" 0 0
fi
;;
255) # ESC
return 0
;;
esac
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
return
}
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
}
@@ -1363,7 +1380,7 @@ function networkdiag() {
}
###############################################################################
# Shows Systeminfo to user
# Shows Credits to user
function credits() {
# Print Credits Informations
TEXT=""

View File

@@ -497,7 +497,7 @@ function arcSettings() {
if [ "${CUSTOM}" == "false" ]; then
# Ask for Build
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" \
2 "No - I want to make changes" \
2>"${TMP_PATH}/resp"
@@ -802,7 +802,7 @@ function arcFinish() {
[ -f "${PART3_PATH}/automated" ] && rm -f "${PART3_PATH}/automated" >/dev/null
# Ask for Boot
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" \
2 "No - I want to make changes" \
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
function bootDSM () {
# Check if machine has EFI
[ -d /sys/firmware/efi ] && EFI=1 || EFI=0
# Print Title centralized
clear
COLUMNS=${COLUMNS:-50}
@@ -181,7 +178,7 @@ function bootDSM () {
[ -n "${VALUE}" ] && CMDLINE_LINE+="=${VALUE}"
done
CMDLINE_LINE=$(echo "${CMDLINE_LINE}" | sed 's/^ //') # Remove leading space
echo "${CMDLINE_LINE}" >"${PART1_PATH}/cmdline.yml"
# Boot
DIRECTBOOT="$(readConfigKey "arc.directboot" "${USER_CONFIG_FILE}")"
if [ "${DIRECTBOOT}" == "true" ]; then