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

Add fixboard to firmware reflash #29

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

SamD2021
Copy link
Contributor

@SamD2021 SamD2021 commented Dec 4, 2024

We need unique MAC addresses for each IPU, and to make that happen, we use pre-built fixboard images that need to be flashed after the firmware is applied. To support this, I added these pre-built images to our ARM server and wrote functions to interact with them, making it easier to add unique MAC addresses. I also created functions to check if the fixboard process needs to be applied and handle the flashing if it does.

On top of that, I added a new ssh_run function to simplify running commands on remote hosts, since that’s a pretty common task and it made sense to make it easier and more consistent.

@@ -127,6 +139,15 @@ def reflash_ipu(self) -> None:
else:
self.logger.info("Skipping flash_spi_image")

self.logger.info("Step 5: apply_fixboard")
if self.should_run("apply_fixboard"):
should_fixboard = self.fixboard_is_needed()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why make fixboard_is_needed() return an optional bool?

In my mind this could be simplified a bit.

if self.fixboard_is_needed():
    self.apply_fixboard()
else:
     # assume fixboard has already been applied, or the user does not want to apply this (though I'm not sure if the user has a knob to tell fwup to only run a subset of the steps anyways right now).

If we hit an exception when trying to determine if we should apply fixboard, something is wrong and we should bail out with an error code.


def fixboard_is_needed(self) -> Optional[bool]:
full_address = f"root@{self.imc_address}"
try:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we expect this to fail?

This will be useful for traversing through the server for fixboard
pre-built board config binaries
We often want to avoid host checking and such so it would be nice to
have a function that abstract all those flags and runs the command on
the remote host
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

Successfully merging this pull request may close these issues.

2 participants