From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Tue, 12 Sep 2023 18:58:15 +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 1qg6iO-00CrhU-DE for lore@lore.pengutronix.de; Tue, 12 Sep 2023 18:58:15 +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 1qg6iM-0004ne-U0; Tue, 12 Sep 2023 18:58:14 +0200 Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qg6iA-0004df-OR; Tue, 12 Sep 2023 18:58:02 +0200 Received: from [2a0a:edc0:0:1101:1d::ac] (helo=dude04.red.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1qg6iA-005oqZ-C9; Tue, 12 Sep 2023 18:58:02 +0200 Received: from rhi by dude04.red.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1qg6i9-00EeVh-2m; Tue, 12 Sep 2023 18:58:01 +0200 From: Roland Hieber To: ptxdist@pengutronix.de Date: Tue, 12 Sep 2023 18:57:58 +0200 Message-Id: <20230912165759.3492269-2-rhi@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230912165759.3492269-1-rhi@pengutronix.de> References: <20230912165759.3492269-1-rhi@pengutronix.de> MIME-Version: 1.0 Mail-Followup-To: Roland Hieber , ptxdist@pengutronix.de Content-Transfer-Encoding: 8bit Subject: [ptxdist] [PATCH v3 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 Cc: Roland Hieber 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 Signed-off-by: Roland Hieber --- PATCH v3: * select kernel and initrd image by default instead of TODO comments * select HOST_U_BOOT_TOOLS for mkimage (previously a fixup patch) PATCH v2: https://lore.ptxdist.org/ptxdist/20230831104425.2874985-2-rhi@pengutronix.de * no change PATCH v1: https://lore.ptxdist.org/ptxdist/20230822121234.2040303-2-rhi@pengutronix.de --- rules/templates/template-image-fit-in | 10 ++++++++ rules/templates/template-image-fit-make | 34 +++++++++++++++++++++++++ scripts/lib/ptxd_lib_template.sh | 25 ++++++++++++++++++ 3 files changed, 69 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..1a89153fc185 --- /dev/null +++ b/rules/templates/template-image-fit-in @@ -0,0 +1,10 @@ +## SECTION=image + +config IMAGE_@PACKAGE@ + tristate + select HOST_U_BOOT_TOOLS + @select_CODE_SIGNING@select IMAGE_KERNEL + select IMAGE_ROOT_CPIO + 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..cd57d24df76c --- /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 := ${PTXCONF_PROJECT_VERSION} +IMAGE_@PACKAGE@_KERNEL = $(IMAGE_KERNEL_IMAGE) +IMAGE_@PACKAGE@_DTB = # TODO: $(IMAGEDIR)/your-board.dtb +IMAGE_@PACKAGE@_INITRAMFS = $(IMAGE_ROOT_CPIO_IMAGE) +@CODE_SIGNING_VARS@ +# ---------------------------------------------------------------------------- +# Image +# ---------------------------------------------------------------------------- + +$(IMAGE_@PACKAGE@_IMAGE): $(IMAGE_@PACKAGE@_KERNEL) $(IMAGE_@PACKAGE@_INITRAMFS) $(IMAGE_@PACKAGE@_DTB) + @$(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 +" + ;; + *) + 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