From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 6A509158170 for ; Sun, 21 Jul 2024 15:45:35 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id A097DE29F6; Sun, 21 Jul 2024 15:45:34 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 6C7FDE29F6 for ; Sun, 21 Jul 2024 15:45:34 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 6D80C33DF47 for ; Sun, 21 Jul 2024 15:45:33 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id CF992B82 for ; Sun, 21 Jul 2024 15:45:31 +0000 (UTC) From: "Andrew Ammerlaan" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Andrew Ammerlaan" Message-ID: <1721576723.fa77d52a7ff39464c50707ca024725deab08b534.andrewammerlaan@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: eclass/ X-VCS-Repository: repo/gentoo X-VCS-Files: eclass/kernel-build.eclass X-VCS-Directories: eclass/ X-VCS-Committer: andrewammerlaan X-VCS-Committer-Name: Andrew Ammerlaan X-VCS-Revision: fa77d52a7ff39464c50707ca024725deab08b534 X-VCS-Branch: master Date: Sun, 21 Jul 2024 15:45:31 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: fec688ae-54ba-4830-98bc-6751ed43811e X-Archives-Hash: 9c9c98dbd6dcd1232d8e2d9a8367c7fd commit: fa77d52a7ff39464c50707ca024725deab08b534 Author: Andrew Ammerlaan gentoo org> AuthorDate: Sun Jul 21 15:44:32 2024 +0000 Commit: Andrew Ammerlaan gentoo org> CommitDate: Sun Jul 21 15:45:23 2024 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fa77d52a kernel-build.eclass: support unset MODULES_SIGN_{CERT,KEY} the kernel build system generates a key if not set, so don't check anything if the key is unset Signed-off-by: Andrew Ammerlaan gentoo.org> eclass/kernel-build.eclass | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eclass/kernel-build.eclass b/eclass/kernel-build.eclass index cbc80bddf6f7..be0256c21102 100644 --- a/eclass/kernel-build.eclass +++ b/eclass/kernel-build.eclass @@ -134,7 +134,7 @@ kernel-build_pkg_setup() { if [[ ${KERNEL_IUSE_MODULES_SIGN} && ${MERGE_TYPE} != binary ]]; then secureboot_pkg_setup - if use modules-sign; then + if use modules-sign && [[ -n ${MODULES_SIGN_KEY} ]]; then # Sanity check: fail early if key/cert in DER format or does not exist local openssl_args=( -noout -nocert @@ -155,7 +155,7 @@ kernel-build_pkg_setup() { die "Kernel module signing certificate or key not found or not PEM format." if [[ ${MODULES_SIGN_KEY} != pkcs11:* ]]; then - if [[ ${MODULES_SIGN_CERT} != ${MODULES_SIGN_KEY} ]]; then + if [[ -n ${MODULES_SIGN_CERT} && ${MODULES_SIGN_CERT} != ${MODULES_SIGN_KEY} ]]; then MODULES_SIGN_KEY_CONTENTS="$(cat "${MODULES_SIGN_CERT}" "${MODULES_SIGN_KEY}" || die)" else MODULES_SIGN_KEY_CONTENTS="$(< "${MODULES_SIGN_KEY}")"