forked from sonic-net/sonic-buildimage
-
Notifications
You must be signed in to change notification settings - Fork 0
[202211] Add Secure Boot Support backport with fixes #37
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
Closed
Closed
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
5265450
[Secure Boot] Add Secure Boot Support (#12692)
davidpil2002 6584f9c
Remove default value from SECURE_UPGRADE_DEV_SIGNING_KEY (#14582)
DavidZagury 8fba064
Change SECURE_UPGRADE_DEV_SIGNING_CERT to SECURE_UPGRADE_SIGNING_CERT…
DavidZagury b237513
Add SECURE_UPGRADE_PROD_TOOL_ARGS flag to make it possible for vendor…
DavidZagury 283dfd1
Fix issue with prod script not found, change the prod signing to work…
DavidZagury 6fc9edc
[secure boot]Fix mokutil check issue with ONIE version older than 202…
DavidZagury 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| #!/bin/sh | ||
|
|
||
| set -e | ||
|
|
||
| # | ||
| # Sign efi file with secret key and certificate | ||
| # - shim | ||
| # - grub | ||
| # - vmlinuz | ||
| # | ||
| print_usage() { | ||
| cat <<EOF | ||
|
|
||
| $0: Usage | ||
| $0 -p <PRIVATE_KEY_PEM> -c <CERT_PEM> -e <EFI_FILE> -s <EFI_FILE_SIGNED> | ||
| Usage example: efi-sign.sh -p priv-key.pem -c pub-key.pem -e shimx64.efi -s shimx64-signed.efi | ||
|
|
||
| EOF | ||
| } | ||
|
|
||
| while getopts 'p:c:e:s:hv' flag; do | ||
| case "${flag}" in | ||
| p) PRIVATE_KEY_PEM="${OPTARG}" ;; | ||
| c) CERT_PEM="${OPTARG}" ;; | ||
| e) EFI_FILE="${OPTARG}" ;; | ||
| s) EFI_FILE_SIGNED="${OPTARG}" ;; | ||
| v) VERBOSE='true' ;; | ||
| h) print_usage | ||
| exit 1 ;; | ||
| esac | ||
| done | ||
| if [ $OPTIND -eq 1 ]; then echo "no options were pass"; print_usage; exit 1 ;fi | ||
|
|
||
| [ -f "$PRIVATE_KEY_PEM" ] || { | ||
| echo "Error: PRIVATE_KEY_PEM file does not exist: $PRIVATE_KEY_PEM" | ||
| print_usage | ||
| exit 1 | ||
| } | ||
|
|
||
| [ -f "$CERT_PEM" ] || { | ||
| echo "Error: CERT_PEM file does not exist: $CERT_PEM" | ||
| print_usage | ||
| exit 1 | ||
| } | ||
|
|
||
| [ -f "$EFI_FILE" ] || { | ||
| echo "Error: File for signing does not exist: $EFI_FILE" | ||
| print_usage | ||
| exit 1 | ||
| } | ||
|
|
||
| if [ -z ${EFI_FILE_SIGNED} ]; then | ||
| echo "ERROR: no arg named <EFI_FILE_SIGNED> supplied" | ||
| print_usage | ||
| exit 1 | ||
| fi | ||
|
|
||
| echo "$0 signing $EFI_FILE with ${PRIVATE_KEY_PEM}, ${CERT_PEM} to create $EFI_FILE_SIGNED" | ||
| sbsign --key ${PRIVATE_KEY_PEM} --cert ${CERT_PEM} \ | ||
| --output ${EFI_FILE_SIGNED} ${EFI_FILE} || { | ||
| echo "EFI sign error" | ||
| exit 1 | ||
| } |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.