From: Luca Boccassi Date: Sun, 7 Dec 2025 23:41:39 +0000 (+0000) Subject: mkosi-obs: prepare EFI authvars only if there is at least an ESP X-Git-Tag: v26~23^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cdc1474b96dcc6b6c79a95683ecddf71c97be55d;p=thirdparty%2Fmkosi.git mkosi-obs: prepare EFI authvars only if there is at least an ESP No point otherwise, a DDI might be a portable image with no ESP --- diff --git a/mkosi/resources/mkosi-obs/mkosi.postoutput b/mkosi/resources/mkosi-obs/mkosi.postoutput index f2a0c86f0..6c93af1dd 100755 --- a/mkosi/resources/mkosi-obs/mkosi.postoutput +++ b/mkosi/resources/mkosi-obs/mkosi.postoutput @@ -70,6 +70,7 @@ for f in "${ROOTHASHES[@]}"; do done # Handle bootloaders separately from UKIs +found_esp=0 for ddi in "${DDIS[@]}"; do test -f "$ddi" || continue # Skip over split artifacts, if any @@ -90,6 +91,7 @@ for ddi in "${DDIS[@]}"; do rm -rf EFI mcopy -s -i "${ddi%.zst}@@${offset}" ::EFI EFI || true + found_esp=1 # UKIs are handled separately rm -rf EFI/Linux @@ -105,8 +107,8 @@ for ddi in "${DDIS[@]}"; do rm -rf EFI done -# If there is at least one DDI then there might be an ESP, so prepare the authvars for self-enrollment -if ((${#DDIS[@]} > 0)); then +# If there is an ESP prepare the authvars for self-enrollment +if [ "$found_esp" -eq 1 ]; then mkdir -p hashes/authvars pushd hashes/authvars 2>/dev/null # Same as the GUID used by bootctl