mkosi: Use squashfs for sysext if mkfs.erofs is not available
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Thu, 11 Jul 2024 14:19:20 +0000 (16:19 +0200)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Tue, 16 Jul 2024 13:14:13 +0000 (15:14 +0200)
CentOS Stream 10 does not have erofs-utils so let's add a fallback
to squashfs when building the sysext.

(cherry picked from commit 3cfb020cb9ce5958ac39a7fd586cc4e893a7b190)

mkosi.functions

index c19c1aa6435711d2598ccc426e0c185dc45cddd2..993f2e8a394fbc3209c10fceeb418c52a5355f0d 100644 (file)
@@ -38,7 +38,15 @@ EOF
 
     rm -f "$BUILDDIR"/systemd.raw
 
-    env --unset=SYSTEMD_REPART_OVERRIDE_FSTYPE_ROOT \
+    local fstype
+
+    if command -v mkfs.erofs; then
+        fstype=erofs
+    else
+        fstype=squashfs
+    fi
+
+    env SYSTEMD_REPART_OVERRIDE_FSTYPE_ROOT="$fstype" \
     "$BUILDDIR"/systemd-repart \
         --make-ddi=sysext-unsigned \
         --copy-source="$1" \