MEDIA_TYPE = netboot image

TARGET = $(INITRD) $(KERNEL) babbage2
EXTRANAME = $(MEDIUM)/
INITRD_FS = initramfs

MANIFEST-INITRD = "netboot initrd"
MANIFEST-KERNEL = "kernel image to netboot"

babbage2: $(INITRD) $(KERNEL)
	mkdir -p $(SOME_DEST)/$(EXTRANAME)/babbage-TO2/
	dd if=/dev/zero of=$(TEMP)/babbage-TO2-sd.img bs=1M count=16
	redboot-install -n -i $(TEMP)/initrd.gz -k $(TEMP)/$(KERNELNAME) \
	    -c "console=ttymxc0,115200 console=tty0" -d $(TEMP)/babbage-TO2-sd.img
	mv $(TEMP)/babbage-TO2-sd.img $(SOME_DEST)/$(EXTRANAME)/babbage-TO2/babbage-TO2-sd.img
	update-manifest $(SOME_DEST)/$(EXTRANAME)/babbage-TO2/babbage-TO2-sd.img "SD card netinstall image for imx51 based babbage2.x boards"
