Accepting request 901097 from home:lnussel:usrmove

- find kernel also in /lib (boo#1184804, pesign-kernel-in-lib.diff)

OBS-URL: https://build.opensuse.org/request/show/901097
OBS-URL: https://build.opensuse.org/package/show/Base:System/pesign-obs-integration?expand=0&rev=103
This commit is contained in:
Gary Ching-Pang Lin 2021-06-24 08:51:35 +00:00 committed by Git OBS Bridge
parent 01c145bdd2
commit c932fb72d2
3 changed files with 65 additions and 0 deletions

59
pesign-kernel-in-lib.diff Normal file
View File

@ -0,0 +1,59 @@
Index: pesign-obs-integration-10.2/brp-99-compress-vmlinux
===================================================================
--- pesign-obs-integration-10.2.orig/brp-99-compress-vmlinux
+++ pesign-obs-integration-10.2/brp-99-compress-vmlinux
@@ -11,6 +11,9 @@ kernel-*)
exit 0
esac
for f in $RPM_BUILD_ROOT/boot/vmlinux-*; do
+ if [ -L "$f" ]; then
+ f=`readlink -f "$f"`
+ fi
for compression in gz/gzip xz; do
if test -e "$f" -a -e "$f.${compression%/*}"; then
echo "${compression#*/} $f"
Index: pesign-obs-integration-10.2/pesign-repackage.spec.in
===================================================================
--- pesign-obs-integration-10.2.orig/pesign-repackage.spec.in
+++ pesign-obs-integration-10.2/pesign-repackage.spec.in
@@ -129,7 +129,7 @@ for sig in "${sigs[@]}"; do
*.ko.sig)
/usr/lib/rpm/pesign/kernel-sign-file -i pkcs7 -s "$sig" sha256 "$cert" "$f"
;;
- /boot/* | *.efi.sig)
+ /boot/* | *.efi.sig | */lib/modules/*/vmlinu[xz].sig | */lib/modules/*/[Ii]mage.sig | */lib/modules/*/z[Ii]mage.sig)
%ifarch %ix86 x86_64 aarch64 %arm
# PE style signature injection
infile=${sig%.sig}
Index: pesign-obs-integration-10.2/pesign-gen-repackage-spec
===================================================================
--- pesign-obs-integration-10.2.orig/pesign-gen-repackage-spec
+++ pesign-obs-integration-10.2/pesign-gen-repackage-spec
@@ -25,6 +25,8 @@ my $USAGE = "Usage: $0 --directory <payl
use Getopt::Long;
use Fcntl qw(:mode :seek);
+use File::Basename qw(dirname);
+use File::Path qw(make_path);
my $directory;
my $output = ".";
@@ -418,6 +420,7 @@ sub print_files {
if ($f->{flags} & $filetypes{ghost}) {
$attrs .= "%ghost ";
if (S_ISREG($f->{mode})) {
+ make_path(dirname($path));
open(my $fh, '>', $path) or die "$path: $!\n";
if ($f->{size} > 0) {
sysseek($fh, $f->{size} - 1, SEEK_SET);
@@ -425,7 +428,10 @@ sub print_files {
}
close($fh);
utime($f->{mtime}, $f->{mtime}, $path);
+ } elsif (S_ISDIR($f->{mode})) {
+ make_path($path);
} elsif (S_ISLNK($f->{mode})) {
+ make_path(dirname($path));
symlink($f->{target}, $path);
}
}

View File

@ -4,6 +4,11 @@ Mon Jun 21 03:23:54 UTC 2021 - Gary Ching-Pang Lin <glin@suse.com>
- Add pesign-obs-integration-support-gzip-zstd-compression.patch
to support gzip and zstd module compression
-------------------------------------------------------------------
Fri Apr 23 09:34:17 UTC 2021 - Ludwig Nussel <lnussel@suse.de>
- find kernel also in /lib (boo#1184804, pesign-kernel-in-lib.diff)
-------------------------------------------------------------------
Fri Mar 19 03:45:11 UTC 2021 - Gary Ching-Pang Lin <glin@suse.com>

View File

@ -27,6 +27,7 @@ URL: https://en.opensuse.org/openSUSE:UEFI_Image_File_Sign_Tools
Source: %{name}-%{version}.tar.gz
Patch1: pesign-obs-integration-bsc1183747-always-pad-efi-images.patch
Patch2: pesign-obs-integration-support-gzip-zstd-compression.patch
Patch3: pesign-kernel-in-lib.diff
BuildRequires: openssl
Requires: fipscheck
Requires: mozilla-nss-tools