From: Michael Tremer Date: Sun, 24 Aug 2014 14:11:45 +0000 (+0200) Subject: flash-images: Add an extra 100 MB padding at end of image X-Git-Tag: v2.17-core87~103^2~51^2~34 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7051d2af6191a8ab4edbb43088eae1bccebd4bc3;p=ipfire-2.x.git flash-images: Add an extra 100 MB padding at end of image This makes it easier to align partitions correctly when the root partition is grown at the first boot. --- diff --git a/lfs/flash-images b/lfs/flash-images index 7baec7c2ee..79701aad96 100644 --- a/lfs/flash-images +++ b/lfs/flash-images @@ -79,6 +79,8 @@ endif S_BOOT := $(shell echo $$(( 131072 - $(S_OFFSET) ))) S_ROOT := 1433600 +PADDING = 100 # MB + $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) # Stop if $(MNThdd) is still mounted mountpoint $(MNThdd) && exit 1 || exit 0 @@ -207,6 +209,10 @@ endif kpartx -d -v $(DEVICE) losetup -d $(DEVICE) + # Add padding at the end of the image (to fix alignment issues if the image is + # not copied to a block device) + dd if=/dev/zero bs=1M count=$(PADDING) >> $(IMG) + # Compress Image pigz -f9 < $(IMG) > $(IMAGE_FILE) rm -rf $(IMG) $(MNThdd)