eclass/secureboot: Sync with Gentoo

It's from Gentoo commit c8af7eb1285a2683460618b71e2e9a14ca6badcd.
This commit is contained in:
Flatcar Buildbot 2024-10-21 07:07:16 +00:00
parent 59c37162f8
commit d9598dfbe1

View File

@ -74,7 +74,7 @@ _SECUREBOOT_ECLASS=1
# If USE=secureboot is enabled die if the required user variables are unset # If USE=secureboot is enabled die if the required user variables are unset
# and die if the keys can't be found. # and die if the keys can't be found.
_secureboot_die_if_unset() { _secureboot_die_if_unset() {
debug-print-function ${FUNCNAME[0]} "${@}" debug-print-function ${FUNCNAME} "$@"
use secureboot || return use secureboot || return
if [[ -z ${SECUREBOOT_SIGN_KEY} || -z ${SECUREBOOT_SIGN_CERT} ]]; then if [[ -z ${SECUREBOOT_SIGN_KEY} || -z ${SECUREBOOT_SIGN_CERT} ]]; then
@ -99,7 +99,7 @@ _secureboot_die_if_unset() {
# @DESCRIPTION: # @DESCRIPTION:
# Checks if required user variables are set before starting the build # Checks if required user variables are set before starting the build
secureboot_pkg_setup() { secureboot_pkg_setup() {
debug-print-function ${FUNCNAME[0]} "${@}" debug-print-function ${FUNCNAME} "$@"
use secureboot || return use secureboot || return
# If we are merging a binary then the files in this binary # If we are merging a binary then the files in this binary
@ -117,7 +117,7 @@ secureboot_pkg_setup() {
# If no output file is specified the output file will be the same # If no output file is specified the output file will be the same
# as the input file, i.e. the file will be overwritten. # as the input file, i.e. the file will be overwritten.
secureboot_sign_efi_file() { secureboot_sign_efi_file() {
debug-print-function ${FUNCNAME[0]} "${@}" debug-print-function ${FUNCNAME} "$@"
use secureboot || return use secureboot || return
local input_file=${1} local input_file=${1}
@ -153,7 +153,7 @@ secureboot_sign_efi_file() {
# By default signed files gain the .signed suffix. If the --in-place # By default signed files gain the .signed suffix. If the --in-place
# argument is given the efi files are replaced with a signed version in place. # argument is given the efi files are replaced with a signed version in place.
secureboot_auto_sign() { secureboot_auto_sign() {
debug-print-function ${FUNCNAME[0]} "${@}" debug-print-function ${FUNCNAME} "$@"
use secureboot || return use secureboot || return
[[ ${EBUILD_PHASE} == install ]] || [[ ${EBUILD_PHASE} == install ]] ||