kernel-build.eclass: disable MOD_SIG if no USE modules-sign

Add an else statement to remove Debian's on by default module signing.

Co-authored-by: Nowa Ammerlaan <nowa@gentoo.org>
Signed-off-by: Ian Jordan <immoloism@gmail.com>
Signed-off-by: Nowa Ammerlaan <nowa@gentoo.org>
Part-of: https://codeberg.org/gentoo/gentoo/pulls/1129
This commit is contained in:
Ian Jordan
2026-06-11 17:59:47 +02:00
committed by Nowa Ammerlaan
parent 755583f2e5
commit 2c3dfd3cb1

View File

@@ -106,6 +106,7 @@ REQUIRED_USE="secureboot? ( modules-sign )"
# Valid values: sha512,sha384,sha256,sha224,sha1
#
# Default if unset: sha512
: "${MODULES_SIGN_HASH:=sha512}"
# @ECLASS_VARIABLE: MODULES_SIGN_KEY
# @USER_VARIABLE
@@ -790,7 +791,6 @@ kernel-build_merge_configs() {
local merge_configs=( "${@}" )
if use modules-sign; then
: "${MODULES_SIGN_HASH:=sha512}"
cat <<-EOF > "${WORKDIR}/modules-sign.config" || die
## Enable module signing
CONFIG_MODULE_SIG=y
@@ -798,8 +798,16 @@ kernel-build_merge_configs() {
CONFIG_MODULE_SIG_FORCE=y
CONFIG_MODULE_SIG_${MODULES_SIGN_HASH^^}=y
EOF
merge_configs+=( "${WORKDIR}/modules-sign.config" )
else
cat <<-EOF > "${WORKDIR}/modules-sign.config" || die
## Disable module signing
# CONFIG_MODULE_SIG is not set
# CONFIG_MODULE_SIG_ALL is not set
# CONFIG_MODULE_SIG_FORCE is not set
# CONFIG_MODULE_SIG_KEY is not set
EOF
fi
merge_configs+=( "${WORKDIR}/modules-sign.config" )
# Only semi-related but let's use that to avoid changing stable ebuilds.
if [[ ${KERNEL_IUSE_GENERIC_UKI} ]]; then