Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Design of replacing flash.sh script with Python script reusing OSFV lib #82

Open
macpijan opened this issue Nov 5, 2024 · 4 comments
Open
Assignees

Comments

@macpijan
Copy link
Member

macpijan commented Nov 5, 2024

We do already have some Python module: https://github.com/Dasharo/osfv-scripts/blob/main/osfv_cli/src/osfv/libs/rte.py
which already implements what we need in this script: https://github.com/3mdeb/RteCtrl/pull/22/files

We should review both of them, and propose if/how we can achieve code reuse, by implementing local flash.py script on RTE, using the same module, simply using localhost address as rte_ip.

This script may reside in osfv-scripts repo.

@macpijan
Copy link
Member Author

macpijan commented Nov 5, 2024

Maybe there is no need for another script, and we could somehow use osfv_cli directly on the localhost.

I think resolving this Dasharo/osfv-scripts#57 and possible also adding one or two more features, could help to achieve this.

We need to first take a look at possible solutions and decide on something.

@DaniilKl
Copy link
Contributor

DaniilKl commented Nov 25, 2024

It could be done by installing osfv_cli on RTE and using localhost as RTE IP. But osfv_cli as well as RteCtrl will need to be extended for WP features and for using custom flashrom parameters in the way flash.sh does. Currently it is not implemented. We can also consider using SSH or REST API to do the work, though IMO REST API is more suitable to use with localhost, but in that case, osfv_cli will need to be modified to use flashrom via REST API, because currently it is using SSH.

And, most importantly, the issue Dasharo/osfv-scripts#57, must be solved, otherwise this issue could not be solved.

Plan:

    • Make osfv_cli use flashrom via HTTP instead of SSH for localhost (optional).
    • Add providing additional parameters to flashrom
    • Add WP options according to flash.sh script

@artur-rs artur-rs assigned WiktorG351 and unassigned artur-rs Nov 27, 2024
@macpijan
Copy link
Member Author

macpijan commented Dec 2, 2024

Make osfv_cli use flashrom via HTTP instead of SSH for localhost (optional).

Could be done, but what would be the main benefit? I would also avoid switching to HTTP just for localhost. It would need to be done in general. BTW, we already have some of it implemented: https://github.com/3mdeb/RteCtrl/tree/master/pkg/flashromControl

Add providing additional parameters to flashrom

Correct, at minimum some additional flag to flash commmand would do.

Add WP options according to flash.sh script

This can in fact be added, but no currently active platforms needs it AFAIK. We do not use this option of this script. Low priority.

@artur-rs artur-rs added this to the meta-rte release v0.8.0 milestone Dec 3, 2024
@DaniilKl
Copy link
Contributor

Could be done, but what would be the main benefit?

I do not see any disadvantages of the SSH solution, therefore marked it as optional. We could skip it if you think it is unnecessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants