Skip to content

Commit

Permalink
Merge pull request #767 from MrChromebox/sysinfo_fixes
Browse files Browse the repository at this point in the history
gui-init: Fix RAM and firmware version strings
  • Loading branch information
tlaurion authored Jul 1, 2020
2 parents 8dc5b76 + cdbd0fc commit 54cb664
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions initrd/bin/gui-init
Original file line number Diff line number Diff line change
Expand Up @@ -377,10 +377,10 @@ while true; do

if [ "$totp_confirm" = "S" ]; then
memtotal=$(cat /proc/meminfo | grep 'MemTotal' | tr -s ' ' | cut -f2 -d ' ')
memtotal=$((${memtotal} / 1024 + 1))
memtotal=$((${memtotal} / 1024 / 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
--msgbox "VER: ${FW_VER}\n\nCPU: ${cpustr}\nRAM: ${memtotal} GB\n\n$(fdisk -l | grep -e '/dev/sd.:' -e '/dev/nvme.*:' | sed 's/B,.*/B/')" 16 60
continue
fi

Expand Down
4 changes: 3 additions & 1 deletion initrd/init
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,9 @@ combine_configs
. /tmp/config

# export firmware version
export FW_VER=$(dmesg | grep 'DMI' | grep -o 'BIOS.*' | cut -f2 -d ' ')
export FW_VER=$(dmesg | grep 'DMI' | grep -o 'BIOS.*' | cut -f2- -d ' ')
# chop off date, since will always be epoch w/timeless builds
FW_VER=${FW_VER::-10}

# Add our boot devices into the /etc/fstab, if they are defined
# in the configuration file.
Expand Down

0 comments on commit 54cb664

Please sign in to comment.