From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Sat, 02 Sep 2023 12:42:32 +0200 Received: from metis.whiteo.stw.pengutronix.de ([2a0a:edc0:2:b01:1d::104]) by lore.white.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qcO5J-000xoq-Ce for lore@lore.pengutronix.de; Sat, 02 Sep 2023 12:42:32 +0200 Received: from localhost ([127.0.0.1] helo=metis.whiteo.stw.pengutronix.de) by metis.whiteo.stw.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1qc6yA-0001mu-1K; Fri, 01 Sep 2023 18:26:02 +0200 Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1qc4ks-0000nw-3H; Fri, 01 Sep 2023 16:04:10 +0200 Received: from [2a0a:edc0:0:1101:1d::54] (helo=dude05.red.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1qbxxR-0035rP-3E; Fri, 01 Sep 2023 08:48:41 +0200 Received: from mol by dude05.red.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1qbxxQ-008axe-2p; Fri, 01 Sep 2023 08:48:40 +0200 Date: Fri, 1 Sep 2023 08:48:40 +0200 From: Michael Olbrich To: Roland Hieber , ptxdist@pengutronix.de Message-ID: Mail-Followup-To: Roland Hieber , ptxdist@pengutronix.de References: <20230831104425.2874985-1-rhi@pengutronix.de> <20230831104425.2874985-2-rhi@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230831104425.2874985-2-rhi@pengutronix.de> X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-IRC: #ptxdist @freenode X-Accept-Language: de,en X-Accept-Content-Type: text/plain Subject: Re: [ptxdist] [PATCH v2 2/3] templates: add template for custom FIT images X-BeenThere: ptxdist@pengutronix.de X-Mailman-Version: 2.1.29 Precedence: list List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: ptxdist@pengutronix.de Sender: "ptxdist" X-SA-Exim-Connect-IP: 127.0.0.1 X-SA-Exim-Mail-From: ptxdist-bounces@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false On Thu, Aug 31, 2023 at 12:44:24PM +0200, Roland Hieber wrote: > Signed-off-by: Roland Hieber > > --- > PATCH v2: no change > PATCH v1: https://lore.ptxdist.org/ptxdist/20230822121234.2040303-2-rhi@pengutronix.de > --- > rules/templates/template-image-fit-in | 8 ++++++ > rules/templates/template-image-fit-make | 34 +++++++++++++++++++++++++ > scripts/lib/ptxd_lib_template.sh | 25 ++++++++++++++++++ > 3 files changed, 67 insertions(+) > create mode 100644 rules/templates/template-image-fit-in > create mode 100644 rules/templates/template-image-fit-make > > diff --git a/rules/templates/template-image-fit-in b/rules/templates/template-image-fit-in > new file mode 100644 > index 000000000000..ac5606dd0d89 > --- /dev/null > +++ b/rules/templates/template-image-fit-in > @@ -0,0 +1,8 @@ > +## SECTION=image > + > +config IMAGE_@PACKAGE@ > + tristate > + @select_CODE_SIGNING@# TODO: select kernel and initrd image Nobody ever replaces those comments with something useful. Just select the regular kernel here so we have a working default. > + prompt "Generate images/@package@.fit" > + help > + FIXME > diff --git a/rules/templates/template-image-fit-make b/rules/templates/template-image-fit-make > new file mode 100644 > index 000000000000..265b7e6350c7 > --- /dev/null > +++ b/rules/templates/template-image-fit-make > @@ -0,0 +1,34 @@ > +# -*-makefile-*- > +# > +# Copyright (C) @YEAR@ by @AUTHOR@ > +# > +# For further information about the PTXdist project and license conditions > +# see the README file. > +# > + > +# > +# We provide this package > +# > +IMAGE_PACKAGES-$(PTXCONF_IMAGE_@PACKAGE@) += image-@package@ > + > +# > +# Paths and names > +# > +IMAGE_@PACKAGE@ := image-@package@ > +IMAGE_@PACKAGE@_DIR := $(BUILDDIR)/$(IMAGE_@PACKAGE@) > +IMAGE_@PACKAGE@_IMAGE := $(IMAGEDIR)/@package@.fit > +IMAGE_@PACKAGE@_VERSION := > +IMAGE_@PACKAGE@_KERNEL = # TODO: $(IMAGEDIR)/linuximage IMAGE_@PACKAGE@_KERNEL = $(IMAGEDIR)/linuximage Note the space to align the '='. > +IMAGE_@PACKAGE@_DTB = # TODO: $(IMAGEDIR)/your-board.dtb IMAGE_@PACKAGE@_DTB = $(addprefix $(IMAGEDIR)/,$(KERNEL_DTB_FILES)) > +IMAGE_@PACKAGE@_INITRAMFS = # optional: $(IMAGEDIR)/your-initramfs # IMAGE_@PACKAGE@_INITRAMFS = $(IMAGEDIR)/your-initramfs I think. > +@CODE_SIGNING_VARS@ > +# ---------------------------------------------------------------------------- > +# Image > +# ---------------------------------------------------------------------------- > + > +$(IMAGE_@PACKAGE@_IMAGE): $(IMAGE_@PACKAGE@_KERNEL) $(IMAGE_@PACKAGE@_INITRAMFS) $(IMAGE_@PACKAGE@_DTB) No dependencies here. This should be covered by selecting the relevant packages. > + @$(call targetinfo) > + @$(call world/image-fit, IMAGE_@PACKAGE@) > + @$(call finish) > + > +# vim: syntax=make > diff --git a/scripts/lib/ptxd_lib_template.sh b/scripts/lib/ptxd_lib_template.sh > index 30cc48d6c9b0..f8f188e148ac 100644 > --- a/scripts/lib/ptxd_lib_template.sh > +++ b/scripts/lib/ptxd_lib_template.sh > @@ -598,6 +598,31 @@ export -f ptxd_template_new_image_tgz > ptxd_template_help_list[${#ptxd_template_help_list[@]}]="image-tgz" > ptxd_template_help_list[${#ptxd_template_help_list[@]}]="create package for a tgz image" > > +ptxd_template_new_image_fit() { > + export class="image-" > + ptxd_template_read_name && > + ptxd_template_read_author && > + ptxd_template_read "sign FIT image? (y/N)" SIGN > + case "$SIGN" in > + y*|Y*) > + export select_CODE_SIGNING="select CODE_SIGNING > + " > + export CODE_SIGNING_VARS=" > +IMAGE_@PACKAGE@_SIGN_ROLE := # TODO: role name of the code signing provider, passed to cs_get_uri > +IMAGE_@PACKAGE@_KEY_NAME_HINT := # TODO: key-name-hint property in the signature node of the FIT image Ask for the two while building the template. Maybe with a useful default? Michael > +" > + ;; > + *) > + export select_CODE_SIGNING="" > + export CODE_SIGNING_VARS="" > + ;; > + esac > + ptxd_template_write_platform_rules > +} > +export -f ptxd_template_new_image_fit > +ptxd_template_help_list[${#ptxd_template_help_list[@]}]="image-fit" > +ptxd_template_help_list[${#ptxd_template_help_list[@]}]="create package for a FIT image" > + > ptxd_template_new_image_genimage() { > export class="image-" > ptxd_template_read_name && > -- > 2.39.2 > > > -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |