endif
# /boot: 64MB - OFFSET
-# / : 700MB
+# / : 750MB
S_BOOT := $(shell echo $$(( 131072 - $(S_OFFSET) )))
-S_ROOT := 1433600
+S_ROOT := 1536000
PADDING = 100 # MB
mkdir -pv $(MNThdd)/boot
mount $(PART_BOOT) $(MNThdd)/boot
- # Install MLO and uboot first
+ # Install Pandaboard MLO and uboot first
ifeq "$(MACHINE_TYPE)" "arm"
cp -v /boot/MLO $(MNThdd)/boot/
cp -v /boot/u-boot.img $(MNThdd)/boot/
cp -v /boot/zImage-ipfire-multi $(MNThdd)/boot/
+ # work around a u-boot bug not find the folders sometimes
+ mkdir -pv $(MNThdd)/boot/dtb-$(KVER)-ipfire-multi
+ mkdir -pv $(MNThdd)/boot/dtb-$(KVER)-ipfire-kirkwood
sync
umount $(MNThdd)/boot
mount $(PART_BOOT) $(MNThdd)/boot
ifeq "$(MACHINE_TYPE)" "arm"
sed -i -e "s| console=tty1 | console=ttyAMA0,115200n8 |g" $(MNThdd)/boot/cmdline.txt
- sed -i -e "s| console=tty1 | console=ttyO2,115200n8 |g" $(MNThdd)/boot/boot.script
- cd $(MNThdd)/boot && ./convert_bootscript
+ sed -i -e "s| console=tty1 | console=ttyO2,115200n8 |g" $(MNThdd)/boot/uEnv.txt
endif
endif
mkdir -pv $(MNThdd)/boot/grub
chroot $(MNThdd) grub-mkconfig -o /boot/grub/grub.cfg
- # Insert the UUID because grub-mkconfig fails to detect that correctly
+ # Insert the UUID because grub-mkconfig often fails to
+ # detect that correctly
sed -i $(MNThdd)/boot/grub/grub.cfg \
- -e "s/root=[a-z0-9\/]*/root=UUID=$$(blkid -o value -s UUID $(PART_ROOT))/g"
+ -e "s/root=[A-Za-z0-9=-\/]*/root=UUID=$$(blkid -o value -s UUID $(PART_ROOT))/g"
# Install GRUB
grub-install --force --recheck --no-floppy \
--root-directory=$(MNThdd) $(DEVICE)
endif
+ # Set ramdisk mode to automatic
+ echo RAMDISK_MODE=2 > $(MNThdd)/etc/sysconfig/ramdisk
+
# Automatically resize the root partition to its maximum size at first boot
touch $(MNThdd)/.partresize
-fsck.ext4 -f -y $(PART_ROOT)
fsck.ext4 -f -y $(PART_ROOT)
+ sleep 10 #Ubuntu compiling: allow time to automount/dismount
kpartx -d -v $(DEVICE)
losetup -d $(DEVICE)
# not copied to a block device)
dd if=/dev/zero bs=1M count=$(PADDING) >> $(IMG)
+ifeq "$(MACHINE_TYPE)" "arm"
+ # Install u-boot for LeMaker Banana Pi into image 8KB
+ dd if=/usr/share/u-boot/banana_pi/u-boot-sunxi-with-spl.bin of=$(IMG) bs=1K seek=8 conv=notrunc
+endif
+
# Compress Image
pigz -f9 < $(IMG) > $(IMAGE_FILE)
rm -rf $(IMG) $(MNThdd)