summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Ammerlaan <andrewammerlaan@gentoo.org>2023-08-27 18:24:08 +0200
committerAndrew Ammerlaan <andrewammerlaan@gentoo.org>2023-08-27 21:36:05 +0200
commitbc63496c267e26bb88db956fa818f4ec3775fac6 (patch)
tree97d814c21c5cbbc27d84c638efba03c8770aeae3 /eclass/secureboot.eclass
parentapp-emulation/vagrant: Keyword 2.3.7 arm64, #913117 (diff)
downloadgentoo-bc63496c267e26bb88db956fa818f4ec3775fac6.tar.gz
gentoo-bc63496c267e26bb88db956fa818f4ec3775fac6.tar.bz2
gentoo-bc63496c267e26bb88db956fa818f4ec3775fac6.zip
secureboot.eclass: secureboot_sign_efi_file allow call with 1 arg
Use the input file as the output file if it is not specified. Signed-off-by: Andrew Ammerlaan <andrewammerlaan@gentoo.org> sb-fix Signed-off-by: Andrew Ammerlaan <andrewammerlaan@gentoo.org>
Diffstat (limited to 'eclass/secureboot.eclass')
-rw-r--r--eclass/secureboot.eclass8
1 files changed, 5 insertions, 3 deletions
diff --git a/eclass/secureboot.eclass b/eclass/secureboot.eclass
index 383fe7cc3afa..a9ba514cb7a0 100644
--- a/eclass/secureboot.eclass
+++ b/eclass/secureboot.eclass
@@ -98,16 +98,18 @@ secureboot_pkg_setup() {
}
# @FUNCTION: secureboot_sign_efi_file
-# @USAGE: <input file> <output file>
+# @USAGE: <input file> [<output file>]
# @DESCRIPTION:
# Sign a file using sbsign and the requested key/certificate.
-# If the file is already signed with our key then skip.
+# If the file is already signed with our key then the file is skipped.
+# If no output file is specified the output file will be the same
+# as the input file, i.e. the file will be overwritten.
secureboot_sign_efi_file() {
debug-print-function ${FUNCNAME[0]} "${@}"
use secureboot || return
local input_file=${1}
- local output_file=${2}
+ local output_file=${2:-${1}}
_secureboot_die_if_unset