Makefile 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. #
  2. # Copyright (C) 2008-2013 OpenWrt.org
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. #
  7. include $(TOPDIR)/rules.mk
  8. include $(INCLUDE_DIR)/image.mk
  9. JFFS2_BLOCKSIZE=128k 64k
  10. define Image/Prepare
  11. $(LINUX_DIR)/scripts/dtc/dtc -O dtb -R 4 -S 0x20000 $(DTS_DIR)/kilauea.dts > $(KDIR)/openwrt-kilauea.dtb
  12. endef
  13. define Image/BuildKernel
  14. cp $(KDIR)/uImage $(BIN_DIR)/$(IMG_PREFIX)-uImage
  15. $(call Image/Build/Initramfs)
  16. endef
  17. define Image/Build
  18. $(call Image/Build/$(1),$(1))
  19. endef
  20. define Image/Build/ext2
  21. cp $(KDIR)/root.$(1) $(BIN_DIR)/$(IMG_PREFIX)-ext2.img
  22. endef
  23. define Image/Build/jffs2-128k
  24. ( \
  25. dd if=$(KDIR)/uImage bs=1920k conv=sync; \
  26. dd if=$(KDIR)/openwrt-kilauea.dtb bs=128k conv=sync; \
  27. dd if=$(KDIR)/root.$(1) bs=128k conv=sync; \
  28. ) > $(BIN_DIR)/$(IMG_PREFIX)-kilauea-jffs2.img
  29. endef
  30. define Image/Build/jffs2-64k
  31. ( \
  32. dd if=$(KDIR)/cuImage.magicbox bs=1408k conv=sync; \
  33. dd if=$(KDIR)/root.$(1) bs=64k conv=sync; \
  34. ) > $(BIN_DIR)/$(IMG_PREFIX)-magicbox-jffs2.img
  35. ( \
  36. dd if=$(KDIR)/cuImage.openrb bs=1408k conv=sync; \
  37. dd if=$(KDIR)/root.$(1) bs=64k conv=sync; \
  38. ) > $(BIN_DIR)/$(IMG_PREFIX)-openrb-jffs2.img
  39. endef
  40. define Image/Build/squashfs
  41. $(call prepare_generic_squashfs,$(KDIR)/root.squashfs)
  42. ( \
  43. dd if=$(KDIR)/uImage bs=1920k conv=sync; \
  44. dd if=$(KDIR)/openwrt-kilauea.dtb bs=128k conv=sync; \
  45. dd if=$(KDIR)/root.$(1) bs=128k conv=sync; \
  46. ) > $(BIN_DIR)/$(IMG_PREFIX)-kilauea-$(1).img
  47. ( \
  48. dd if=$(KDIR)/cuImage.magicbox bs=64k conv=sync; \
  49. dd if=$(KDIR)/root.$(1) bs=64k conv=sync; \
  50. ) > $(BIN_DIR)/$(IMG_PREFIX)-magicbox-$(1).img
  51. ( \
  52. dd if=$(KDIR)/cuImage.openrb bs=1408k conv=sync; \
  53. dd if=$(KDIR)/root.$(1) bs=64k conv=sync; \
  54. ) > $(BIN_DIR)/$(IMG_PREFIX)-openrb-$(1).img
  55. endef
  56. ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),)
  57. define Image/Build/Initramfs
  58. cp $(KDIR)/cuImage.magicbox-initramfs $(BIN_DIR)/openwrt-$(BOARD)-magicbox-initramfs.bin
  59. cp $(KDIR)/cuImage.openrb-initramfs $(BIN_DIR)/openwrt-$(BOARD)-openrb-initramfs.bin
  60. endef
  61. endif
  62. $(eval $(call BuildImage))