Primary media and primary bootloaders¶
Methods like deploy to TFTP rely on LAVA interrupting the primary bootloader on the DUT and changing the boot process to use the files provided by the test writer. Many test devices require this bootloader to be installed onto re-writeable media which can be modified from the running system, for example an SD card.
The critical element for LAVA is the first point where the boot can be interrupted or modified. Devices which lack some kind of BMC rely on this bootloader to be able to automatically recover from a broken deployment. This bootloader can be considered as the primary bootloader and the medium where this is installed can be considered as the primary medium which must be protected from deployments which would replace its entire contents. For example, a panda board has an SD card and USB host support, the primary bootloader (U-Boot) must be on the SD card, so V2 uses the SD card as primary media. It is therefore not supportable for a panda board to deploy to the SD card in LAVA.
Note
Primary and secondary media relate to devices where the primary bootloader is installed on writeable media and where that bootloader needs to operate before new software can be deployed. Fastboot devices often differ and allow all media on the device to be modified in test jobs as long as jumpers or dip switches are set to force the device to boot into fastboot mode. Modifying the fastboot support on the device may involve changing those jumpers and/or dip switches, i.e. an admin task whilst the device is offline.
It is important to consider the constraints of primary media as a limitation of the hardware for automation. The risks of allowing test writers to easily brick devices outweigh the usefulness of the primary media for files other than the primary bootloader. LAVA has tried to use partitions on the primary media in the past and this has proven to be unreliable.
Devices which only provide primary media can still support deployment methods like TFTP to use ramdisk and NFS test jobs.
Important
Many devices allow test writers to access the primary media from within a test shell even if the test job has deployed into a ramdisk, NFS or secondary media. It remains the responsibility of the test writer to not modify the primary media from within a test shell just because you can. Test writers who do so may have submission privileges revoked by the admins.