Make the image zstd-19 compressed

This commit is contained in:
Jørn Åne de Jong 2022-05-02 09:27:59 +02:00 committed by Nico Schottelius
parent 33cc65ecc2
commit f24303d021
1 changed files with 8 additions and 1 deletions

View File

@ -53,7 +53,9 @@ gpart add -t freebsd-zfs -l zfs0 -b 1M -s 5G md0
zpool create -O compression=on -o ashift=12 -o altroot=/mnt -m none $ZPOOL md0p2
zfs create -o mountpoint=none $ZPOOL/ROOT
zfs create -o mountpoint=/ -o canmount=noauto $ZPOOL/ROOT/default
# We set zstd-19 so our image will become smaller, at the cost of a longer build time
# At the end, we remove zstd-19 again, but all files already written will remain zstd-19 compressed
zfs create -o mountpoint=/ -o canmount=noauto -o compression=zstd-19 $ZPOOL/ROOT/default
mount -t zfs $ZPOOL/ROOT/default /mnt
zpool set bootfs=$ZPOOL/ROOT/default $ZPOOL
@ -133,6 +135,11 @@ env ASSUME_ALWAYS_YES=YES pkg -c /mnt install sudo bash curl base64 ruby open-vm
env ASSUME_ALWAYS_YES=YES pkg -c /mnt clean --all
rm /mnt/one-context.txz
# Remove zstd-19 again, as it would be too slow for daily use.
# But all files that were already writtne will remain zstd-19 compressed.
# zstd-19 is slow to compress but fast to read.
zfs inherit compression $ZPOOL/ROOT/default
trap : EXIT
cleanup