diff mbox series

[disco/master-next,4/9] UBUNTU: [Packaging] dkms-build -- remove retpoline data from final binary packages

Message ID 20190312155719.3532-5-apw@canonical.com
State New
Headers show
Series [disco/master-next,1/9] UBUNTU: [Packaging] dkms-build -- support building against packages in PPAs | expand

Commit Message

Andy Whitcroft March 12, 2019, 3:57 p.m. UTC
We only need the *.o files for reconstruction, elide the associated
repoline data from the binary packages.

BugLink: http://bugs.launchpad.net/bugs/1764792
Signed-off-by: Andy Whitcroft <apw@canonical.com>
 debian/scripts/dkms-build--nvidia-390 | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
diff mbox series


diff --git a/debian/scripts/dkms-build--nvidia-390 b/debian/scripts/dkms-build--nvidia-390
index bbd3d97998a8..093035c756a0 100755
--- a/debian/scripts/dkms-build--nvidia-390
+++ b/debian/scripts/dkms-build--nvidia-390
@@ -15,9 +15,12 @@  shift 6
 build="$( dirname "$objects" )/build"
-# Copy over the objects ready for reconstruction.
+# Copy over the objects ready for reconstruction.  The objects copy contains
+# the *.o files and the *.o-ur* retpoline files to allow the kernel to track
+# any retpoline sequences therein.  For our purposes we only want the *.o
+# files, elide the rest.
 mkdir -p "$pkgdir/bits/scripts"
-cp -rp "$objects"/* "$pkgdir/bits"
+(cd "$objects" && find -name \*.o | cpio -Lpd "$pkgdir/bits")
 # Install the support files we need.
 cp "$srcdir/scripts/module-common.lds" "$pkgdir/bits/scripts"