2013-11-05 08:00:34 +00:00
|
|
|
#
|
2016-02-02 22:25:05 +00:00
|
|
|
# Copyright (C) 2013-2016 OpenWrt.org
|
2017-01-04 14:19:27 +00:00
|
|
|
# Copyright (C) 2016 Yousong Zhou
|
2013-11-05 08:00:34 +00:00
|
|
|
#
|
|
|
|
# This is free software, licensed under the GNU General Public License v2.
|
|
|
|
# See /LICENSE for more information.
|
|
|
|
#
|
|
|
|
include $(TOPDIR)/rules.mk
|
|
|
|
include $(INCLUDE_DIR)/image.mk
|
2014-09-14 13:47:42 +00:00
|
|
|
|
|
|
|
FAT32_BLOCK_SIZE=1024
|
|
|
|
FAT32_BLOCKS=$(shell echo $$(($(CONFIG_SUNXI_SD_BOOT_PARTSIZE)*1024*1024/$(FAT32_BLOCK_SIZE))))
|
2013-11-05 08:00:34 +00:00
|
|
|
|
2017-01-04 14:19:27 +00:00
|
|
|
KERNEL_LOADADDR:=0x40008000
|
|
|
|
|
|
|
|
define Build/sunxi-sdcard
|
|
|
|
rm -f $@.boot
|
|
|
|
mkfs.fat $@.boot -C $(FAT32_BLOCKS)
|
|
|
|
|
2017-01-27 15:18:05 +00:00
|
|
|
mcopy -i $@.boot $(STAGING_DIR_IMAGE)/$(DEVICE_NAME)-boot.scr ::boot.scr
|
2017-01-04 14:19:27 +00:00
|
|
|
mcopy -i $@.boot $(DTS_DIR)/$(SUNXI_DTS).dtb ::dtb
|
|
|
|
mcopy -i $@.boot $(IMAGE_KERNEL) ::uImage
|
|
|
|
./gen_sunxi_sdcard_img.sh $@ \
|
|
|
|
$@.boot \
|
|
|
|
$(IMAGE_ROOTFS) \
|
2014-09-14 13:47:42 +00:00
|
|
|
$(CONFIG_SUNXI_SD_BOOT_PARTSIZE) \
|
|
|
|
$(CONFIG_TARGET_ROOTFS_PARTSIZE) \
|
2017-01-27 15:18:05 +00:00
|
|
|
$(STAGING_DIR_IMAGE)/$(DEVICE_NAME)-u-boot-with-spl.bin
|
2017-01-04 14:19:27 +00:00
|
|
|
rm -f $@.boot
|
2014-09-14 13:47:42 +00:00
|
|
|
endef
|
|
|
|
|
2017-01-04 14:19:27 +00:00
|
|
|
# why \x00\x00\x00\x00 for zImage-initramfs
|
|
|
|
define Device/Default
|
|
|
|
PROFILES := Default
|
|
|
|
DEVICE_VARS := SUNXI_DTS SUNXI_UBOOT
|
|
|
|
KERNEL_NAME := zImage
|
|
|
|
KERNEL := kernel-bin | uImage none
|
|
|
|
IMAGES := sdcard.img.gz
|
2017-01-04 14:19:30 +00:00
|
|
|
IMAGE/sdcard.img.gz := sunxi-sdcard | append-metadata | gzip
|
2014-09-14 13:47:42 +00:00
|
|
|
endef
|
|
|
|
|
2017-07-15 18:35:57 +00:00
|
|
|
include cortex-a7.mk
|
|
|
|
include cortex-a8.mk
|
2017-07-15 20:53:20 +00:00
|
|
|
include cortex-a53.mk
|
2017-01-04 14:19:27 +00:00
|
|
|
|
2013-11-05 08:00:34 +00:00
|
|
|
$(eval $(call BuildImage))
|