-
Notifications
You must be signed in to change notification settings - Fork 3
dasharo-deploy: Add sanity check before flash #139
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
base: fd_first
Are you sure you want to change the base?
Conversation
This commit adds last resort check before performing any flashrom commands. For heads update, we shall not proceed if FD or ME is locked. Signed-off-by: Mateusz Kusiak <mateusz.kusiak@3mdeb.com>
Example run (qemu)
Heads transiton, FD and ME disabled scenario. |
| local locked_regions=() | ||
| local region_list verb | ||
|
|
||
| if [ "$BOARD_FD_REGION_RW" -eq 0 ]; then |
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.
| if [ "$BOARD_FD_REGION_RW" -eq 0 ]; then | |
| if [[ "$BOARD_HAS_FD_REGION" -eq 1 && "$BOARD_FD_REGION_RW" -eq 0 ]]; then |
| locked_regions+=("FD") | ||
| fi | ||
|
|
||
| if [ "$BOARD_ME_REGION_RW" -eq 0 ]; then |
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.
| if [ "$BOARD_ME_REGION_RW" -eq 0 ]; then | |
| if [[ "$BOARD_HAS_ME_REGION" -eq 1 && "$BOARD_ME_REGION_RW" -eq 0 ]]; then |
| done | ||
|
|
||
| # Last restort check before flashing | ||
| if ! flashrom_sanity_check; then |
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.
I feel like it should check what really is flashed by parsing _jobs.
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.
You can ignore this comment if you think it's OK.
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.
I'm not sure about correctness of this implementation, will need to check cases where we only flash e.g. COREBOOT like every PC Engines. There is also Optiplex:
optiplex-7010 UEFI Update - DPP.profile:35:flashrom -p internal -N --fmap -i COREBOOT -w /tmp/biosupdateNot sure if we should warn in this case if we are not even flashing FD (because it's identical). If we are currently printing warning then it's ok.
| fi | ||
|
|
||
| if [[ "$SWITCHING_TO" == "heads" ]]; then | ||
| print_error "Cannot proceed with heads update when $region_list $verb locked!" |
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.
Add link to docs with information what should be done (if it doesn't exists then add it). Maybe: https://docs.dasharo.com/guides/firmware-update/#known-issues.
For MSI (locked FD): The following warnings appear when updating Dasharo: should be good enough.
For ME you could add generic: Make sure ME is set to HAP disabled. If this doesn't work then try with ME Soft Disabled.
Add last resort check before running flashrom.
For now target is
fd_firstbranch, will change this once it gets merged.