[Buildroot] [PATCH v1 1/1] configs/zynq_qmtech_defconfig: move post-image.sh to board/qmtech/zynq

Arnout Vandecappelle arnout at mind.be
Mon Apr 4 17:58:36 UTC 2022



On 31/03/2022 21:20, Neal Frager via buildroot wrote:
> This patch creates a post-image.sh in the board/qmtech/zynq
> directory, so that the zynq_qmtech_defconfig can be updated
> independently from the other zynq defconfigs.

  Since you're not actually making any change that makes a difference between 
the qmtech and other zynq boards, I don't see the point. In the other mail you 
mention something like "because the device tree is not in mainline", but that 
doesn't really change anything, does it? Other then maybe the device tree having 
a different name, but that's already handled by the script.

  Instead of forking, it would be preferable to still use the same script and 
genimage but just make it configurable.

  That said, making things configurable may also unnecessarily complicate 
things. It's a difficult balance to make. And impossible for me to evaluate 
without seeing what changes need to be made to the other zynq scripts.

  So, for now I've marked it as Rejected. Feel free to re-post as part of a 
series that also updates the zynq defconfigs, or replace it with a patch that 
makes board/zynq/genimage.cfg configurable in the way it needs to be.

  Regards,
  Arnout


> 
> Signed-off-by: Neal Frager <neal.frager at amd.com>
> ---
>   board/qmtech/zynq/genimage.cfg  | 27 +++++++++++++++++++++++++++
>   board/qmtech/zynq/post-image.sh | 13 +++++++++++++
>   configs/zynq_qmtech_defconfig   |  2 +-
>   3 files changed, 41 insertions(+), 1 deletion(-)
>   create mode 100644 board/qmtech/zynq/genimage.cfg
>   create mode 100755 board/qmtech/zynq/post-image.sh
> 
> diff --git a/board/qmtech/zynq/genimage.cfg b/board/qmtech/zynq/genimage.cfg
> new file mode 100644
> index 0000000000..67baca795e
> --- /dev/null
> +++ b/board/qmtech/zynq/genimage.cfg
> @@ -0,0 +1,27 @@
> +image boot.vfat {
> +	vfat {
> +		files = {
> +			"boot.bin",
> +			"u-boot.img",
> +			"devicetree.dtb",
> +			"uImage"
> +		}
> +
> +		file uramdisk.image.gz {
> +			image = "rootfs.cpio.uboot"
> +		}
> +	}
> +
> +	size = 32M
> +}
> +
> +image sdcard.img {
> +	hdimage {
> +	}
> +
> +	partition boot {
> +		partition-type = 0xC
> +		bootable = "true"
> +		image = "boot.vfat"
> +	}
> +}
> diff --git a/board/qmtech/zynq/post-image.sh b/board/qmtech/zynq/post-image.sh
> new file mode 100755
> index 0000000000..54c5493b4e
> --- /dev/null
> +++ b/board/qmtech/zynq/post-image.sh
> @@ -0,0 +1,13 @@
> +#!/bin/sh
> +
> +# By default U-Boot loads DTB from a file named "devicetree.dtb", so
> +# let's use a symlink with that name that points to the *first*
> +# devicetree listed in the config.
> +
> +FIRST_DT=$(sed -n \
> +           's/^BR2_LINUX_KERNEL_INTREE_DTS_NAME="\([a-z0-9\-]*\).*"$/\1/p' \
> +           ${BR2_CONFIG})
> +
> +[ -z "${FIRST_DT}" ] || ln -fs ${FIRST_DT}.dtb ${BINARIES_DIR}/devicetree.dtb
> +
> +support/scripts/genimage.sh -c board/qmtech/zynq/genimage.cfg
> diff --git a/configs/zynq_qmtech_defconfig b/configs/zynq_qmtech_defconfig
> index 4db3f68b1f..dc3b22c876 100644
> --- a/configs/zynq_qmtech_defconfig
> +++ b/configs/zynq_qmtech_defconfig
> @@ -5,7 +5,7 @@ BR2_ARM_ENABLE_VFP=y
>   BR2_GLOBAL_PATCH_DIR="board/qmtech/zynq/patches"
>   BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_19=y
>   BR2_TARGET_GENERIC_GETTY_PORT="ttyPS0"
> -BR2_ROOTFS_POST_IMAGE_SCRIPT="board/zynq/post-image.sh"
> +BR2_ROOTFS_POST_IMAGE_SCRIPT="board/qmtech/zynq/post-image.sh"
>   BR2_LINUX_KERNEL=y
>   BR2_LINUX_KERNEL_CUSTOM_TARBALL=y
>   BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="$(call github,Xilinx,linux-xlnx,xilinx-v2019.2.01)/linux-xilinx-v2019.2.01.tar.gz"



More information about the buildroot mailing list