- # Write Partition table
-ifneq "$(MACHINE_TYPE)" "arm"
- echo -e ",$(SIZEboot),L,*\n,0,0\n,$(SIZEroot),L\n,0,0\n" \
- | sfdisk -D -uM -H 64 -S 32 $(IMGinsts)
-else
- echo -e ",$(SIZEboot),c,*\n,0,0\n,$(SIZEroot),L\n,0,0\n" \
- | sfdisk -D -uM -H 64 -S 32 $(IMGinsts)
-endif
-
-ifneq "$(MACHINE_TYPE)" "arm"
- # Install grub
- echo "device (hd0) $(IMGinsts)" > /tmp/grubinst.tmp
- echo "root (hd0,0)" >> /tmp/grubinst.tmp
- echo "setup (hd0)" >> /tmp/grubinst.tmp
- echo "quit" >> /tmp/grubinst.tmp
- grub < /tmp/grubinst.tmp
- rm -f /tmp/grubinst.tmp
-endif
+ # 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)