-
-
Notifications
You must be signed in to change notification settings - Fork 209
Read and measure CBFS files into initrd #357
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
37feebd
Read and measure CBFS files into initrd during init
flammit d0294b1
Add all supported network modules to network-init-recovery
flammit e0c1ab2
Update cbfs-init script for new cbfs tool option
flammit 8b1d194
Update flashtools patch with latest
flammit 8644a36
Drop unnecessary flashtools.patch
flammit 48ca75a
Add "heads/" prefix to all Heads-related cbfs files
flammit 1cbae3c
Preserve custom CBFS files on flashrom updates
flammit 789c2db
Add flashtool to all coreboot-based boards
flammit c0f3a4b
Read and measure an EFI file into initrd during init
flammit File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| #!/bin/ash | ||
| set -e -o pipefail | ||
| . /etc/functions | ||
|
|
||
| # 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| #!/bin/ash | ||
| set -e -o pipefail | ||
| . /etc/functions | ||
|
|
||
| # Post processing of keys | ||
| gpg --import /.gnupg/keys/* 2>/dev/null || true | ||
|
|
||
| # TODO: split out gpg keys into multiple rings by function |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| #!/bin/ash | ||
| set -e -o pipefail | ||
| . /etc/functions | ||
|
|
||
| # Update initrd with CBFS files | ||
| if [ -z "$CONFIG_PCR" ]; then | ||
| CONFIG_PCR=7 | ||
| fi | ||
|
|
||
| CONFIG_GUID="74696e69-6472-632e-7069-6f2f75736572" | ||
|
|
||
| # copy EFI file named $CONFIG_GUID to /tmp, measure and extract | ||
| GUID=`uefi -l | grep "^$CONFIG_GUID"` | ||
|
|
||
| if [ -n "GUID" ]; then | ||
| echo "Loading $GUID from ROM" | ||
| TMPFILE=/tmp/uefi.$$ | ||
| uefi -r $GUID | gunzip -c > $TMPFILE \ | ||
| || die "Failed to read config GUID from ROM" | ||
|
|
||
| if [ "$CONFIG_TPM" = "y" ]; then | ||
| tpm extend -ix "$CONFIG_PCR" -if $TMPFILE \ | ||
| || die "$filename: tpm extend failed" | ||
| fi | ||
|
|
||
| ( cd / ; cpio -iud < $TMPFILE 2>/dev/null ) \ | ||
| || die "Failed to extract config GUID" | ||
| fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -21,6 +21,7 @@ flashtools_output := \ | |
| peek \ | ||
| poke \ | ||
| cbfs \ | ||
| uefi \ | ||
|
|
||
| flashtools_libraries := \ | ||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is
$CUSTOMPWD?