tests: Build Mariner rootfs initrd

* Adds a new `rootfs-initrd-mariner` build target.
 * Sets the custom initrd path via annotation in `setup.sh` at test
   time.
 * Adapts versions.yaml to specify a `cbl-mariner` initrd variant.
 * Introduces env variable `HOST_OS` at deploy time to enable using a
   custom initrd.
 * Refactors the image builder so that its caller specifies the desired
   guest OS.

Signed-off-by: Aurélien Bombo <abombo@microsoft.com>
This commit is contained in:
Aurélien Bombo
2023-04-17 16:59:22 -07:00
parent b535c7cbd8
commit 532755ce31
6 changed files with 113 additions and 54 deletions

View File

@@ -64,6 +64,11 @@ function install_artifacts() {
chmod +x /opt/kata/bin/*
[ -d /opt/kata/runtime-rs/bin ] && \
chmod +x /opt/kata/runtime-rs/bin/*
# Allow Mariner to specify a Mariner guest initrd.
if [ "${HOST_OS:-}" == "cbl-mariner" ]; then
sed -i -E 's|(enable_annotations) = .+|\1 = ["enable_iommu", "initrd"]|' /opt/kata/share/defaults/kata-containers/configuration-clh.toml
fi
}
function wait_till_node_is_ready() {