]> git.ipfire.org Git - people/ms/ipfire-2.x.git/commitdiff
flash-images: Create the base image as a sparse file
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 9 Jul 2024 19:24:14 +0000 (19:24 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 9 Jul 2024 19:24:14 +0000 (19:24 +0000)
This will be much faster as it creates less IO.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
lfs/flash-images

index fceff9e53c7586c08b246d4e2b1174b84e1cbc44..d3d550c6b6d0b7bb5e6cc6b93508805be8d030ad 100644 (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