From 88ed75a4194af5cf6dca81e522be7f5f4df0ef5f Mon Sep 17 00:00:00 2001 From: Zach Dykstra Date: Thu, 19 Oct 2023 16:01:54 -0500 Subject: [PATCH] testing/run.sh: enable building with alternate EFI stubs --- .gitignore | 1 + testing/run.sh | 10 +++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 419e714aa..4cfc0f4e0 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ */*.swp .vscode/ releases/* +testing/stubs/local.* build hostid zpool.cache diff --git a/testing/run.sh b/testing/run.sh index cfae04abe..1c14872a5 100755 --- a/testing/run.sh +++ b/testing/run.sh @@ -35,10 +35,11 @@ Usage: $0 [options] -M Set the amount of memory for the virtual machine -C Set the number of CPUs for the virtual machine -B Use Busybox for mkinitcpio miser mode + -S Use alternate EFI stub file at specified path EOF } -CMDOPTS="D:A:a:d:fsv:hineM:C:FEGcrB" +CMDOPTS="D:A:a:d:fsv:hineS:M:C:FEGcrB" # First-pass option parsing just looks for test directory while getopts "${CMDOPTS}" opt; do @@ -107,6 +108,7 @@ EFI=0 SERDEV_COUNT=0 GENZBM_FLAGS=() MISER=0 +EFISTUB="$( realpath -e stubs/linuxx64.efi.stub )" # Defer a choice on initramfs generator until options are parsed DRACUT=0 @@ -164,6 +166,9 @@ while getopts "${CMDOPTS}" opt; do ;; esac ;; + S) + EFISTUB="$( realpath -e "${OPTARG}" )" + ;; M) MEMORY="${OPTARG}" ;; @@ -381,14 +386,13 @@ fi if ((CREATE)) ; then yamlconf="${TESTDIR}/local.yaml" - STUBS="$(realpath -e stubs)" if ((EFI)) ; then # toggle only EFI bundle creation [ -f "${BUNDLE}" ] && rm "${BUNDLE}" yq-go eval ".EFI.Enabled = true" -i "${yamlconf}" yq-go eval ".Components.Enabled = false" -i "${yamlconf}" - yq-go eval ".EFI.Stub = \"${STUBS}/linuxx64.efi.stub\"" -i "${yamlconf}" + yq-go eval ".EFI.Stub = \"${EFISTUB}\"" -i "${yamlconf}" else # toggle only component creation [ -f "${KERNEL}" ] && rm "${KERNEL}"