Commit Graph

267 Commits

Author SHA1 Message Date
Daniil Klimuk
6d53e2cf05 integrate HAL
Signed-off-by: Daniil Klimuk <daniil.klimuk@3mdeb.com>
2024-11-18 16:17:36 +01:00
Daniil Klimuk
d7780f288b include: hal: add
Add HAL and mocking functions.

Signed-off-by: Daniil Klimuk <daniil.klimuk@3mdeb.com>
2024-11-18 16:17:35 +01:00
Daniil Klimuk
a99ba0254d scripts: dasharo-deploy: installation_workflow: fix downloading and
verifying

Signed-off-by: Daniil Klimuk <daniil.klimuk@3mdeb.com>
2024-11-14 10:39:39 +01:00
Daniil Klimuk
3910890fe4 scripts: dasharo-deploy: add some collors to output
Signed-off-by: Daniil Klimuk <daniil.klimuk@3mdeb.com>
2024-11-14 10:39:39 +01:00
Daniil Klimuk
b447b8c03e include: dts-functions: downloading artifacts: add capsules
Signed-off-by: Daniil Klimuk <daniil.klimuk@3mdeb.com>
2024-11-14 10:39:38 +01:00
Daniil Klimuk
61f68f01b0 remove -x flag from all files permissions
Signed-off-by: Daniil Klimuk <daniil.klimuk@3mdeb.com>
2024-11-14 10:39:38 +01:00
Daniil Klimuk
97aebd817f scripts: dasharo-deploy: pre-commit fixes
Signed-off-by: Daniil Klimuk <daniil.klimuk@3mdeb.com>
2024-11-14 10:39:38 +01:00
Daniil Klimuk
2aef6c34f4 Add more comments
Signed-off-by: Daniil Klimuk <daniil.klimuk@3mdeb.com>
2024-11-14 10:39:38 +01:00
Daniil Klimuk
ecbb7b1424 include: dts-functions: fix footer rendering
Before:

*********************************************************
R to reboot  P to poweroff  S to enter shell
K to launch SSH server  L to enable sending DTS logs V to enable verbose mode
Enter an option:

Now:

*********************************************************
R to reboot  P to poweroff  S to enter shell
K to launch SSH server  L to enable sending DTS logs
V to enable verbose mode
Enter an option:

Signed-off-by: Daniil Klimuk <daniil.klimuk@3mdeb.com>
2024-11-14 10:39:38 +01:00
Daniil Klimuk
ce92021c35 include: dts-functions.sh: fix QEMU config
Signed-off-by: Daniil Klimuk <daniil.klimuk@3mdeb.com>
2024-11-14 10:39:38 +01:00
Daniil Klimuk
05606c728d scripts: dasharo-deploy: delete backup option
This code is currently used inside dasharo-deploy only.

Signed-off-by: Daniil Klimuk <daniil.klimuk@3mdeb.com>
2024-11-14 10:39:38 +01:00
Daniil Klimuk
1e152dc6fd scripts: ec_transition: delete surplus definitions
These veriables are already defined in dts-environment.sh, and the
ec_transition sources it.

Signed-off-by: Daniil Klimuk <daniil.klimuk@3mdeb.com>
2024-11-14 10:39:38 +01:00
Daniil Klimuk
6b3eee91a3 scripts: dasharo-deploy: pre-commit fixes
Signed-off-by: Daniil Klimuk <daniil.klimuk@3mdeb.com>
2024-11-14 10:39:38 +01:00
Daniil Klimuk
fd45d4e408 scripts: dasharo-deploy: add UEFI Capsule Update workflows
Signed-off-by: Daniil Klimuk <daniil.klimuk@3mdeb.com>
2024-11-14 10:39:37 +01:00
Daniil Klimuk
bebd97bf18 scripts: dasharo-deploy: clean up installation and update funcs
The installation workflows must be as linear as possbile for better
readability and scalability.

Signed-off-by: Daniil Klimuk <daniil.klimuk@3mdeb.com>
2024-11-14 10:39:37 +01:00
Daniil Klimuk
c584d6ecf5 scripts: dasharo-deploy: add UEFI Capsule Update configuration
Signed-off-by: Daniil Klimuk <daniil.klimuk@3mdeb.com>
2024-11-14 10:39:37 +01:00
Daniil Klimuk
c93114f437 include: add UEFI Capusle Update configuration
Signed-off-by: Daniil Klimuk <daniil.klimuk@3mdeb.com>
2024-11-14 10:39:37 +01:00
Daniil Klimuk
4a80617bb2 scripts: dasharo-deploy: rework deploying config
Before deploing we do some configuration based on the list of the
firmware versions the target supports and on DPP subscription user
has.

Previously this configuration lived beside the code responsible for
deploying, as a result, the deploying workflows was messy, had nesting
levels over 3, and nonlinear and complex logic.

This commit tries to separate this configuration and deploying to make
it more readable and scallable.

Signed-off-by: Daniil Klimuk <daniil.klimuk@3mdeb.com>
2024-11-14 10:39:37 +01:00
Daniil Klimuk
ca790b3e6c scripts: dasharo-deploy: rework display_warning func
This function is useful not unly during update workflow, but every time
firmware is being deployed

Signed-off-by: Daniil Klimuk <daniil.klimuk@3mdeb.com>
2024-11-14 10:39:37 +01:00
Daniil Klimuk
e6d4617067 scripts: dasharo-deploy: add check_for_firmware_access func
Signed-off-by: Daniil Klimuk <daniil.klimuk@3mdeb.com>
2024-11-14 10:39:37 +01:00
Daniil Klimuk
89367a5c1f include: dts-functions: make func verify_artifacts more reusable
Signed-off-by: Daniil Klimuk <daniil.klimuk@3mdeb.com>
2024-11-14 10:39:37 +01:00
Daniil Klimuk
cee2d5b41f use test -n instead of test -v
"test -v" checks whether a variable has been declared, it does not check
its value. We sometimes use "unset" for some variables, and then check
again with "test -v". The problem is, "unset" erases variable value, but
the variable still exists, so the "test -v" will be true before, as well
as after the "unset".

We must use "test -n" (whether a variable holds non-zero length
string value) and "test -z" (whether a variable holds zero length string
value) to check string values of variables. This way the "unset" will
work.

Signed-off-by: Daniil Klimuk <daniil.klimuk@3mdeb.com>
2024-11-14 10:39:36 +01:00
Daniil Klimuk
9fee55d2c9 scripts: dasharo-deploy: dont use hash variables in conditions
Variables with links to hashes of the firmware binaries are always set,
use variables with links to firmware binaries instead.

Signed-off-by: Daniil Klimuk <daniil.klimuk@3mdeb.com>
2024-11-14 10:39:36 +01:00
Daniil Klimuk
3f02401b94 include: dts-functions: erase DTS menu after entering shell
Signed-off-by: Daniil Klimuk <daniil.klimuk@3mdeb.com>
2024-11-14 10:39:36 +01:00
Daniil Klimuk
423221471d include: dts-functions: clean up platforms configuration
Configurations of all supported platforms are done inside
board_config function as switch/case Bash statements. The list of
supported platforms has grown a lot since then, and the function became
unreadable, so adding and managing configurations became difficult and
error-prone.

This commit adds some default configuration values as well as tries to
reuse some configuration code.

Signed-off-by: Daniil Klimuk <daniil.klimuk@3mdeb.com>
2024-11-14 10:39:30 +01:00