Makefile 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #
  2. # Copyright (C) 2012-2014 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. UBIFS_OPTS = -F -m 2048 -e 124KiB -c 4096 -U
  10. UBI_OPTS = -m 2048 -p 128KiB -s 512 -O 2048
  11. define Image/BuildKernel
  12. $(CP) $(KDIR)/zImage $(BIN_DIR)/$(IMG_PREFIX)-zImage
  13. ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),)
  14. $(CP) $(KDIR)/zImage-initramfs $(BIN_DIR)/$(IMG_PREFIX)-zImage-initramfs
  15. endif
  16. ifneq ($(CONFIG_TARGET_ROOTFS_INCLUDE_KERNEL),)
  17. $(INSTALL_DIR) $(TARGET_DIR)/boot
  18. $(CP) $(BIN_DIR)/$(IMG_PREFIX)-zImage $(TARGET_DIR)/boot/zImage
  19. endif
  20. ifneq ($(CONFIG_TARGET_ROOTFS_INCLUDE_DTB),)
  21. $(INSTALL_DIR) $(TARGET_DIR)/boot
  22. $(CP) $(DTS_DIR)/am335x*.dtb $(TARGET_DIR)/boot/
  23. $(CP) $(DTS_DIR)/omap3*.dtb $(TARGET_DIR)/boot/
  24. $(CP) $(DTS_DIR)/omap4*.dtb $(TARGET_DIR)/boot/
  25. endif
  26. -mkdir $(BIN_DIR)/dtbs
  27. -$(CP) $(DTS_DIR)/am335x*.dtb $(BIN_DIR)/dtbs/
  28. -$(CP) $(DTS_DIR)/omap3*.dtb $(BIN_DIR)/dtbs/
  29. -$(CP) $(DTS_DIR)/omap4*.dtb $(BIN_DIR)/dtbs/
  30. endef
  31. define Image/Build
  32. $(call Image/Build/$(1),$(1))
  33. endef
  34. define Image/Build/jffs2-64k
  35. dd if=$(KDIR)/root.$(1) of=$(BIN_DIR)/$(IMG_PREFIX)-$(1).img bs=65536 conv=sync
  36. endef
  37. define Image/Build/jffs2-128k
  38. dd if=$(KDIR)/root.$(1) of=$(BIN_DIR)/$(IMG_PREFIX)-$(1).img bs=131072 conv=sync
  39. endef
  40. define Image/Build/squashfs
  41. $(call prepare_generic_squashfs,$(KDIR)/root.squashfs)
  42. dd if=$(KDIR)/root.$(1) of=$(BIN_DIR)/$(IMG_PREFIX)-$(1).img bs=131072 conv=sync
  43. endef
  44. $(eval $(call BuildImage))