@@ -15,15 +15,25 @@ shift 6
build="$( dirname "$objects" )/build"
+arch="$( /usr/bin/dpkg-architecture -qDEB_HOST_ARCH )"
+
# Copy over the objects ready for reconstruction.
mkdir -p "$pkgdir/bits/scripts"
cp -rp "$objects"/* "$pkgdir/bits"
# 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
+ 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
This changes the regex on ppc64el. BugLink: https://bugs.launchpad.net/bugs/1881137 Signed-off-by: Alberto Milone <alberto.milone@canonical.com> --- debian/scripts/dkms-build--nvidia-N | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-)