diff options
author | Michał Górny <mgorny@gentoo.org> | 2024-08-21 17:22:42 +0200 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2024-08-23 21:25:40 +0200 |
commit | 74140c80f76f27c6f3a67103914498f33a0da8ae (patch) | |
tree | b07b85515c5a20a0f41c11259549f500e93dfe7e /eclass | |
parent | kernel-build.eclass: Apply savedconfig on top of merged configs (diff) | |
download | gentoo-74140c80f76f27c6f3a67103914498f33a0da8ae.tar.gz gentoo-74140c80f76f27c6f3a67103914498f33a0da8ae.tar.bz2 gentoo-74140c80f76f27c6f3a67103914498f33a0da8ae.zip |
kernel-build.eclass: Merge two ifs in kernel-build_merge_configs()
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'eclass')
-rw-r--r-- | eclass/kernel-build.eclass | 44 |
1 files changed, 21 insertions, 23 deletions
diff --git a/eclass/kernel-build.eclass b/eclass/kernel-build.eclass index 1eac9433b65c..6406f5b3c0f3 100644 --- a/eclass/kernel-build.eclass +++ b/eclass/kernel-build.eclass @@ -616,30 +616,28 @@ kernel-build_merge_configs() { local merge_configs=( "${@}" ) - if [[ ${KERNEL_IUSE_MODULES_SIGN} ]]; then - if use modules-sign; then - : "${MODULES_SIGN_HASH:=sha512}" - cat <<-EOF > "${WORKDIR}/modules-sign.config" || die - ## Enable module signing - CONFIG_MODULE_SIG=y - CONFIG_MODULE_SIG_ALL=y - CONFIG_MODULE_SIG_FORCE=y - CONFIG_MODULE_SIG_${MODULES_SIGN_HASH^^}=y - EOF - if [[ -n ${MODULES_SIGN_KEY_CONTENTS} ]]; then - (umask 066 && touch "${T}/kernel_key.pem" || die) - echo "${MODULES_SIGN_KEY_CONTENTS}" > "${T}/kernel_key.pem" || die - unset MODULES_SIGN_KEY_CONTENTS - export MODULES_SIGN_KEY="${T}/kernel_key.pem" - fi - if [[ ${MODULES_SIGN_KEY} == pkcs11:* || -r ${MODULES_SIGN_KEY} ]]; then - echo "CONFIG_MODULE_SIG_KEY=\"${MODULES_SIGN_KEY}\"" \ - >> "${WORKDIR}/modules-sign-key.config" - elif [[ -n ${MODULES_SIGN_KEY} ]]; then - die "MODULES_SIGN_KEY=${MODULES_SIGN_KEY} not found or not readable!" - fi - merge_configs+=( "${WORKDIR}/modules-sign.config" ) + if [[ ${KERNEL_IUSE_MODULES_SIGN} ]] && use modules-sign; then + : "${MODULES_SIGN_HASH:=sha512}" + cat <<-EOF > "${WORKDIR}/modules-sign.config" || die + ## Enable module signing + CONFIG_MODULE_SIG=y + CONFIG_MODULE_SIG_ALL=y + CONFIG_MODULE_SIG_FORCE=y + CONFIG_MODULE_SIG_${MODULES_SIGN_HASH^^}=y + EOF + if [[ -n ${MODULES_SIGN_KEY_CONTENTS} ]]; then + (umask 066 && touch "${T}/kernel_key.pem" || die) + echo "${MODULES_SIGN_KEY_CONTENTS}" > "${T}/kernel_key.pem" || die + unset MODULES_SIGN_KEY_CONTENTS + export MODULES_SIGN_KEY="${T}/kernel_key.pem" + fi + if [[ ${MODULES_SIGN_KEY} == pkcs11:* || -r ${MODULES_SIGN_KEY} ]]; then + echo "CONFIG_MODULE_SIG_KEY=\"${MODULES_SIGN_KEY}\"" \ + >> "${WORKDIR}/modules-sign-key.config" + elif [[ -n ${MODULES_SIGN_KEY} ]]; then + die "MODULES_SIGN_KEY=${MODULES_SIGN_KEY} not found or not readable!" fi + merge_configs+=( "${WORKDIR}/modules-sign.config" ) fi # Only semi-related but let's use that to avoid changing stable ebuilds. |