-ifeq ($(SUBTARGET),wiligear)
-define Image/Prepare
-# WBD111: mach id 1690 (0x69a)
- echo -en "\x06\x1c\xa0\xe3\x9a\x10\x81\xe3" > $(KDIR)/wbd111-zImage
- cat $(KDIR)/zImage >> $(KDIR)/wbd111-zImage
-# WBD222: mach id 2753 (0xAC1)
- echo -en "\x0a\x1c\xa0\xe3\xc1\x10\x81\xe3" > $(KDIR)/wbd222-zImage
- cat $(KDIR)/zImage >> $(KDIR)/wbd222-zImage
+# Build the special D-Link DNS-313 header generator tool
+# needed to generate the hard disk boot images then
+# build D-Link DNS-313 images using the special header tool.
+# rootfs.tgz and rd.tgz contains nothing, we only need them
+# to satisfy the boot loader on the device. The zImage is
+# the only real content.
+define Build/dns313-images
+ if [ -d $(BIN_DIR)/.boot ] ; then rm -rf $(BIN_DIR)/.boot ; fi
+ mkdir -p $(BIN_DIR)/.boot
+ echo "dummy" > $(BIN_DIR)/.boot/dummyfile
+ dns313-header $(BIN_DIR)/.boot/dummyfile \
+ $(BIN_DIR)/.boot/rootfs.tgz
+ dns313-header $(BIN_DIR)/.boot/dummyfile \
+ $(BIN_DIR)/.boot/rd.gz
+ dns313-header $(IMAGE_KERNEL) \
+ $(BIN_DIR)/.boot/zImage
+ rm -f $(BIN_DIR)/.boot/dummyfile
+ (cd $(BIN_DIR); tar -czf $(IMG_PREFIX)-dns313-bootpart.tar.gz .boot)
+ if [ -d $(BIN_DIR)/.boot ] ; then rm -rf $(BIN_DIR)/.boot ; fi