From e01c6c952fe413b6550616ec34b8253d013e5467 Mon Sep 17 00:00:00 2001 From: Tim Serong Date: Tue, 11 Feb 2025 19:15:07 +1100 Subject: [PATCH] fix: ensure passive.img is sparse after install Related issue: https://github.com/harvester/harvester/issues/7457 Related issue: https://github.com/harvester/harvester/issues/7518 Signed-off-by: Tim Serong (cherry picked from commit 05152ffb37400850229b6ae2fc5576f39f16dafc) --- package/harvester-os/files/usr/sbin/harv-install | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/package/harvester-os/files/usr/sbin/harv-install b/package/harvester-os/files/usr/sbin/harv-install index e04e0158e..2daa90b6c 100755 --- a/package/harvester-os/files/usr/sbin/harv-install +++ b/package/harvester-os/files/usr/sbin/harv-install @@ -163,6 +163,14 @@ do_mount() mount ${PERSISTENT} ${TARGET}/usr/local } +sparsify_passive_img() +{ + # See https://github.com/harvester/harvester/issues/7518 + echo "Ensuring passive.img is sparse..." + echo " was: $(du -h ${STATEDIR}/cOS/passive.img)" + fallocate --dig-holes ${STATEDIR}/cOS/passive.img + echo " now: $(du -h ${STATEDIR}/cOS/passive.img)" +} preload_rke2_images() { @@ -537,6 +545,7 @@ do_data_disk_format # Preload images do_detect do_mount +sparsify_passive_img get_iso # For PXE Boot save_configs save_wicked_state