Makefile 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. #
  2. # Copyright (C) 2006-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 $(KDIR)/vmlinux.elf $(BIN_DIR)/$(IMG_PREFIX)-vmlinux.elf
  11. gzip -9 -c $(KDIR)/vmlinux > $(KDIR)/vmlinux.bin.gz
  12. $(STAGING_DIR_HOST)/bin/lzma e $(KDIR)/vmlinux $(KDIR)/vmlinux.bin.l7
  13. dd if=$(KDIR)/vmlinux.bin.l7 of=$(BIN_DIR)/$(IMG_PREFIX)-vmlinux.lzma bs=65536 conv=sync
  14. dd if=$(KDIR)/vmlinux.bin.gz of=$(BIN_DIR)/$(IMG_PREFIX)-vmlinux.gz bs=65536 conv=sync
  15. endef
  16. define Image/Build/squashfs
  17. $(call prepare_generic_squashfs,$(KDIR)/root.squashfs)
  18. endef
  19. define Image/Build
  20. $(call Image/Build/$(1))
  21. dd if=$(KDIR)/root.$(1) of=$(BIN_DIR)/$(IMG_PREFIX)-root.$(1) bs=128k conv=sync
  22. -$(STAGING_DIR_HOST)/bin/mkfwimage \
  23. -B XS2 -v XS2.ar2316.OpenWrt.$(REVISION) \
  24. -k $(BIN_DIR)/$(IMG_PREFIX)-vmlinux.lzma \
  25. -r $(BIN_DIR)/$(IMG_PREFIX)-root.$(1) \
  26. -o $(BIN_DIR)/$(IMG_PREFIX)-ubnt2-$(1).bin
  27. -$(STAGING_DIR_HOST)/bin/mkfwimage \
  28. -B XS5 -v XS5.ar2313.OpenWrt.$(REVISION) \
  29. -k $(BIN_DIR)/$(IMG_PREFIX)-vmlinux.lzma \
  30. -r $(BIN_DIR)/$(IMG_PREFIX)-root.$(1) \
  31. -o $(BIN_DIR)/$(IMG_PREFIX)-ubnt5-$(1).bin
  32. -$(STAGING_DIR_HOST)/bin/mkfwimage \
  33. -B XS2-8 -v XS2.ar2316.OpenWrt.$(REVISION) \
  34. -k $(BIN_DIR)/$(IMG_PREFIX)-vmlinux.lzma \
  35. -r $(BIN_DIR)/$(IMG_PREFIX)-root.$(1) \
  36. -o $(BIN_DIR)/$(IMG_PREFIX)-ubnt2-pico2-$(1).bin
  37. -$(STAGING_DIR_HOST)/bin/mkmylofw -B np25g \
  38. -p0x020000:0x130000:ah:0x80041000:linux:$(KDIR)/vmlinux.bin.gz \
  39. -p0x150000:0x2a0000:::rootfs:$(BIN_DIR)/$(IMG_PREFIX)-root.$(1) \
  40. $(BIN_DIR)/$(IMG_PREFIX)-np25g-$(1).bin
  41. -$(STAGING_DIR_HOST)/bin/mkmylofw -B wpe53g \
  42. -p0x020000:0x130000:ah:0x80041000:linux:$(KDIR)/vmlinux.bin.gz \
  43. -p0x150000:0x2a0000:::rootfs:$(BIN_DIR)/$(IMG_PREFIX)-root.$(1) \
  44. $(BIN_DIR)/$(IMG_PREFIX)-wpe53g-$(1).bin
  45. -sh $(TOPDIR)/scripts/combined-image.sh \
  46. "$(BIN_DIR)/$(IMG_PREFIX)-vmlinux.lzma" \
  47. "$(BIN_DIR)/$(IMG_PREFIX)-root.$(1)" \
  48. "$(BIN_DIR)/$(IMG_PREFIX)-combined.$(1).img"
  49. endef
  50. $(eval $(call BuildImage))