repart: Use --shrink with mkfs.btrfs to get a minimal filesystem

Avoids populating the filesystem twice similar to read-only
filesystems.
This commit is contained in:
Daan De Meyer
2026-04-03 19:12:46 +02:00
committed by Daan De Meyer
parent 4725767730
commit 4ded480ea5
3 changed files with 36 additions and 14 deletions
+12
View File
@@ -1254,6 +1254,18 @@ Minimize=guess
EOF
done
if command -v mkfs.btrfs >/dev/null; then
for minimize in guess best; do
tee "$defs/root-btrfs-${minimize}.conf" <<EOF
[Partition]
Type=root-${architecture}
Format=btrfs
CopyFiles=${defs}
Minimize=${minimize}
EOF
done
fi
if command -v mksquashfs >/dev/null; then
tee "$defs/root-squashfs.conf" <<EOF
[Partition]