mirror of
https://github.com/linuxboot/heads.git
synced 2024-12-19 21:17:55 +00:00
Move show_system_info() from gui-init to gui-functions
Signed-off-by: Matt DeVillier <matt.devillier@puri.sm>
This commit is contained in:
parent
0967fe3201
commit
14a5d19f1f
@ -580,24 +580,6 @@ reset_tpm()
|
||||
fi
|
||||
}
|
||||
|
||||
show_system_info()
|
||||
{
|
||||
TRACE "Under /bin/gui-init:show_system_info"
|
||||
battery_charge="$(print_battery_charge)"
|
||||
battery_health="$(print_battery_health)"
|
||||
if [ -n $battery_charge -a -n $battery_health ];then
|
||||
battery_status="\nBattery charge: $battery_charge%\nBattery health: $battery_health%\n"
|
||||
fi
|
||||
|
||||
memtotal=$(cat /proc/meminfo | grep 'MemTotal' | tr -s ' ' | cut -f2 -d ' ')
|
||||
memtotal=$((${memtotal} / 1024 / 1024 + 1))
|
||||
cpustr=$(cat /proc/cpuinfo | grep 'model name' | uniq | sed -r 's/\(R\)//;s/\(TM\)//;s/CPU //;s/model name.*: //')
|
||||
kernel=$(uname -s -r)
|
||||
|
||||
whiptail $BG_COLOR_MAIN_MENU --title 'System Info' \
|
||||
--msgbox "${BOARD_NAME}\n\nFW_VER: ${FW_VER}\nKernel: ${kernel}\n\nCPU: ${cpustr}\nRAM: ${memtotal} GB\n$battery_status\n$(fdisk -l | grep -e '/dev/sd.:' -e '/dev/nvme.*:' | sed 's/B,.*/B/')" 16 60
|
||||
}
|
||||
|
||||
select_os_boot_option()
|
||||
{
|
||||
TRACE "Under /bin/gui-init:select_os_boot_option"
|
||||
|
@ -72,3 +72,21 @@ file_selector()
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
show_system_info()
|
||||
{
|
||||
TRACE "Under /bin/gui-init:show_system_info"
|
||||
battery_charge="$(print_battery_charge)"
|
||||
battery_health="$(print_battery_health)"
|
||||
if [ -n $battery_charge -a -n $battery_health ];then
|
||||
battery_status="\nBattery charge: $battery_charge%\nBattery health: $battery_health%\n"
|
||||
fi
|
||||
|
||||
memtotal=$(cat /proc/meminfo | grep 'MemTotal' | tr -s ' ' | cut -f2 -d ' ')
|
||||
memtotal=$((${memtotal} / 1024 / 1024 + 1))
|
||||
cpustr=$(cat /proc/cpuinfo | grep 'model name' | uniq | sed -r 's/\(R\)//;s/\(TM\)//;s/CPU //;s/model name.*: //')
|
||||
kernel=$(uname -s -r)
|
||||
|
||||
whiptail $BG_COLOR_MAIN_MENU --title 'System Info' \
|
||||
--msgbox "${BOARD_NAME}\n\nFW_VER: ${FW_VER}\nKernel: ${kernel}\n\nCPU: ${cpustr}\nRAM: ${memtotal} GB\n$battery_status\n$(fdisk -l | grep -e '/dev/sd.:' -e '/dev/nvme.*:' | sed 's/B,.*/B/')" 16 60
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user