MEDIA_TYPE = netboot image

TARGET = $(TEMP_KERNEL) $(TEMP_INITRD) ss4000e
EXTRANAME = $(MEDIUM)

# Intel SS4000-e
ss4000e:
	mkdir -p $(SOME_DEST)/$(EXTRANAME)/ss4000e
	# Set machine id to 1212 (0x04bc)
	devio > $(SOME_DEST)/$(EXTRANAME)/ss4000e/zImage 'wl 0xe3a01c04,4' 'wl 0xe38110bc,4'
	cat $(TEMP_KERNEL) >> $(SOME_DEST)/$(EXTRANAME)/ss4000e/zImage
	update-manifest $(SOME_DEST)/$(EXTRANAME)/ss4000e/zImage "kernel for Intel SS4000-e"
	cp $(TEMP_INITRD) $(SOME_DEST)/$(EXTRANAME)/ss4000e/initrd.gz
	update-manifest $(SOME_DEST)/$(EXTRANAME)/ss4000e/initrd.gz "initrd for Intel SS4000-e"
	mkdir -p $(TEMP)/upgrade
	install -m 755 util/arm/ss4000e/up.sh $(TEMP)/upgrade.sh
	mkdir -p $(TEMP)/upgrade/etc
	echo "fs-bc - 9.9-b999" > $(TEMP)/upgrade/etc/version
	cp $(SOME_DEST)/$(EXTRANAME)/ss4000e/zImage $(TEMP)/upgrade/zImage
	cp $(TEMP_INITRD) $(TEMP)/upgrade/initrd.gz
	(cd $(TEMP) && tar -cpzf ss4000e.tar.gz upgrade)
	util/arm/ss4000e/mkfwimage.sh $(TEMP)/ss4000e.tar.gz $(SOME_DEST)/$(EXTRANAME)/ss4000e/ss4000e.pkg
	update-manifest $(SOME_DEST)/$(EXTRANAME)/ss4000e/ss4000e.pkg "Firmware image for Intel SS4000-E"

