From 38bc97dd4dbdb41dde84e0807d1808deb2d4c879 Mon Sep 17 00:00:00 2001 From: Muminul Islam Date: Thu, 23 Apr 2026 14:11:03 -0700 Subject: [PATCH] scripts: copy custom workloads before container launch When CH_CUSTOM_KERNEL, CH_CUSTOM_FIRMWARE, or CH_CUSTOM_OVMF environment variables are set, copy the referenced files into the host workloads directory before starting Docker. The files land at the default paths the test scripts expect (vmlinux-x86_64, Image-arm64, hypervisor-fw, CLOUDHV.fd, CLOUDHV_EFI.fd), so the existing download-if-missing guards inside the container skip the network fetch. Each variable is independent; users can override any combination without affecting the others. Assisted-by: GitHub Copilot:Claude-Opus-4.6 Signed-off-by: Muminul Islam --- scripts/dev_cli.sh | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/scripts/dev_cli.sh b/scripts/dev_cli.sh index d06a8ac60..5396e4b12 100755 --- a/scripts/dev_cli.sh +++ b/scripts/dev_cli.sh @@ -500,6 +500,37 @@ cmd_tests() { ./scripts/run_unit_tests.sh "$@" || fix_dir_perms $? || exit $? fi + # Copy custom kernel/firmware into the workloads directory on the + # host so they are visible inside the container at the default + # paths. Each variable is independent; only set vars are copied. + if [ -n "$CH_CUSTOM_KERNEL" ]; then + say "Copying custom kernel from $CH_CUSTOM_KERNEL" + if [ "$(uname -m)" = "aarch64" ]; then + cp "$CH_CUSTOM_KERNEL" "$CLH_INTEGRATION_WORKLOADS/Image-arm64" + else + cp "$CH_CUSTOM_KERNEL" "$CLH_INTEGRATION_WORKLOADS/vmlinux-x86_64" + fi + fi + if [ -n "$CH_CUSTOM_BZIMAGE" ]; then + say "Copying custom bzImage from $CH_CUSTOM_BZIMAGE" + if [ "$(uname -m)" = "x86_64" ]; then + cp "$CH_CUSTOM_BZIMAGE" "$CLH_INTEGRATION_WORKLOADS/bzImage-x86_64" + fi + fi + + if [ -n "$CH_CUSTOM_FIRMWARE" ]; then + say "Copying custom firmware from $CH_CUSTOM_FIRMWARE" + cp "$CH_CUSTOM_FIRMWARE" "$CLH_INTEGRATION_WORKLOADS/hypervisor-fw" + fi + if [ -n "$CH_CUSTOM_OVMF" ]; then + say "Copying custom OVMF from $CH_CUSTOM_OVMF" + if [ "$(uname -m)" = "aarch64" ]; then + cp "$CH_CUSTOM_OVMF" "$CLH_INTEGRATION_WORKLOADS/CLOUDHV_EFI.fd" + else + cp "$CH_CUSTOM_OVMF" "$CLH_INTEGRATION_WORKLOADS/CLOUDHV.fd" + fi + fi + # Extend common_args with integration-specific runtime settings. common_args+=( --privileged @@ -514,6 +545,10 @@ cmd_tests() { common_env_args+=( --env USER="root" --env AUTH_DOWNLOAD_TOKEN="$AUTH_DOWNLOAD_TOKEN" + --env CH_CUSTOM_KERNEL="$CH_CUSTOM_KERNEL" + --env CH_CUSTOM_BZIMAGE="$CH_CUSTOM_BZIMAGE" + --env CH_CUSTOM_FIRMWARE="$CH_CUSTOM_FIRMWARE" + --env CH_CUSTOM_OVMF="$CH_CUSTOM_OVMF" ) if [ "$integration" = true ]; then