sonic-buildimage/files
Samuel Angebault 163ed6acff
[Arista] Better handle arbitrary tmpfs in boot0 (#6274)
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 case was not handled properly by the boot0 script.
It now detect if the image is on a tmpfs or a ramfs and keep it there if that is the case.

The cleanup method has been updated accordingly and will only cleanup
the mount path if it's below /tmp/ as to not affect user mounted paths.

- 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:

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 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.
2020-12-23 22:38:59 -08:00
..
Aboot [Arista] Better handle arbitrary tmpfs in boot0 (#6274) 2020-12-23 22:38:59 -08:00
apt [build]: add buster docker as the last step of the build proces 2020-04-16 10:26:18 +00:00
build_scripts [Python] Align files in root dir, dockers/ and files/ with PEP8 standards (#6109) 2020-12-03 15:57:50 -08:00
build_templates [CRM] Add support for snat, dnat and ipmc crm resources (#6012) 2020-12-23 06:15:53 -08:00
dhcp ZTP infrastructure changes to support DHCP discovery provisioning data (#3298) 2019-12-10 08:16:56 -08:00
docker Enabling ipv6 support on docker container network. This is needed (#5418) 2020-09-22 08:32:17 -07:00
image_config [ntp]: Source interface support for NTP (#6033) 2020-12-21 05:34:13 -08:00
initramfs-tools [NVMe] Add NVMe SSD disc type support to installer.sh script (#6142) 2020-12-09 19:03:27 -08:00
scripts In modular chassis, add CHASSIS_STATE_DB on control card (#5624) 2020-12-15 17:15:00 -08:00
sshd [sshd]: Create /run/sshd under systemd using RuntimeDirectory 2020-04-17 04:51:51 +00:00