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
|
|
|
|
2020-03-10 06:41:09 +00:00
|
|
|
DEVICE_VARS := SUNXI_DTS SUNXI_DTS_DIR
|
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
|
|
|
|
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
|
2019-12-05 23:47:18 +00:00
|
|
|
SUNXI_DTS_DIR :=
|
2019-12-20 00:18:44 +00:00
|
|
|
SUNXI_DTS = $$(SUNXI_DTS_DIR)$$(SOC)-$(lastword $(subst _, ,$(1)))
|
2014-09-14 13:47:42 +00:00
|
|
|
endef
|
|
|
|
|
2020-06-07 11:11:15 +00:00
|
|
|
include $(SUBTARGET).mk
|
2017-01-04 14:19:27 +00:00
|
|
|
|
2013-11-05 08:00:34 +00:00
|
|
|
$(eval $(call BuildImage))
|