MEDIA_TYPE = netboot image

TARGET = $(TEMP_INITRD) $(TEMP_KERNEL) openrd sheevaplug t5325
EXTRANAME = $(MEDIUM)

# OpenRD
openrd:
	mkdir -p $(SOME_DEST)/$(EXTRANAME)/marvell/openrd
	mkimage -A arm -O linux -T kernel -C none -a 0x00008000 -e 0x00008000 -n "Debian kernel" -d $(TEMP_KERNEL) $(SOME_DEST)/$(EXTRANAME)/marvell/openrd/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/openrd/uInitrd
	update-manifest $(SOME_DEST)/$(EXTRANAME)/marvell/openrd/uImage "Linux kernel for OpenRD"
	update-manifest $(SOME_DEST)/$(EXTRANAME)/marvell/openrd/uInitrd "initrd for OpenRD"

# SheevaPlug and GuruPlug
sheevaplug:
	mkdir -p $(SOME_DEST)/$(EXTRANAME)/marvell/sheevaplug
	mkimage -A arm -O linux -T kernel -C none -a 0x00008000 -e 0x00008000 -n "Debian kernel" -d $(TEMP_KERNEL) $(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"
	ln -s sheevaplug $(SOME_DEST)/$(EXTRANAME)/marvell/guruplug
	update-manifest $(SOME_DEST)/$(EXTRANAME)/marvell/guruplug/uImage "Linux kernel for GuruPlug"
	update-manifest $(SOME_DEST)/$(EXTRANAME)/marvell/guruplug/uInitrd "initrd for GuruPlug"

# HP t5325 Thin Client
t5325:
	mkdir -p $(SOME_DEST)/$(EXTRANAME)/hp/t5325
	mkdir -p $(TEMP)/t5325
	# Set machine id 2846 (0x0b1e)
	devio > $(TEMP)/t5325/kernel 'wl 0xe3a01c0b,4' 'wl 0xe381101e,4'
	cat $(TEMP_KERNEL) >> $(TEMP)/t5325/kernel
	mkimage -A arm -O linux -T kernel -C none -a 0x00008000 -e 0x00008000 -n "Debian kernel" -d $(TEMP)/t5325/kernel $(SOME_DEST)/$(EXTRANAME)/hp/t5325/uImage.usb
	mkimage -A arm -O linux -T ramdisk -C gzip -a 0x0 -e 0x0 -n "debian-installer ramdisk" -d $(TEMP_INITRD) $(SOME_DEST)/$(EXTRANAME)/hp/t5325/uInitrd.usb
	update-manifest $(SOME_DEST)/$(EXTRANAME)/hp/t5325/uImage.usb "Linux kernel for HP t5325"
	update-manifest $(SOME_DEST)/$(EXTRANAME)/hp/t5325/uInitrd.usb "initrd for HP t5325"

