Fix OVMF 4m variant detection and Gentoo dep atom parsing

1. host.ovmf: Arch edk2-ovmf 202508+ uses OVMF_CODE.4m.fd (4MB variant)
   instead of OVMF_CODE.fd. Added .4m.fd paths to the search list and
   updated the find fallback to match OVMF_CODE*.fd glob.

2. test_parse_dep_atoms: The single-regex approach with lazy quantifiers
   failed on atoms like "sys-libs/zlib" at end-of-string. Rewrote
   parse_dep_atoms to split on whitespace first, strip [:slot] and [USE]
   suffixes, then match category/name with a simple anchored regex.
   This is more robust and easier to reason about.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-19 16:40:52 +01:00
parent 658289dc51
commit 4d8e27cd50
2 changed files with 50 additions and 18 deletions

View File

@@ -133,11 +133,14 @@ else
record "host.nested_virt" "skip" "No VMX/SVM — QEMU boot tests will be slower"
fi
# Check OVMF — Arch uses split CODE/VARS files, others use a single OVMF.fd
# Check OVMF — search all known paths including 4m variant (newer Arch)
OVMF=""
for p in \
/usr/share/edk2/x64/OVMF_CODE.4m.fd \
/usr/share/edk2/x64/OVMF_CODE.fd \
/usr/share/edk2-ovmf/x64/OVMF_CODE.4m.fd \
/usr/share/edk2-ovmf/x64/OVMF_CODE.fd \
/usr/share/OVMF/OVMF_CODE.4m.fd \
/usr/share/OVMF/OVMF_CODE.fd \
/usr/share/edk2/x64/OVMF.fd \
/usr/share/edk2-ovmf/x64/OVMF.fd \
@@ -148,7 +151,7 @@ for p in \
done
# Last resort: find it
if [ -z "$OVMF" ]; then
OVMF=$(find /usr/share -name "OVMF_CODE.fd" -o -name "OVMF.fd" 2>/dev/null | head -1)
OVMF=$(find /usr/share -name "OVMF_CODE*.fd" -o -name "OVMF.fd" 2>/dev/null | head -1)
fi
[ -n "$OVMF" ] && record "host.ovmf" "pass" "$OVMF" || record "host.ovmf" "fail" "Not found — install edk2-ovmf"