Initial commit
Some checks failed
Build Kernel / Build all affected Kernels (push) Has been cancelled
Build all core packages / Build all core packages for selected target (push) Has been cancelled
Build and Push prebuilt tools container / Build and Push all prebuilt containers (push) Has been cancelled
Build Toolchains / Build Toolchains for each target (push) Has been cancelled
Build host tools / Build host tools for linux and macos based systems (push) Has been cancelled
Coverity scan build / Coverity x86/64 build (push) Has been cancelled
Some checks failed
Build Kernel / Build all affected Kernels (push) Has been cancelled
Build all core packages / Build all core packages for selected target (push) Has been cancelled
Build and Push prebuilt tools container / Build and Push all prebuilt containers (push) Has been cancelled
Build Toolchains / Build Toolchains for each target (push) Has been cancelled
Build host tools / Build host tools for linux and macos based systems (push) Has been cancelled
Coverity scan build / Coverity x86/64 build (push) Has been cancelled
This commit is contained in:
78
target/linux/zynq/image/Makefile
Normal file
78
target/linux/zynq/image/Makefile
Normal file
@@ -0,0 +1,78 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
#
|
||||
# Copyright (C) 2015 OpenWrt.org
|
||||
|
||||
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
|
||||
DEVICE_DTS := $(lastword $(subst _, ,$(1)))
|
||||
KERNEL_DEPENDS = $$(wildcard $(DTS_DIR)/$$(DEVICE_DTS).dts)
|
||||
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/avnet_zynq-zed
|
||||
$(call Device/FitImageGzip)
|
||||
DEVICE_VENDOR := Avnet
|
||||
DEVICE_MODEL := ZedBoard
|
||||
endef
|
||||
TARGET_DEVICES += avnet_zynq-zed
|
||||
|
||||
define Device/digilent_zynq-zybo
|
||||
$(call Device/FitImageGzip)
|
||||
DEVICE_VENDOR := Digilent
|
||||
DEVICE_MODEL := Zybo
|
||||
endef
|
||||
TARGET_DEVICES += digilent_zynq-zybo
|
||||
|
||||
define Device/digilent_zynq-zybo-z7
|
||||
$(call Device/FitImageGzip)
|
||||
DEVICE_VENDOR := Digilent
|
||||
DEVICE_MODEL := Zybo Z7
|
||||
endef
|
||||
TARGET_DEVICES += digilent_zynq-zybo-z7
|
||||
|
||||
define Device/xlnx_zynq-zc702
|
||||
$(call Device/FitImageGzip)
|
||||
DEVICE_VENDOR := Xilinx
|
||||
DEVICE_MODEL := ZC702
|
||||
DEVICE_PACKAGES:=kmod-can kmod-can-xilinx-can
|
||||
endef
|
||||
TARGET_DEVICES += xlnx_zynq-zc702
|
||||
|
||||
$(eval $(call BuildImage))
|
||||
26
target/linux/zynq/image/gen_zynq_sdcard_img.sh
Executable file
26
target/linux/zynq/image/gen_zynq_sdcard_img.sh
Executable file
@@ -0,0 +1,26 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -ex
|
||||
[ $# -eq 5 ] || {
|
||||
echo "SYNTAX: $0 <file> <bootfs image> <rootfs image> <bootfs size> <rootfs size>"
|
||||
exit 1
|
||||
}
|
||||
|
||||
OUTPUT="$1"
|
||||
BOOTFS="$2"
|
||||
ROOTFS="$3"
|
||||
BOOTFSSIZE="$4"
|
||||
ROOTFSSIZE="$5"
|
||||
|
||||
head=4
|
||||
sect=63
|
||||
|
||||
set $(ptgen -o $OUTPUT -h $head -s $sect -l 1024 -t c -p ${BOOTFSSIZE}M -t 83 -p ${ROOTFSSIZE}M)
|
||||
|
||||
BOOTOFFSET="$(($1 / 512))"
|
||||
BOOTSIZE="$(($2 / 512))"
|
||||
ROOTFSOFFSET="$(($3 / 512))"
|
||||
ROOTFSSIZE="$(($4 / 512))"
|
||||
|
||||
dd bs=512 if="$BOOTFS" of="$OUTPUT" seek="$BOOTOFFSET" conv=notrunc
|
||||
dd bs=512 if="$ROOTFS" of="$OUTPUT" seek="$ROOTFSOFFSET" conv=notrunc
|
||||
Reference in New Issue
Block a user