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
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
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
--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
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)