Add a last resort check for validating flashrom jobs. For regular updates, check if the regions to update are not locked. For heads update, always check if FD, ME, and BIOS regions are flashed and if FE and ME are unlocked.
Fixes: https://github.com/Dasharo/dasharo-issues/issues/1536
This is to allow using some functions in source `$DTS_FUNCTIONS`
without entering dts-boot first e.g. board_config.
Signed-off-by: Michał Iwanicki <michal.iwanicki@3mdeb.com>
That way there won't be duplication which we might forgot to update.
Before this change, sourcing "$DTS_ENV" in shell connected to via ssh
wasn't possible as "$DTS_HAL" was empty, which resulted in ssh session
ending.
Signed-off-by: Michał Iwanicki <michal.iwanicki@3mdeb.com>
Use arrays instead of namerefs in helper functions related to
dasharo-deploy. The reason is this is easier to read.
Signed-off-by: Mateusz Kusiak <mateusz.kusiak@3mdeb.com>
Split region verification flow into multiple, smaller helper functions
and make them more generic to be reusable.
Signed-off-by: Mateusz Kusiak <mateusz.kusiak@3mdeb.com>
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>
Add wrapper function for transition and recovery workflows that detects
if fd is being flashed, and if so, runs dedicated flashrom job for FD
flashing.
Signed-off-by: Mateusz Kusiak <mateusz.kusiak@3mdeb.com>
For the scheduling to work reliably, the parameters must be stored as
arrays, not as strings. Use dynamic arrays for adding flashrom
parameters. Additionally improve fd flashing detection mechanism.
Signed-off-by: Mateusz Kusiak <mateusz.kusiak@3mdeb.com>
Use progress bar for flashrom jobs instead of printing messages. Add
scheduling info for remaining fobs.
Signed-off-by: Mateusz Kusiak <mateusz.kusiak@3mdeb.com>
If FD is to be flashed, flash the FD before flashing anything else. The
reason is regions are FD dependent.
Signed-off-by: Mateusz Kusiak <mateusz.kusiak@3mdeb.com>
Instead of executing flashrom in place, schedule them and execute one
after another. This is basically a workaround for fragmented flashrom
parameter logic. This way we know all flashrom jobs before executing
them.
Signed-off-by: Mateusz Kusiak <mateusz.kusiak@3mdeb.com>
Trying to use flashrom with both `--fmap` and `--ifd` results in:
```
Error: --fmap and --ifd both specified. Aborting
```
Signed-off-by: Michał Iwanicki <michal.iwanicki@3mdeb.com>