mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: Roland Hieber <rhi@pengutronix.de>
To: ptxdist@pengutronix.de
Cc: Roland Hieber <rhi@pengutronix.de>
Subject: [ptxdist] [PATCH v3 2/3] templates: add template for custom FIT images
Date: Tue, 12 Sep 2023 18:57:58 +0200	[thread overview]
Message-ID: <20230912165759.3492269-2-rhi@pengutronix.de> (raw)
In-Reply-To: <20230912165759.3492269-1-rhi@pengutronix.de>

Signed-off-by: Roland Hieber <rhi@pengutronix.de>
---
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




  reply	other threads:[~2023-09-12 16:58 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-12 16:57 [ptxdist] [PATCH v3 1/3] kernel: add make target for the installed device trees Roland Hieber
2023-09-12 16:57 ` Roland Hieber [this message]
2023-09-24  5:44   ` [ptxdist] [APPLIED] templates: add template for custom FIT images Michael Olbrich
2023-09-12 16:57 ` [ptxdist] [PATCH v3 3/3] doc: ref_make_macros: document world/image-fit macro Roland Hieber
2023-09-24  5:44   ` [ptxdist] [APPLIED] " Michael Olbrich
2023-09-24  5:44 ` [ptxdist] [APPLIED] kernel: add make target for the installed device trees Michael Olbrich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230912165759.3492269-2-rhi@pengutronix.de \
    --to=rhi@pengutronix.de \
    --cc=ptxdist@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox