mirror of
https://github.com/linuxboot/heads.git
synced 2025-01-18 10:46:44 +00:00
ash_functions: Log board and version when entering recovery shell
Log the board and version when entering the recovery shell. Extract the firmware version logic from init. Currently this is the only way to get the debug log. If we add a way from the GUI, we may want to log the board and version somewhere else too. Signed-off-by: Jonathon Hall <jonathon.hall@puri.sm>
This commit is contained in:
parent
a767347afd
commit
00ce2f4d1c
@ -42,6 +42,12 @@ LOG() {
|
||||
echo "LOG: $*" >>/tmp/debug.log
|
||||
}
|
||||
|
||||
fw_version() {
|
||||
local FW_VER=$(dmesg | grep 'DMI' | grep -o 'BIOS.*' | cut -f2- -d ' ')
|
||||
# chop off date, since will always be epoch w/timeless builds
|
||||
echo "${FW_VER::-10}"
|
||||
}
|
||||
|
||||
preserve_rom() {
|
||||
TRACE "Under /etc/ash_functions:preserve_rom"
|
||||
new_rom="$1"
|
||||
@ -232,6 +238,8 @@ recovery() {
|
||||
touch /tmp/config
|
||||
. /tmp/config
|
||||
|
||||
DEBUG "Board $CONFIG_BOARD - version $(fw_version)"
|
||||
|
||||
if [ "$CONFIG_TPM" = "y" ]; then
|
||||
DEBUG "Extending TPM PCR 4 for recovery shell access"
|
||||
tpmr extend -ix 4 -ic recovery
|
||||
|
@ -203,9 +203,7 @@ if [ "$CONFIG_BASIC" = "y" ]; then
|
||||
fi
|
||||
|
||||
# export firmware version
|
||||
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}
|
||||
export FW_VER=$(fw_version)
|
||||
|
||||
# Add our boot devices into the /etc/fstab, if they are defined
|
||||
# in the configuration file.
|
||||
|
Loading…
Reference in New Issue
Block a user