flash-images: Create the base image as a sparse file

This will be much faster as it creates less IO.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
This commit is contained in:
Michael Tremer
2024-07-09 19:24:14 +00:00
parent 64192acb7f
commit 61cb600a13

View File

@@ -104,7 +104,7 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
rm -rf $(IMG) $(MNThdd) && mkdir -p $(MNThdd)
# Allocate image on disk
dd if=/dev/zero of=$(IMG) bs=512 count=$$(( $(S_OFFSET) + $(S_BOOT) + $(S_EFI) + $(S_ROOT) ))
dd if=/dev/zero of=$(IMG) bs=512 count=0 seek=$$(( $(S_OFFSET) + $(S_BOOT) + $(S_EFI) + $(S_ROOT) ))
losetup $(DEVICE) $(IMG)
# Write Partition table