mirror of
https://github.com/linuxboot/heads.git
synced 2024-12-19 04:57:55 +00:00
8259d3ca1e
- Add TRACE function tracing output under etc/functions, depending on CONFIG_ENABLE_FUNCTION_TRACING_OUTPUT enabled in board configs - Replace current DEBUG to TRACE calls in code, reserving DEBUG calls for more verbose debugging later on (output of variables etc) - add 'export CONFIG_ENABLE_FUNCTION_TRACING_OUTPUT=y' in qemu-coreboot(fb)whiptail-tpm1(-hotp) boards to see it in action
34 lines
829 B
Bash
Executable File
34 lines
829 B
Bash
Executable File
#!/bin/ash
|
|
set -e -o pipefail
|
|
. /etc/functions
|
|
|
|
TRACE "Under /bin/cbfs-init"
|
|
|
|
# Update initrd with CBFS files
|
|
if [ -z "$CONFIG_PCR" ]; then
|
|
CONFIG_PCR=7
|
|
fi
|
|
|
|
# Load individual files
|
|
cbfsfiles=`cbfs -t 50 -l 2>/dev/null | grep "^heads/initrd/"`
|
|
|
|
for cbfsname in `echo $cbfsfiles`; do
|
|
filename=${cbfsname:12}
|
|
if [ ! -z "$filename" ]; then
|
|
echo "Loading $filename from CBFS"
|
|
mkdir -p `dirname $filename` \
|
|
|| die "$filename: mkdir failed"
|
|
cbfs -t 50 -r $cbfsname > "$filename" \
|
|
|| die "$filename: cbfs file read failed"
|
|
if [ "$CONFIG_TPM" = "y" ]; then
|
|
TMPFILE=/tmp/cbfs.$$
|
|
echo "$filename" > $TMPFILE
|
|
cat $filename >> $TMPFILE
|
|
tpm extend -ix "$CONFIG_PCR" -if $TMPFILE \
|
|
|| die "$filename: tpm extend failed"
|
|
fi
|
|
fi
|
|
done
|
|
|
|
# TODO: copy CBFS file named "heads/initrd.tgz" to /tmp, measure and extract
|