ar71xx: move DomyWifi DW33D to nand subtarget
[openwrt/openwrt.git] / target / linux / ar71xx / image / Makefile
index a8c215b36db11667baab47b413e3549be083c0b2..64221a3d6c56636b3890f59ca5d77093f1437911 100644 (file)
@@ -78,6 +78,19 @@ define Build/loader-okli
        mv "$@.new" "$@"
 endef
 
+define Build/relocate-kernel
+       rm -rf $@.relocate
+       $(CP) ../../generic/image/relocate $@.relocate
+       $(MAKE) -j1 -C $@.relocate KERNEL_ADDR=$(KERNEL_LOADADDR) CROSS_COMPILE=$(TARGET_CROSS)
+       ( \
+               dd if=$@.relocate/loader.bin bs=32 conv=sync && \
+               perl -e '@s = stat("$@"); print pack("N", @s[7])' && \
+               cat "$@" \
+       ) > "$@.new"
+       mv "$@.new" "$@"
+       rm -rf $@.relocate
+endef
+
 define Build/copy-file
        cat "$(1)" > "$@"
 endef
@@ -94,7 +107,7 @@ define Device/Default
   KERNEL := kernel-bin | patch-cmdline | lzma | uImage lzma
   COMPILE :=
   IMAGES := sysupgrade.bin
-  IMAGE/sysupgrade.bin = append-kernel $$$$(BLOCKSIZE) | append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE)
+  IMAGE/sysupgrade.bin = append-kernel | pad-to $$$$(BLOCKSIZE) | append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE)
 endef
 
 $(eval $(call BuildImage))