set_gbb_flags: Check write protection status before starting to flash.

People trying to override GBB flags and not having write protection disabled may
corrupt whole RW section of firmware.

To avoid that, we should check write protection before starting to invoke
flashrom commands.

TEST=./ 0x39 # Aborted on a write-protected system, as expected.

Change-Id: I6b2dcc75b87dc5ceace0d7caec62ded787b2b534
Signed-off-by: Hung-Te Lin <>
Reviewed-by: Randall Spangler <>
Commit-Queue: Hung-Te Lin <>
1 file changed