On 25 October 2017 at 22:05, Rees, Kevron <kevron.m.rees@intel.com> wrote:
I have a minnowboard turbot device that I want lava to boot, flash,
reboot to flashed image, and then run tests.

First, make sure you have read: https://staging.validation.linaro.org/static/docs/v2/device-integration.html

What you are asking for essentially boils down to:

boot method pxe
commands: ramdisk
test shell to run wget & dd or secondary media deployment to flash the image
boot method pxe
commands: sata
test shell on persistent storage.
  
Alternatively, use grub boot method in each case - depends on which set of commands you want to configure.

The x86 device-type in staging uses PXE. The mustang-uefi device-type in staging uses grub-efi, downloading a grub binary using PXE which is configured in UEFI.
 
https://staging.validation.linaro.org/scheduler/job/195134 - x86

https://staging.validation.linaro.org/scheduler/job/195134 - mustang


  I would like to boot the
device via PXE networking to an initramfs where I will flash an image
to permanent storage. 

That could be done using a test shell running in the initramfs. Just make sure the kernel has the relevant configuration to write to the required storage device.
 
I can use efibootmgr within the initramfs image
to set next-boot to the permanent storage device. 

No. Avoid changing things in bootloaders with which you are not interacting on every test job. That breaks persistence and will cause the device to be unreliable.

Let the device continue to boot using PXE (which can then possibly download Grub) which can be interrupted and can boot from whatever media you choose.

Only change things like boot order if you have BMC which allows you to change it every time, even if the current order happens to be the right one.
 
Once booted from
the permanent storage device, lava tests will run as per normal.

It appears that many of the ipxe examples I have found simply run
tests on the initramfs itself.  Is it possible to flash the device
once the initramfs has booted?

Yes - but you have to do this on the device, not on the dispatcher.
 
  It seems like it would be simple for
lava-dispatcher to run wget http://someurl/foo.img | dd of=/dev/sda
once the initramfs has reached login.  However, I do not know if there
is such a deploy mechanism.

Secondary media can support this, as long as the device is booted into a system which can write to the storage.

Alternatively, you can use a test shell to do the write and then specify different commands to the next boot action to boot from that storage. (What Secondary Media gives you is some independence from the enumeration problems of which storage device when there are a number of devices of the same device-type.)
 

Does anything already exist within lava to help achieve this model?
Is there a better way?  Any feedback would be appreciated.

-Kevron
_______________________________________________
Lava-users mailing list
Lava-users@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lava-users



--