commit:     4ac950c0bafb442d77bc838b87358145ce434373
Author:     Nowa Ammerlaan <nowa <AT> gentoo <DOT> org>
AuthorDate: Tue Jan 13 19:29:55 2026 +0000
Commit:     Nowa Ammerlaan <nowa <AT> gentoo <DOT> org>
CommitDate: Wed Jan 14 15:18:22 2026 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4ac950c0

eclass/kernel-install.eclass: check sbverify status before trimming

This might be a systemd 259 change, but not sure. In any case we can
now get a kernel image with padding that does verify. So let's check
the exit code of sbverify before we do any trimming. If sbverify was
successful then reset the variable where we are checking for an
error from sbverify and continue.

Signed-off-by: Nowa Ammerlaan <nowa <AT> gentoo.org>
Part-of: https://github.com/gentoo/gentoo/pull/45366

 eclass/kernel-install.eclass | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/eclass/kernel-install.eclass b/eclass/kernel-install.eclass
index 12ad0dcbe091..a879c72310f3 100644
--- a/eclass/kernel-install.eclass
+++ b/eclass/kernel-install.eclass
@@ -1,4 +1,4 @@
-# Copyright 2020-2025 Gentoo Authors
+# Copyright 2020-2026 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: kernel-install.eclass
@@ -692,7 +692,9 @@ kernel-install_extract_from_uki() {
                )
 
                # Check if there was a padding warning
-               if [[ ${sbverify_err} == "warning: data remaining"*": gaps 
between PE/COFF sections?"* ]]
+               if [[ ${?} -eq 0 ]]; then
+                       sbverify_err=
+               elif [[ ${sbverify_err} == "warning: data remaining"*": gaps 
between PE/COFF sections?"* ]]
                then
                        # https://github.com/systemd/systemd/issues/35851
                        local proper_size=${sbverify_err#"warning: data 
remaining["}

Reply via email to