The issue is, when the user wants to change credentials, and the
credentials they use are not valid, the credentials will reset.
Keep a backup of credentials file so it can be restored if new
credentials are invalid.
Signed-off-by: Mateusz Kusiak <mateusz.kusiak@3mdeb.com>
Check for validating if user email is set for alias was overly
optimistic. Short logins like "a" would false-positively trigger `grep`.
Fix the if statement to instead check if alias exists at all.
Fixes: https://github.com/Dasharo/dasharo-issues/issues/1578
Signed-off-by: Mateusz Kusiak <mateusz.kusiak@3mdeb.com>
The wrapper for catching sig_result simply does not work. It captures
nothing and just prints redundant empty line. Drop catching this at it
is not used at all.
Signed-off-by: Mateusz Kusiak <mateusz.kusiak@3mdeb.com>
Print error and exit if queueing capsule update fails. Mention that most
common case is enabled ME and print link to known issues describing it
in more details along with solution.
Modify cap_upd_tool mocking so we can test failures.
Signed-off-by: Michał Iwanicki <michal.iwanicki@3mdeb.com>
source and destination
will be usefull for unit testing of some conditions in romhole_migration
func.
Signed-off-by: Daniil Klimuk <daniil.klimuk@3mdeb.com>
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
Disable the option to restore FW from HCL report as it is currently not
tested and has potential to brick devices.
Signed-off-by: Mateusz Kusiak <mateusz.kusiak@3mdeb.com>
Ensure the commas are printed in the error message that prints locked
regions in flashrom_region_check().
Signed-off-by: Mateusz Kusiak <mateusz.kusiak@3mdeb.com>
Rework and refine flashrom_region_check() function. Split logic into
three blocks: gather info, generic update, heads update. The major
functional change is generic update is no longer possible if region is
specified but locked.
Signed-off-by: Mateusz Kusiak <mateusz.kusiak@3mdeb.com>
This commit adds a check that enforces flashing FD, ME and BIOS regions
for heads update. The reason has been added inline with the changes.
This commit will break compatibility with some existing platforms and
that is intended.
Signed-off-by: Mateusz Kusiak <mateusz.kusiak@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>