public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: Andrew Ammerlaan <andrewammerlaan@gentoo.org>
To: gentoo-dev@lists.gentoo.org
Subject: [gentoo-dev] [PATCH 5/5]: kernel-build.eclass: require modules-sign if secureboot
Date: Fri, 14 Jul 2023 10:45:04 +0200	[thread overview]
Message-ID: <651892cc-af57-f9a7-a0ee-050a71d933b7@gentoo.org> (raw)

 From d528f87cb015cc60ef6f702d02d20b4f1fc42e74 Mon Sep 17 00:00:00 2001
From: Andrew Ammerlaan <andrewammerlaan@gentoo.org>
Date: Thu, 13 Jul 2023 09:55:32 +0200
Subject: [PATCH 05/13] kernel-build.eclass: require modules-sign if 
secureboot

Signed-off-by: Andrew Ammerlaan <andrewammerlaan@gentoo.org>
---
  eclass/kernel-build.eclass | 18 +++++++++++++++++-
  1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/eclass/kernel-build.eclass b/eclass/kernel-build.eclass
index 0c8eaf3c1cd5..c9f18a1f0c4f 100644
--- a/eclass/kernel-build.eclass
+++ b/eclass/kernel-build.eclass
@@ -29,6 +29,11 @@ if [[ ! ${_KERNEL_BUILD_ECLASS} ]]; then
  _KERNEL_BUILD_ECLASS=1

  PYTHON_COMPAT=( python3_{10..12} )
+if [[ ${KERNEL_IUSE_MODULES_SIGN} ]]; then
+	# If we have enabled module signing IUSE
+	# then we can also enable secureboot IUSE
+	KERNEL_IUSE_SECUREBOOT=1
+fi

  inherit multiprocessing python-any-r1 savedconfig toolchain-funcs 
kernel-install

@@ -86,8 +91,19 @@ IUSE="+strip"

  if [[ ${KERNEL_IUSE_MODULES_SIGN} ]]; then
  	IUSE+=" modules-sign"
+	REQUIRED_USE="secureboot? ( modules-sign )"
  fi

+# @FUNCTION: kernel-build_pkg_setup
+# @DESCRIPTION:
+# Call python-any-r1 and secureboot pkg_setup
+kernel-build_pkg_setup() {
+	python-any-r1_pkg_setup
+	if [[ ${KERNEL_IUSE_MODULES_SIGN} ]]; then
+		secureboot_pkg_setup
+	fi
+}
+
  # @FUNCTION: kernel-build_src_configure
  # @DESCRIPTION:
  # Prepare the toolchain for building the kernel, get the default .config
@@ -395,4 +411,4 @@ kernel-build_merge_configs() {

  fi

-EXPORT_FUNCTIONS src_configure src_compile src_test src_install 
pkg_postinst
+EXPORT_FUNCTIONS src_configure src_compile src_test src_install 
pkg_postinst pkg_setup
-- 
2.41.0



                 reply	other threads:[~2023-07-14  8:45 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=651892cc-af57-f9a7-a0ee-050a71d933b7@gentoo.org \
    --to=andrewammerlaan@gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /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