[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gentoo-dev
Subject:    Re: [gentoo-dev] [PATCH 3/3 v2] secureboot.eclass: secureboot_sign_efi_file allow call with 1
From:       Andrew Ammerlaan <andrewammerlaan () gentoo ! org>
Date:       2023-08-27 19:35:08
Message-ID: 7ee95c49-0a3b-4d8b-a710-14b2a033fd76 () gentoo ! org
[Download RAW message or body]

 From efd3a440e652d96b7fadc56b171e14116be59768 Mon Sep 17 00:00:00 2001
From: Andrew Ammerlaan <andrewammerlaan@gentoo.org>
Date: Sun, 27 Aug 2023 18:24:08 +0200
Subject: [PATCH] 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>
---
  eclass/secureboot.eclass | 8 +++++---
  1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/eclass/secureboot.eclass b/eclass/secureboot.eclass
index 383fe7cc3afa0..a9ba514cb7a03 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



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic