mirror of
https://github.com/linuxboot/heads.git
synced 2025-01-30 16:14:01 +00:00
Merge pull request #760 from Nitrokey/menu-systeminfo
Add systeminfo menu option
This commit is contained in:
commit
e6037a217e
@ -218,6 +218,7 @@ while true; do
|
||||
'y' ' Default boot' \
|
||||
'r' ' Refresh TOTP/HOTP' \
|
||||
'a' ' Options -->' \
|
||||
'S' ' System Info' \
|
||||
'P' ' Power Off' \
|
||||
2>/tmp/whiptail || recovery "GUI menu failed"
|
||||
|
||||
@ -374,6 +375,15 @@ while true; do
|
||||
continue
|
||||
fi
|
||||
|
||||
if [ "$totp_confirm" = "S" ]; then
|
||||
memtotal=$(cat /proc/meminfo | grep 'MemTotal' | tr -s ' ' | cut -f2 -d ' ')
|
||||
memtotal=$((${memtotal} / 1024 + 1))
|
||||
cpustr=$(cat /proc/cpuinfo | grep 'model name' | uniq | sed -r 's/\(R\)//;s/\(TM\)//;s/CPU //;s/model name.*: //')
|
||||
whiptail --title 'System Info' \
|
||||
--msgbox "VER: ${FW_VER}\n\nCPU: ${cpustr}\nRAM: ${memtotal} MB\n\n$(fdisk -l | grep -e '/dev/sd.:' -e '/dev/nvme.*:' | sed 's/B,.*/B/')" 16 60
|
||||
continue
|
||||
fi
|
||||
|
||||
if [ "$totp_confirm" = "F" ]; then
|
||||
oem-factory-reset
|
||||
continue
|
||||
|
@ -92,6 +92,9 @@ fi
|
||||
combine_configs
|
||||
. /tmp/config
|
||||
|
||||
# export firmware version
|
||||
export FW_VER=$(dmesg | grep 'DMI' | grep -o 'BIOS.*' | cut -f2 -d ' ')
|
||||
|
||||
# Add our boot devices into the /etc/fstab, if they are defined
|
||||
# in the configuration file.
|
||||
if [ ! -z "$CONFIG_BOOT_DEV" ]; then
|
||||
|
Loading…
x
Reference in New Issue
Block a user