271 Commits

Author SHA1 Message Date
Michał Iwanicki
4b0cc017ef include: Add check for FirmwareUpdateModeRT
Signed-off-by: Michał Iwanicki <michal.iwanicki@3mdeb.com>
2026-02-11 17:50:50 +01:00
Michał Iwanicki
ef6ba4ccfa dasharo-deploy: add capsule & fum checks
Workaround for https://github.com/Dasharo/dasharo-issues/issues/1759

Signed-off-by: Michał Iwanicki <michal.iwanicki@3mdeb.com>
2026-02-09 14:43:10 +01:00
Mateusz Kusiak
7c7884437b login_to_dpp_server: Add password check
Add a check in login_to_dpp_server() to catch corner case scenarios when
password changes.

Signed-off-by: Mateusz Kusiak <mateusz.kusiak@3mdeb.com>
2026-02-09 10:18:40 +01:00
Mateusz Kusiak
3779240997 Credentials: Create a backup file
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>
2026-02-09 10:08:01 +01:00
Mateusz Kusiak
b643f402e7 get_dpp_creds: remove empty lines for creds
Credentials are wrapped in empty lines top and bottom. Remove them.

Signed-off-by: Mateusz Kusiak <mateusz.kusiak@3mdeb.com>
2026-02-09 10:08:01 +01:00
Mateusz Kusiak
1d5d6d174c login_to_dpp_server: fix check if logged in
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>
2026-02-09 10:07:57 +01:00
Mateusz Kusiak
9187e47a7f get_dpp_creds: clean creds file on new creds
If new credentials were specified, and they're not empty, overwrite the
last credentials file.
Fixes: https://github.com/Dasharo/dasharo-issues/issues/1463

Signed-off-by: Mateusz Kusiak <mateusz.kusiak@3mdeb.com>
2026-02-09 09:57:27 +01:00
Mateusz Kusiak
075743e3a3 get_dpp_creds: Do not allow empty creds
Do not allow empty credentials nor spaces in the middle.
Fixes:
* https://github.com/Dasharo/dasharo-issues/issues/1326
* https://github.com/Dasharo/dasharo-issues/issues/1589

Signed-off-by: Mateusz Kusiak <mateusz.kusiak@3mdeb.com>
2026-02-09 09:57:13 +01:00
Mateusz Kusiak
b952a103d2 verify_artifacts: drop sig_result
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>
2026-02-05 11:10:02 +01:00
Michał Iwanicki
5117404a1d dasharo-deploy & mock: check return value of cap_upd_tool & add mock
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>
2026-01-29 11:44:57 +01:00
Daniil Klimuk
fd25c91d18 include: hal: common-mock-func: add TEST_READ_ROMHOLE_FAIL
Signed-off-by: Daniil Klimuk <daniil.klimuk@3mdeb.com>
2026-01-21 14:33:40 +01:00
Daniil Klimuk
55600508f0 include: hal: common-mock-func: enable controlling of ROMHOLE migration
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>
2026-01-21 13:57:40 +01:00
Daniil Klimuk
f4cdb258ad add TEST_ROMHOLE_CBFS_MIGRATION
Signed-off-by: Daniil Klimuk <daniil.klimuk@3mdeb.com>
2026-01-20 19:45:49 +01:00
Mateusz Kusiak
3b88b776b9 Merge pull request #139 from Dasharo/heads_trans
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
2026-01-16 14:20:04 +01:00
Mateusz Kusiak
44bcb2c834 Menu: disable HCL FW restore
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>
2026-01-15 17:01:39 +01:00
Mateusz Kusiak
d1e640f610 Dasharo-deploy: add missing commas
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>
2026-01-15 16:37:44 +01:00
Mateusz Kusiak
17c368ac11 Dasharo-deploy: refine flashrom_check_for_region
Refine and simplify flashrom_check_for_region() function.

Signed-off-by: Mateusz Kusiak <mateusz.kusiak@3mdeb.com>
2026-01-15 16:25:06 +01:00
Mateusz Kusiak
7a5842b544 Dasharo-deploy: rework flashrom_region_check()
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>
2026-01-15 12:09:54 +01:00
Mateusz Kusiak
b1f4be7879 Dasharo-deploy: heads: force fd, me and bios
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>
2026-01-15 10:29:58 +01:00
Michał Iwanicki
26828e4183 common-mock: mock btg_key_validator so we can test failure states
Signed-off-by: Michał Iwanicki <michal.iwanicki@3mdeb.com>
2026-01-14 12:23:08 +01:00
Michał Iwanicki
ce5fe88d0e common-mock-func: fix cap_upd_tool name
Signed-off-by: Michał Iwanicki <michal.iwanicki@3mdeb.com>
2026-01-14 12:23:08 +01:00
Michał Iwanicki
feeedb5065 common-mock-func: add cap_upd_tool_mock, it shouldn't print anything
Signed-off-by: Michał Iwanicki <michal.iwanicki@3mdeb.com>
2026-01-14 12:23:08 +01:00
Mateusz Kusiak
43c159bcb0 Dasharo-deploy: Pass arrays instead of namerefs
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>
2026-01-07 12:40:58 +01:00
Mateusz Kusiak
e2bf4cc948 Dasharo-deploy: Make functions generic
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>
2026-01-07 12:40:28 +01:00
Mateusz Kusiak
2472a3b8b5 dasharo-deploy: Add sanity check before flash
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>
2025-12-19 15:01:01 +01:00