[PATCH 2/3 F][SRU] UBUNTU: [packaging] fix dkms-build--nvidia-N on ppc64el
Alberto Milone
alberto.milone at canonical.com
Fri May 29 14:32:19 UTC 2020
This changes the regex, and copies the module.lds script
on ppc64el. This generates modules and signatures correctly.
BugLink: https://bugs.launchpad.net/bugs/1881137
Signed-off-by: Alberto Milone <alberto.milone at canonical.com>
---
debian/scripts/dkms-build--nvidia-N | 18 +++++++++++++++---
1 file changed, 15 insertions(+), 3 deletions(-)
diff --git a/debian/scripts/dkms-build--nvidia-N b/debian/scripts/dkms-build--nvidia-N
index bdec78233b43..d1e788c9f874 100755
--- a/debian/scripts/dkms-build--nvidia-N
+++ b/debian/scripts/dkms-build--nvidia-N
@@ -15,6 +15,7 @@ package="$7"
shift 7
build="$( dirname "$objects" )/build"
+arch="$( /usr/bin/dpkg-architecture -qDEB_HOST_ARCH )"
# 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
@@ -36,9 +37,20 @@ mkdir -p "$pkgdir/bits/scripts"
# Install the support files we need.
cp "$srcdir/scripts/module-common.lds" "$pkgdir/bits/scripts"
-grep /usr/bin/ld.bfd "$log" | sed -e "s@$build/@@g" >"$pkgdir/bits/BUILD"
-grep /usr/bin/ld.bfd "$log" | sed -e "s@$build/@@g" \
- -e 's/.*-o *\([^ ]*\) .*/rm -f \1/g' >"$pkgdir/bits/CLEAN"
+
+if [ "$arch" = "ppc64el" ]; then
+ [ ! -d "$pkgdir/bits/arch/powerpc/kernel/" ] && mkdir -p "$pkgdir/bits/arch/powerpc/kernel"
+ cp "$srcdir/arch/powerpc/kernel/module.lds" "$pkgdir/bits/arch/powerpc/kernel/module.lds"
+
+ grep /usr/bin/ld.bfd "$log" | grep -v "^ if" | sed -e 's@; *make -f ./arch/powerpc/.*@@' \
+ -e "s@$build/@@g" >"$pkgdir/bits/BUILD"
+ grep /usr/bin/ld.bfd "$log"| grep -v "^ if" | sed -e "s@$build/@@g" \
+ -e 's/.*-o *\([^ ]*\) .*/rm -f \1/g' >"$pkgdir/bits/CLEAN"
+else
+ grep /usr/bin/ld.bfd "$log" | sed -e "s@$build/@@g" >"$pkgdir/bits/BUILD"
+ grep /usr/bin/ld.bfd "$log" | sed -e "s@$build/@@g" \
+ -e 's/.*-o *\([^ ]*\) .*/rm -f \1/g' >"$pkgdir/bits/CLEAN"
+fi
# As the builds contain the absolute filenames as used. Use RECONSTRUCT to
# rebuild the .ko's, sign them, pull off the signatures and then finally clean
--
2.25.1
More information about the kernel-team
mailing list