]> git.ipfire.org Git - people/mfischer/ipfire-2.x.git/blobdiff - lfs/flash-images
Merge branch 'kernel-test-next' into seventeen
[people/mfischer/ipfire-2.x.git] / lfs / flash-images
index 69b6b44ebd35999f058fb062e5233c6d201293ea..f660d5cee00c4d8cfdc5594f84e881ce7bd97be9 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
@@ -125,8 +127,11 @@ ifeq "$(MACHINE_TYPE)" "arm"
 endif
 
        # Install IPFire
+ifneq "$(MACHINE_TYPE)" "arm"
        tar -x --lzma -C $(MNThdd)/ -f /install/cdrom/distro.img
-
+else
+       tar -x -C $(MNThdd)/ -f /install/cdrom/distro.img
+endif
        echo "LANGUAGE=en" >> $(MNThdd)/var/ipfire/main/settings
        echo "HOSTNAME=$(SNAME)" >> $(MNThdd)/var/ipfire/main/settings
        echo "THEME=ipfire" >> $(MNThdd)/var/ipfire/main/settings
@@ -162,15 +167,10 @@ endif
        printf "$(FSTAB_FMT)" "$$(blkid -o value -s UUID $(PART_ROOT))" "/" \
                "auto" "defaults" 1 1 >> $(MNThdd)/etc/fstab
 
-       # Setup symlink for partresize at first boot...
-       ln -sf ../init.d/partresize $(MNThdd)/etc/rc.d/rcsysinit.d/S25partresize
-       # Setup symlink for fsresize at second boot...
-       ln -sf ../init.d/fsresize $(MNThdd)/etc/rc.d/rcsysinit.d/S42fsresize
-
 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
@@ -189,6 +189,9 @@ endif
                --root-directory=$(MNThdd) $(DEVICE)
 endif
 
+       # Automatically resize the root partition to its maximum size at first boot
+       touch $(MNThdd)/.partresize
+
        # Unmount
        umount $(MNThdd)/proc
        umount $(MNThdd)/sys
@@ -209,6 +212,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)