boot: add hwid output to bootscreen options

Signed-off-by: AuxXxilium <info@auxxxilium.tech>
This commit is contained in:
AuxXxilium
2024-12-20 16:32:45 +01:00
parent 10b0d1c64f
commit a1055d68be
3 changed files with 20 additions and 12 deletions

View File

@@ -2445,20 +2445,21 @@ function checkHardwareID() {
###############################################################################
# Bootsreen Menu
function bootScreen () {
rm -f "${TMP_PATH}/boot" "${TMP_PATH}/opts" "${TMP_PATH}/resp" >/dev/null
rm -f "${TMP_PATH}/bootscreen" "${TMP_PATH}/opts" "${TMP_PATH}/resp" >/dev/null
unset BOOTSCREENS
declare -A BOOTSCREENS
while IFS=': ' read -r KEY VALUE; do
[ -n "${KEY}" ] && BOOTSCREENS["${KEY}"]="${VALUE}"
done < <(readConfigMap "boot" "${USER_CONFIG_FILE}")
echo -e "dsminfo" >"${TMP_PATH}/boot"
echo -e "systeminfo" >>"${TMP_PATH}/boot"
echo -e "diskinfo" >>"${TMP_PATH}/boot"
echo -e "dsmlogo" >>"${TMP_PATH}/boot"
done < <(readConfigMap "bootscreen" "${USER_CONFIG_FILE}")
echo -e "dsminfo" >"${TMP_PATH}/bootscreen"
echo -e "systeminfo" >>"${TMP_PATH}/bootscreen"
echo -e "diskinfo" >>"${TMP_PATH}/bootscreen"
echo -e "hwidinfo" >>"${TMP_PATH}/bootscreen"
echo -e "dsmlogo" >>"${TMP_PATH}/bootscreen"
while read -r BOOTSCREEN; do
arrayExistItem "${BOOTSCREEN}" "${!BOOTSCREENS[@]}" && ACT="on" || ACT="off"
echo -e "${BOOTSCREEN} \"${DESC}\" ${ACT}" >>"${TMP_PATH}/opts"
done < <(cat "${TMP_PATH}/boot")
done < <(cat "${TMP_PATH}/bootscreen")
dialog --backtitle "$(backtitle)" --title "Bootscreen" --colors --aspect 18 \
--checklist "Select Bootscreen Informations\Zn\nSelect with SPACE, Confirm with ENTER!" 0 0 0 \
--file "${TMP_PATH}/opts" 2>"${TMP_PATH}/resp"
@@ -2466,9 +2467,9 @@ function bootScreen () {
resp=$(cat ${TMP_PATH}/resp)
unset BOOTSCREENS
declare -A BOOTSCREENS
writeConfigKey "boot" "{}" "${USER_CONFIG_FILE}"
writeConfigKey "bootscreen" "{}" "${USER_CONFIG_FILE}"
for BOOTSCREEN in ${resp}; do
BOOTSCREENS["${BOOTSCREEN}"]=""
writeConfigKey "boot.\"${BOOTSCREEN}\"" "true" "${USER_CONFIG_FILE}"
writeConfigKey "bootscreen.\"${BOOTSCREEN}\"" "true" "${USER_CONFIG_FILE}"
done
}

View File

@@ -55,9 +55,10 @@ LKM="$(readConfigKey "lkm" "${USER_CONFIG_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')"
DSMINFO="$(readConfigKey "boot.dsminfo" "${USER_CONFIG_FILE}")"
SYSTEMINFO="$(readConfigKey "boot.systeminfo" "${USER_CONFIG_FILE}")"
DISKINFO="$(readConfigKey "boot.diskinfo" "${USER_CONFIG_FILE}")"
DSMINFO="$(readConfigKey "bootscreen.dsminfo" "${USER_CONFIG_FILE}")"
SYSTEMINFO="$(readConfigKey "bootscreen.systeminfo" "${USER_CONFIG_FILE}")"
DISKINFO="$(readConfigKey "bootscreen.diskinfo" "${USER_CONFIG_FILE}")"
HWIDINFO="$(readConfigKey "bootscreen.hwidinfo" "${USER_CONFIG_FILE}")"
if [ "${DSMINFO}" = "true" ]; then
echo -e "\033[1;37mDSM:\033[0m"
@@ -78,6 +79,10 @@ 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
if [ "${HWIDINFO}" = "true" ]; then
echo -e "\033[1;37mHWID:\033[0m"
echo -e "HWID: \033[1;37m$(genHWID)\033[0m"
fi
if ! readConfigMap "addons" "${USER_CONFIG_FILE}" | grep -q nvmesystem; then
HASATA=0

View File

@@ -44,6 +44,8 @@ initConfigKey "arc.version" "${ARC_VERSION}" "${USER_CONFIG_FILE}"
initConfigKey "boot" "{}" "${USER_CONFIG_FILE}"
initConfigKey "boot.dsminfo" "true" "${USER_CONFIG_FILE}"
initConfigKey "boot.systeminfo" "true" "${USER_CONFIG_FILE}"
initConfigKey "boot.diskinfo" "false" "${USER_CONFIG_FILE}"
initConfigKey "boot.hwidinfo" "false" "${USER_CONFIG_FILE}"
initConfigKey "boot.dsmlogo" "true" "${USER_CONFIG_FILE}"
initConfigKey "bootipwait" "30" "${USER_CONFIG_FILE}"
initConfigKey "device" "{}" "${USER_CONFIG_FILE}"