openwrtv4/target/linux/zynq/image/Makefile
Luis Araneda 412763c812 zynq: add sdcard image support
Implement the generation of sdcard images with ext4 or
squashfs + f2fs overlay, but only enable the latter
automatically

Additionally, add mkf2fs and e2fsprogs to default packages
to manipulate ext4 and f2fs filesystems

Finally, disable the automatic generation of initramfs
and rootfs.tar.gz images, as they are no longer required
(they can still be selected in menuconfig)

Signed-off-by: Luis Araneda <luaraneda@gmail.com>
2018-09-10 08:55:39 +02:00

80 lines
2.2 KiB
Makefile

#
# Copyright (C) 2015 OpenWrt.org
#
# 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
FAT32_BLOCK_SIZE=1024
FAT32_BLOCKS=$(shell echo $$(($(CONFIG_TARGET_KERNEL_PARTSIZE)*1024*1024/$(FAT32_BLOCK_SIZE))))
define Build/zynq-sdcard
rm -f $@.boot
mkfs.fat $@.boot -C $(FAT32_BLOCKS)
mcopy -i $@.boot $(STAGING_DIR_IMAGE)/$(DEVICE_NAME)-boot.bin ::boot.bin
mcopy -i $@.boot $(STAGING_DIR_IMAGE)/$(DEVICE_NAME)-u-boot.img ::u-boot.img
mcopy -i $@.boot $(STAGING_DIR_IMAGE)/$(DEVICE_NAME)-uEnv.txt ::uEnv.txt
mcopy -i $@.boot $(IMAGE_KERNEL) ::fit.itb
./gen_zynq_sdcard_img.sh $@ \
$@.boot \
$(IMAGE_ROOTFS) \
$(CONFIG_TARGET_KERNEL_PARTSIZE) \
$(CONFIG_TARGET_ROOTFS_PARTSIZE)
rm -f $@.boot
endef
#################################################
# Default and templates
#################################################
define Device/Default
PROFILES := Default
KERNEL_DEPENDS = $$(wildcard $(DTS_DIR)/$$(DEVICE_DTS).dts)
KERNEL_INITRAMFS_PREFIX := $$(IMG_PREFIX)-$(1)-initramfs
KERNEL_PREFIX := $$(IMAGE_PREFIX)
KERNEL_LOADADDR := 0x8000
IMAGES := sdcard.img.gz
IMAGE/sdcard.img.gz := zynq-sdcard | gzip
endef
define Device/FitImageGzip
KERNEL_SUFFIX := -fit-uImage.itb
KERNEL = kernel-bin | gzip | fit gzip $$(DTS_DIR)/$$(DEVICE_DTS).dtb
KERNEL_NAME := Image
endef
#################################################
# Devices
#################################################
define Device/digilent_zynq-zybo
$(call Device/FitImageGzip)
DEVICE_TITLE := ZYBO Development Board
DEVICE_DTS := zynq-zybo
endef
TARGET_DEVICES += digilent_zynq-zybo
define Device/digilent_zynq-zybo-z7
$(call Device/FitImageGzip)
DEVICE_TITLE := Digilent Zybo Z7 board
DEVICE_DTS := zynq-zybo-z7
endef
TARGET_DEVICES += digilent_zynq-zybo-z7
define Device/xlnx_zynq-zc702
$(call Device/FitImageGzip)
DEVICE_TITLE := ZC702 Development Board
DEVICE_DTS := zynq-zc702
endef
TARGET_DEVICES += xlnx_zynq-zc702
define Device/xlnx_zynq-zed
$(call Device/FitImageGzip)
DEVICE_TITLE := Zed Development Board
DEVICE_DTS := zynq-zed
endef
TARGET_DEVICES += xlnx_zynq-zed
$(eval $(call BuildImage))