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

[Arista] Better handle arbitrary tmpfs in boot0 #6268

Merged
merged 1 commit into from
Dec 22, 2020

Conversation

Staphylo
Copy link
Collaborator

- Why I did it

To limit IO and space usage on the flash device the boot0 script makes sure the SWI is in memory.
Because SONiC maps /tmp on the flash, some logic is required to make sure of it.
However it is possible for some provisioning mechanism to already download the swi in a memory file system.
This was not properly handled by the boot0 script.
It now properly detect if the image is on a tmpfs or a ramfs and keep it there if that is the case.

- How I did it

Check the filesystem on which the SWI pointed by swipath lies.
If this filesystem is a ramfs or a tmpfs the move_swi_to_tmpfs becomes a no-op.
Made sure the cleanup logic would not behave unexpectedly.

- How to verify it

In SONiC:

  1. Download the swi under /tmp and makes sure it gets moved to /tmp/tmp-swi which gets mounted for that purpose.
    Make sure /tmp/tmp-swi gets unmounted once the install process is done.

  2. Create a new mountpoint under /ram using either ramfs or tmpfs and download the swi there.
    Install the swi using sonic-installer and makes sure the image doesn't get moved by looking at the logs.

- Which release branch to backport (provide reason below if selected)

None, master will receive an independent fix soon.

- Description for the changelog

Better handle arbitrary tmpfs mounts in boot0

@Staphylo
Copy link
Collaborator Author

retest vsimage please

@jleveque
Copy link
Contributor

Retest vsimage please

@lguohan lguohan merged commit e75c15b into sonic-net:201911 Dec 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants