Skip to content

Commit

Permalink
testing/run.sh: enable building with alternate EFI stubs
Browse files Browse the repository at this point in the history
  • Loading branch information
zdykstra committed Oct 19, 2023
1 parent 831d55a commit 88ed75a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
*/*.swp
.vscode/
releases/*
testing/stubs/local.*
build
hostid
zpool.cache
10 changes: 7 additions & 3 deletions testing/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -164,6 +166,9 @@ while getopts "${CMDOPTS}" opt; do
;;
esac
;;
S)
EFISTUB="$( realpath -e "${OPTARG}" )"
;;
M)
MEMORY="${OPTARG}"
;;
Expand Down Expand Up @@ -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}"
Expand Down

0 comments on commit 88ed75a

Please sign in to comment.