Hello community,

here is the log from the commit of package pesign-obs-integration for 
openSUSE:Factory checked in at 2019-06-12 13:03:02
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/pesign-obs-integration (Old)
 and      /work/SRC/openSUSE:Factory/.pesign-obs-integration.new.4811 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "pesign-obs-integration"

Wed Jun 12 13:03:02 2019 rev:33 rq:706197 version:10.1

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/pesign-obs-integration/pesign-obs-integration.changes
    2019-05-20 10:30:38.749871550 +0200
+++ 
/work/SRC/openSUSE:Factory/.pesign-obs-integration.new.4811/pesign-obs-integration.changes
  2019-06-12 13:03:04.341264942 +0200
@@ -1,0 +2,6 @@
+Wed May 29 06:01:20 UTC 2019 - Gary Ching-Pang Lin <[email protected]>
+
+- Add 0001-Add-support-for-kernel-module-compression.patch to
+  support kernel module compression (bsc#1135854)
+
+-------------------------------------------------------------------

New:
----
  0001-Add-support-for-kernel-module-compression.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ pesign-obs-integration.spec ++++++
--- /var/tmp/diff_new_pack.EqutsD/_old  2019-06-12 13:03:04.933264693 +0200
+++ /var/tmp/diff_new_pack.EqutsD/_new  2019-06-12 13:03:04.937264691 +0200
@@ -33,6 +33,7 @@
 Url:            http://en.opensuse.org/openSUSE:UEFI_Image_File_Sign_Tools
 Source:         %{name}_%{version}.tar.gz
 Patch1:         0001-Passthrough-license-tag.patch
+Patch2:         0001-Add-support-for-kernel-module-compression.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
 # suse-module-tools <= 15.0.10 contains modsign-verify
 Requires:       suse-module-tools >= 15.0.10
@@ -44,6 +45,7 @@
 %prep
 %setup -D -n %{name}
 %patch1 -p1
+%patch2 -p1
 
 %build
 

++++++ 0001-Add-support-for-kernel-module-compression.patch ++++++
>From b6855233b8f131531b8d55761ed709890632b417 Mon Sep 17 00:00:00 2001
From: Takashi Iwai <[email protected]>
Date: Tue, 28 May 2019 07:07:56 +0200
Subject: [PATCH] Add support for kernel module compression

This adds the support for kernel module compression in
pesign-obs-integration infrastructure.  The kernel-binary spec needs
to pass $BRP_PESIGN_COMPRESS_KERNEL for enabling the compression.
Currently only "xz" is supported.

pesign-gen-repackage-spec received a new option --compress, which is
passed from pesign-repackage.spec, where brp-99-pesign enables it per
the variable above.

With --compress option, pesign-gen-repackage-spec script just
compresses the kernel object at the last repackaging phase.

Bugzilla: http://bugzilla.suse.com/show_bug.cgi?id=1135854
Signed-off-by: Takashi Iwai <[email protected]>
---
 README                    |  7 +++++++
 brp-99-pesign             |  8 ++++++++
 pesign-gen-repackage-spec | 13 ++++++++++++-
 pesign-repackage.spec.in  |  3 ++-
 4 files changed, 29 insertions(+), 2 deletions(-)

diff --git a/README b/README
index 7593302..32afb8f 100644
--- a/README
+++ b/README
@@ -36,3 +36,10 @@ Debian packages can use the dh-signobs debhelper to automate 
signing and
 repacking. Build-depend on dh-signobs and add --with signobs to the dh line
 in debian/rules to use the fully automated helper.
 Consult the dh_signobs manpage for more information.
+
+When BRP_PESIGN_COMPRESS_MODULE is passed, the script tries to compress the
+kernel modules at the repackaging phase. Currently only xz format is supported.
+For enable the compression feature, put the following along with
+BRP_PESIGN_FILES setup:
+
+export BRP_PESIGN_COMPRESS_MODULE="xz"
diff --git a/brp-99-pesign b/brp-99-pesign
index 2ebb261..68d9f45 100644
--- a/brp-99-pesign
+++ b/brp-99-pesign
@@ -57,6 +57,13 @@ if ! mkdir -p "$output"; then
        echo "$0: warning: $output cannot be created, giving up" >&2
        exit 0
 fi
+
+if test "${BRP_PESIGN_COMPRESS_MODULE}" = "xz"; then
+       pesign_repackage_compress="--compress xz"
+else
+       pesign_repackage_compress=""
+fi
+
 cert=$RPM_SOURCE_DIR/_projectcert.crt
 if test -e "$cert"; then
        echo "Using signing certificate $cert"
@@ -66,6 +73,7 @@ else
 fi
 sed "
        s:@NAME@:$RPM_PACKAGE_NAME:g
+       s:@PESIGN_REPACKAGE_COMPRESS@:$pesign_repackage_compress:g
        /@CERT@/ {
                r $cert
                d
diff --git a/pesign-gen-repackage-spec b/pesign-gen-repackage-spec
index 9cd374a..fef0a9d 100755
--- a/pesign-gen-repackage-spec
+++ b/pesign-gen-repackage-spec
@@ -30,6 +30,7 @@ my $directory;
 my $output = ".";
 my $cert_subpackage;
 my $kmp_basename;
+my $compress;
 my @rpms;
 
 $ENV{LC_ALL} = "en_US.UTF-8";
@@ -39,6 +40,7 @@ GetOptions(
        "directory|d=s" => \$directory,
        "output|o=s" => \$output,
        "cert-subpackage|c=s" => \$cert_subpackage,
+       "compress|C=s" => \$compress,
 ) or die $USAGE;
 @rpms = @ARGV;
 if (!@rpms) {
@@ -417,7 +419,16 @@ sub print_files {
                        $attrs .= "%verify(not $verify_attrs) ";
                }
 
-               print SPEC "$attrs " . quote($f->{name}) . "\n";
+               if ($compress eq "xz" &&
+                   $f->{name} =~ /\.ko$/ && S_ISREG($f->{mode})) {
+                       system("xz", "-f", "-9", $path);
+                       chmod($f->{mode}, $path . ".xz");
+                       utime($f->{mtime}, $f->{mtime}, $path . ".xz");
+                       print SPEC "$attrs " . quote($f->{name}) . ".xz\n";
+               } else {
+                       print SPEC "$attrs " . quote($f->{name}) . "\n";
+               }
+
                if (-e "$path.sig") {
                        print SPEC "$attrs " . quote($f->{name}) . ".sig\n";
                }
diff --git a/pesign-repackage.spec.in b/pesign-repackage.spec.in
index bcaa0e1..ca8d325 100644
--- a/pesign-repackage.spec.in
+++ b/pesign-repackage.spec.in
@@ -145,7 +145,8 @@ for sig in "${sigs[@]}"; do
        esac
 done
 popd
-/usr/lib/rpm/pesign/pesign-gen-repackage-spec --directory=%buildroot 
"${rpms[@]}"
+/usr/lib/rpm/pesign/pesign-gen-repackage-spec @PESIGN_REPACKAGE_COMPRESS@ \
+       --directory=%buildroot "${rpms[@]}"
 rpmbuild --define "%%buildroot %buildroot" --define "%%disturl $disturl" \
         --define "%%_builddir $PWD" \
         --define "%_suse_insert_debug_package %%{nil}" -bb repackage.spec
-- 
2.21.0


Reply via email to