[Arista] Better handle arbitrary tmpfs in boot0 #6268
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
- 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 aramfs
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 atmpfs
themove_swi_to_tmpfs
becomes a no-op.Made sure the cleanup logic would not behave unexpectedly.
- How to verify it
In SONiC:
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.Create a new mountpoint under
/ram
using eitherramfs
ortmpfs
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