Makefile 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. #
  2. # Copyright (C) 2007-2010 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. define Image/BuildKernel
  10. cp $(LINUX_DIR)/vmlinux $(BIN_DIR)/$(IMG_PREFIX)-vmlinux
  11. # uImage
  12. dd if=$(KDIR)/vmlinux of=$(KDIR)/$(IMG_PREFIX)-vmlinux bs=64k conv=sync
  13. mkimage -A mips -O linux -T kernel -a 0x80100000 -C none -e \
  14. 0x80100000 \
  15. -n 'MIPS OpenWrt Linux-$(LINUX_VERSION)' \
  16. -d $(KDIR)/$(IMG_PREFIX)-vmlinux $(BIN_DIR)/$(IMG_PREFIX)-uImage
  17. endef
  18. define Image/Build
  19. $(call Image/Build/$(1),$(1))
  20. endef
  21. define Image/Build/jffs2-64k
  22. dd if=$(KDIR)/root.$(1) of=$(BIN_DIR)/$(IMG_PREFIX)-$(1).img bs=65536 conv=sync
  23. endef
  24. define Image/Build/jffs2-128k
  25. dd if=$(KDIR)/root.$(1) of=$(BIN_DIR)/$(IMG_PREFIX)-$(1).img bs=131072 conv=sync
  26. $(call Image/Build/slug,$(1))
  27. endef
  28. define Image/Build/squashfs
  29. $(call prepare_generic_squashfs,$(KDIR)/root.squashfs)
  30. dd if=$(KDIR)/root.$(1) of=$(BIN_DIR)/$(IMG_PREFIX)-$(1).img bs=131072 conv=sync
  31. endef
  32. $(eval $(call BuildImage))