Makefile 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #
  2. # Copyright (C) 2013-2016 OpenWrt.org
  3. # Copyright (C) 2016 Yousong Zhou
  4. #
  5. # This is free software, licensed under the GNU General Public License v2.
  6. # See /LICENSE for more information.
  7. #
  8. include $(TOPDIR)/rules.mk
  9. include $(INCLUDE_DIR)/image.mk
  10. FAT32_BLOCK_SIZE=1024
  11. FAT32_BLOCKS=$(shell echo $$(($(CONFIG_SUNXI_SD_BOOT_PARTSIZE)*1024*1024/$(FAT32_BLOCK_SIZE))))
  12. KERNEL_LOADADDR:=0x40008000
  13. define Build/sunxi-sdcard
  14. rm -f $@.boot
  15. mkfs.fat $@.boot -C $(FAT32_BLOCKS)
  16. mcopy -i $@.boot $(STAGING_DIR_IMAGE)/$(DEVICE_NAME)-boot.scr ::boot.scr
  17. mcopy -i $@.boot $(DTS_DIR)/$(SUNXI_DTS).dtb ::dtb
  18. mcopy -i $@.boot $(IMAGE_KERNEL) ::uImage
  19. ./gen_sunxi_sdcard_img.sh $@ \
  20. $@.boot \
  21. $(IMAGE_ROOTFS) \
  22. $(CONFIG_SUNXI_SD_BOOT_PARTSIZE) \
  23. $(CONFIG_TARGET_ROOTFS_PARTSIZE) \
  24. $(STAGING_DIR_IMAGE)/$(DEVICE_NAME)-u-boot-with-spl.bin
  25. rm -f $@.boot
  26. endef
  27. # why \x00\x00\x00\x00 for zImage-initramfs
  28. define Device/Default
  29. PROFILES := Default
  30. DEVICE_VARS := SUNXI_DTS SUNXI_UBOOT
  31. KERNEL_NAME := zImage
  32. KERNEL := kernel-bin | uImage none
  33. IMAGES := sdcard.img.gz
  34. IMAGE/sdcard.img.gz := sunxi-sdcard | append-metadata | gzip
  35. endef
  36. include cortex-a7.mk
  37. include cortex-a8.mk
  38. include cortex-a53.mk
  39. $(eval $(call BuildImage))