]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
mkosi-obs: prepare EFI authvars only if there is at least an ESP 4036/head
authorLuca Boccassi <luca.boccassi@gmail.com>
Sun, 7 Dec 2025 23:41:39 +0000 (23:41 +0000)
committerLuca Boccassi <luca.boccassi@gmail.com>
Tue, 9 Dec 2025 11:01:17 +0000 (11:01 +0000)
No point otherwise, a DDI might be a portable image with no ESP

mkosi/resources/mkosi-obs/mkosi.postoutput

index f2a0c86f08d0164c0762b9f94cd686894878e58a..6c93af1dd5d08c21aceb95c643c4336cf7f11e1c 100755 (executable)
@@ -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