Add kernel args to Depthcharge boot method
This feature request was initially about a particular use-case when running Chrome OS for KernelCI. It can also be useful when running any type of job using the eMMC on Chromebooks.
Booting Chrome OS in a KernelCI job is done 2 stages: first to install the kernel modules on the eMMC using Debian with NFS root and potentially flash a full Chrome OS image, then to boot Chrome OS from the eMMC with the kernel image provided over TFTP. The eMMC root device varies depending on the Chromebook type and the image installed, so the
root=/dev/mmcblk... kernel argument needs to be defined in the LAVA job. However, the first stage needs to boot with
root=nfs so we can't just add the eMMC root device argument in the global job context as it would break the NFS boot. This is a weakness of the global
context in LAVA jobs as it doesn't have a namespace so it can't be tied to a particular boot action.
One way to solve this is by adding some parameter e.g.
extra_kernel_args to the Depthcharge boot method. The YAML job definitions would then look like this:
actions: - boot: namespace: flash timeout: minutes: 15 method: depthcharge commands: nfs prompts: - '/ #' - boot: namespace: chromeos timeout: minutes: 30 method: depthcharge commands: emmc extra_kernel_args: cros_debug cros_secure root=/dev/mmcblk0p3 prompts: - '/ #'
This would then be appended to the kernel command line. Other bootloaders such as U-Boot can have a template for the kernel command line and replace the root partition argument themselves, but Depthcharge doesn't support this so it has to be done by LAVA.