Makefile 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #
  2. # Copyright (C) 2009-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. JFFS2_BLOCKSIZE=256k 512k
  10. ifneq ($(CONFIG_TARGET_xburst_qi_lb60),)
  11. UBI_OPTS = -m 4096 -p 512KiB
  12. UBIFS_OPTS = -m 4096 -e 516096 -c 4095
  13. else
  14. UBI_OPTS = -m 2048 -p 128KiB -s 512
  15. UBIFS_OPTS = -m 2048 -e 126KiB -c 4096
  16. endif
  17. UIMAGE:=$(BIN_DIR)/$(IMG_PREFIX)-uImage.bin
  18. define kernel_entry
  19. 0x$(shell $(TARGET_CROSS)nm $(1) 2>/dev/null | grep " kernel_entry" | cut -f1 -d ' ')
  20. endef
  21. define MkImageGzip
  22. gzip -9 -c $(1) > $(1).gz
  23. mkimage -A mips -O linux -T kernel -a 0x80010000 -C gzip \
  24. -e $(call kernel_entry,$(KDIR)/vmlinux.debug) -n 'MIPS OpenWrt Linux-$(LINUX_VERSION)' \
  25. -d $(1).gz $(2)
  26. endef
  27. define Image/Prepare
  28. $(call MkImageGzip,$(KDIR)/vmlinux,$(KDIR)/uimage)
  29. endef
  30. define Image/BuildKernel
  31. cp $(KDIR)/uimage $(UIMAGE)
  32. endef
  33. define Image/Build/squashfs
  34. $(call prepare_generic_squashfs,$(KDIR)/root.squashfs)
  35. endef
  36. define Image/Build
  37. dd if=$(KDIR)/root.$(1) of=$(BIN_DIR)/$(IMG_PREFIX)-root.$(1) bs=128k conv=sync
  38. endef
  39. $(eval $(call BuildImage))