From 4db1d565effc7a0e934fe8c7457141675d0f2def Mon Sep 17 00:00:00 2001 From: Ihor Solodrai Date: Fri, 1 Nov 2024 14:03:22 -0700 Subject: [PATCH] run-vmtest@v2: remove unused img input, make vmlinuz optional Previously the first run-vmtest action step would always search for vmlinux image in KERNEL_ROOT, and then copy it to path specified by inputs.vmlinuz However, the caller may want to pass vmlinux image directly. Change this behavior: search only inputs.vmlinuz was not passed. Signed-off-by: Ihor Solodrai --- run-vmtest/action.yml | 20 +++++--------------- run-vmtest/run.sh | 5 +++++ 2 files changed, 10 insertions(+), 15 deletions(-) diff --git a/run-vmtest/action.yml b/run-vmtest/action.yml index d998990..8f92109 100644 --- a/run-vmtest/action.yml +++ b/run-vmtest/action.yml @@ -4,12 +4,11 @@ inputs: arch: description: 'arch' required: true - img: - description: 'img path' - required: true vmlinuz: - description: 'vmlinuz path' - required: true + description: | + If passed, this vmlinuz will be used. Otherwise vmlinuz will be + searched via make -s image_name in kbuild-output. + required: false kernel-root: description: 'kernel source dir' default: '.' @@ -27,19 +26,11 @@ inputs: kbuild-output: description: 'Path to KBUILD_OUTPUT' required: false - type: string default: 'kbuild-output' runs: using: "composite" steps: - - name: Find kernel - id: find-kernel - shell: bash - run: | - BUILDDIR=$(realpath ${{ inputs.kbuild-output }}) - vmlinuz="$BUILDDIR/$(KBUILD_OUTPUT="${BUILDDIR}" make -C "${{ inputs.kernel-root }}" -s image_name)" - cp "$vmlinuz" ${{ inputs.vmlinuz }} - name: Download vmtest shell: bash # FIXME: move to proper release @@ -71,8 +62,7 @@ runs: - name: Run vmtest shell: bash env: - VMLINUZ: ${{ inputs.vmlinuz }} - IMG: ${{ inputs.img }} + VMLINUZ: ${{ inputs.vmlinuz || '' }} KERNEL_ROOT: ${{ inputs.kernel-root }} MAX_CPU: ${{ inputs.max-cpu }} KERNEL_TEST: ${{ inputs.kernel-test }} diff --git a/run-vmtest/run.sh b/run-vmtest/run.sh index b1cc175..0d34704 100755 --- a/run-vmtest/run.sh +++ b/run-vmtest/run.sh @@ -4,6 +4,11 @@ set -euo pipefail trap 'exit 2' ERR source $(cd $(dirname $0) && pwd)/../helpers.sh +if [[ -z "${VMLINUZ}" || ! -f "${VMLINUZ}" ]]; then + image_name=$(make -C ${KERNEL_ROOT} -s image_name) + export VMLINUZ=$(realpath ${KERNEL_ROOT}/${image_name}) +fi + foldable start bpftool_checks "Running bpftool checks..." bpftool_exitstatus=0