[Buildroot] [PATCH 2/2] package/imx-cst: new package

Baruch Siach baruch at tkos.co.il
Wed Apr 20 17:28:06 UTC 2022


Hi Thomas,

On Wed, Apr 20 2022, Thomas Perrot via buildroot wrote:
> This package provides i.MX Code Signing Tools uses to sign i.MX bootloader
> to enable secure boot (HABv4 and AHAB).
>
> Signed-off-by: Thomas Perrot <thomas.perrot at bootlin.com>
> ---

[...]

> diff --git a/package/imx-cst/imx-cst.mk b/package/imx-cst/imx-cst.mk
> new file mode 100644
> index 000000000000..c91dfb602cbf
> --- /dev/null
> +++ b/package/imx-cst/imx-cst.mk
> @@ -0,0 +1,49 @@
> +################################################################################
> +#
> +# imx-cst
> +#
> +################################################################################
> +
> +# debian/3.3.1+dfsg-2
> +IMX_CST_SITE = https://gitlab.apertis.org/pkg/imx-code-signing-tool.git
> +IMX_CST_SITE_METHOD = git
> +IMX_CST_VERSION = e2c687a856e6670e753147aacef42d0a3c07891a
> +IMX_CST_LICENSE = BSD-3-Clause
> +IMX_CST_LICENSE_FILES = LICENSE.bsd3
> +
> +HOST_IMX_CST_DEPENDENCIES = host-byacc host-flex host-openssl
> +
> +ifneq ($(filter %64,$(HOSTARCH)),)
> +HOST_IMX_CST_OSTYPE = linux64
> +else
> +HOST_IMX_CST_OSTYPE = linux32
> +endif

It looks like the only difference between 64 and 32 is in openssl build
rule, and for x86 (host) targets only. We don't use this openssl rule
since we build host-openssl with our own rules. So maybe we can just
arbitrarily choose hard coded 'linux64'. It seems that debian/Makefile
does that.

baruch

> +
> +# We don't use HOST_CONFIGURE_OPTS when building cst, because we need
> +# to preserve the CFLAGS/LDFLAGS used by their Makefile.
> +define HOST_IMX_CST_BUILD_CMDS
> +	$(HOST_MAKE_ENV) $(MAKE) \
> +		OSTYPE=$(HOST_IMX_CST_OSTYPE) \
> +		ENCRYPTION=yes \
> +		AR="$(HOSTAR)" \
> +		CC="$(HOSTCC)" \
> +		LD="$(HOSTCC)" \
> +		OBJCOPY="$(HOSTOBJCOPY)" \
> +		RANLIB="$(HOSTRANLIB)" \
> +		EXTRACFLAGS="$(HOST_CFLAGS) $(HOST_CPPFLAGS)" \
> +		EXTRALDFLAGS="$(HOST_LDFLAGS)" \
> +		PWD=$(@D)/code/cst \
> +		-C $(@D)/code/cst \
> +		build
> +	$(HOST_MAKE_ENV) $(MAKE) $(HOST_CONFIGURE_OPTS) \
> +		COPTS="$(HOST_CFLAGS) $(HOST_CPPFLAGS) $(HOST_LDFLAGS)" \
> +		-C $(@D)/code/hab_csf_parser
> +endef
> +
> +define HOST_IMX_CST_INSTALL_CMDS
> +	$(INSTALL) -D -m 755 $(@D)/code/cst/code/obj.linux64/cst $(HOST_DIR)/bin/cst
> +	$(INSTALL) -D -m 755 $(@D)/code/cst/code/obj.linux64/srktool $(HOST_DIR)/bin/srktool
> +	$(INSTALL) -D -m 755 $(@D)/code/hab_csf_parser/csf_parser $(HOST_DIR)/bin/csf_parser
> +endef
> +
> +$(eval $(host-generic-package))


-- 
                                                     ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -



More information about the buildroot mailing list