MEDIA_TYPE = netboot image

TARGET = $(INITRD) $(KERNEL) sheevaplug sheevaplug-esata guruplug dreamplug dockstar
EXTRANAME = $(MEDIUM)/

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

sheevaplug:
	mkdir -p $(SOME_DEST)/$(EXTRANAME)marvell/sheevaplug
	cat $(TEMP_KERNEL) $(TEMP_DTBS)/kirkwood-sheevaplug.dtb > $(TEMP)/vmlinuz-sheevaplug
	mkimage -A arm -O linux -T kernel -C none -a 0x00008000 -e 0x00008000 -n "Debian kernel" -d $(TEMP)/vmlinuz-sheevaplug $(SOME_DEST)/$(EXTRANAME)marvell/sheevaplug/uImage
	mkimage -A arm -O linux -T ramdisk -C gzip -a 0x0 -e 0x0 -n "debian-installer ramdisk" -d $(TEMP_INITRD) $(SOME_DEST)/$(EXTRANAME)marvell/sheevaplug/uInitrd
	update-manifest $(SOME_DEST)/$(EXTRANAME)marvell/sheevaplug/uImage "Linux kernel for SheevaPlug"
	update-manifest $(SOME_DEST)/$(EXTRANAME)marvell/sheevaplug/uInitrd "initrd for SheevaPlug"

sheevaplug-esata: sheevaplug
	mkdir -p $(SOME_DEST)/$(EXTRANAME)marvell/sheevaplug-esata
	cat $(TEMP_KERNEL) $(TEMP_DTBS)/kirkwood-sheevaplug-esata.dtb > $(TEMP)/vmlinuz-sheevaplug-esata
	mkimage -A arm -O linux -T kernel -C none -a 0x00008000 -e 0x00008000 -n "Debian kernel" -d $(TEMP)/vmlinuz-sheevaplug-esata $(SOME_DEST)/$(EXTRANAME)marvell/sheevaplug-esata/uImage
	ln -nfs ../sheevaplug/uInitrd $(SOME_DEST)/$(EXTRANAME)marvell/sheevaplug-esata/uInitrd
	update-manifest $(SOME_DEST)/$(EXTRANAME)marvell/sheevaplug-esata/uImage "Linux kernel for SheevaPlug eSATA"
	update-manifest $(SOME_DEST)/$(EXTRANAME)marvell/sheevaplug-esata/uInitrd "initrd for SheevaPlug eSATA"

guruplug: sheevaplug
	mkdir -p $(SOME_DEST)/$(EXTRANAME)marvell/guruplug
	cat $(TEMP_KERNEL) $(TEMP_DTBS)/kirkwood-guruplug-server-plus.dtb > $(TEMP)/vmlinuz-guruplug
	mkimage -A arm -O linux -T kernel -C none -a 0x00008000 -e 0x00008000 -n "Debian kernel" -d $(TEMP)/vmlinuz-guruplug $(SOME_DEST)/$(EXTRANAME)marvell/guruplug/uImage
	ln -nfs ../sheevaplug/uInitrd $(SOME_DEST)/$(EXTRANAME)marvell/guruplug/uInitrd
	update-manifest $(SOME_DEST)/$(EXTRANAME)marvell/guruplug/uImage "Linux kernel for GuruPlug"
	update-manifest $(SOME_DEST)/$(EXTRANAME)marvell/guruplug/uInitrd "initrd for GuruPlug"

dreamplug: sheevaplug
	mkdir -p $(SOME_DEST)/$(EXTRANAME)marvell/dreamplug
	cat $(TEMP_KERNEL) $(TEMP_DTBS)/kirkwood-dreamplug.dtb > $(TEMP)/vmlinuz-dreamplug
	mkimage -A arm -O linux -T kernel -C none -a 0x00008000 -e 0x00008000 -n "Debian kernel" -d $(TEMP)/vmlinuz-dreamplug $(SOME_DEST)/$(EXTRANAME)marvell/dreamplug/uImage
	ln -nfs ../sheevaplug/uInitrd $(SOME_DEST)/$(EXTRANAME)marvell/dreamplug/uInitrd
	update-manifest $(SOME_DEST)/$(EXTRANAME)marvell/dreamplug/uImage "Linux kernel for DreamPlug"
	update-manifest $(SOME_DEST)/$(EXTRANAME)marvell/dreamplug/uInitrd "initrd for DreamPlug"

dockstar:
	mkdir -p $(SOME_DEST)/$(EXTRANAME)seagate/dockstar
	cat $(TEMP_KERNEL) $(TEMP_DTBS)/kirkwood-dockstar.dtb > $(TEMP)/vmlinuz-dockstar
	mkimage -A arm -O linux -T kernel -C none -a 0x00008000 -e 0x00008000 -n "Debian kernel" -d $(TEMP)/vmlinuz-dockstar $(SOME_DEST)/$(EXTRANAME)seagate/dockstar/uImage
	mkimage -A arm -O linux -T ramdisk -C gzip -a 0x0 -e 0x0 -n "debian-installer ramdisk" -d $(TEMP_INITRD) $(SOME_DEST)/$(EXTRANAME)seagate/dockstar/uInitrd
	update-manifest $(SOME_DEST)/$(EXTRANAME)seagate/dockstar/uImage "Linux kernel for Seagate DockStar"
	update-manifest $(SOME_DEST)/$(EXTRANAME)seagate/dockstar/uInitrd "initrd for Seagate DockStar"
