]> git.ipfire.org Git - ipfire-2.x.git/blobdiff - lfs/flash-images
installer: Simplify kernel command line parsing
[ipfire-2.x.git] / lfs / flash-images
index 7baec7c2eec6db70299e38d0c50deb372aa9a276..aeaace26e4bae40dff9129b3e53dc5501f31f53b 100644 (file)
@@ -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
@@ -165,7 +167,7 @@ endif
 ifeq "$(BOOTLOADER)" "grub"
 ifeq "$(SCON)" "1"
        # Enable serial console on GRUB
-       echo "GRUB_TERMINAL=\"serial console\"" >> $(MNThdd)/etc/default/grub
+       echo "GRUB_TERMINAL=\"serial\"" >> $(MNThdd)/etc/default/grub
        echo "GRUB_SERIAL_COMMAND=\"serial --unit=0 --speed=115200\"" >> $(MNThdd)/etc/default/grub
 
        sed -i -e "s|panic=10|& console=ttyS0,115200n8|g" $(MNThdd)/etc/default/grub
@@ -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)