diff mbox series

[4/9] UBUNTU: [Packaging] dkms-build--nvidia-N -- follow changes to lds naming

Message ID 20210308150004.1746089-5-apw@canonical.com
State New
Headers show
Series LP#1918134 -- LRMv4 switch to signing with Ubuntu Kernel Modules signing key | expand

Commit Message

Andy Whitcroft March 8, 2021, 2:59 p.m. UTC
In later kernels they have renamed the modules-common.lds file.  Handle
both the old and new names.  We pick up the appropriate file from headers
which are available (as they are in preparation) or actually installed
as a build-dependency in all contexts.  Drop the internal copy of this
script and the update-version configuration to keep it up to date.

BugLink: https://bugs.launchpad.net/bugs/1918134
Signed-off-by: Andy Whitcroft <apw@canonical.com>
---
 debian/scripts/dkms-build--nvidia-N | 15 ++++++++++++++-
 scripts/module-common.lds           | 26 --------------------------
 update-version                      |  3 +--
 3 files changed, 15 insertions(+), 29 deletions(-)
 delete mode 100644 scripts/module-common.lds
diff mbox series

Patch

diff --git a/debian/scripts/dkms-build--nvidia-N b/debian/scripts/dkms-build--nvidia-N
index 5f07ef2..29e4152 100755
--- a/debian/scripts/dkms-build--nvidia-N
+++ b/debian/scripts/dkms-build--nvidia-N
@@ -35,7 +35,20 @@  mkdir -p "$pkgdir/bits/scripts"
 )
 
 # Install the support files we need.
-cp "$srcdir/scripts/module-common.lds" "$pkgdir/bits/scripts"
+echo "II: copying support files ..."
+for lds_src in \
+	"$dkms_dir/headers/linux-headers-$abi_flavour/scripts/module.lds" \
+	"/usr/src/linux-headers-$abi_flavour/scripts/module.lds" \
+	"$dkms_dir/headers/linux-headers-$abi_flavour/scripts/module-common.lds" \
+	"/usr/src/linux-headers-$abi_flavour/scripts/module-common.lds"
+do
+	[ ! -f "$lds_src" ] && continue
+	echo "II: copying support files ... found $lds_src"
+	cp "$lds_src" "$pkgdir/bits/scripts"
+	break
+done
+
+# Build helper scripts.
 grep /usr/bin/ld.bfd "$log" | grep -v scripts/genksyms/genksyms | sed -e "s@$build/@@g" >"$pkgdir/bits/BUILD"
 sed -e 's/.*-o  *\([^ ]*\) .*/rm -f \1/g' <"$pkgdir/bits/BUILD" >"$pkgdir/bits/CLEAN"
 
diff --git a/scripts/module-common.lds b/scripts/module-common.lds
deleted file mode 100644
index d61b9e8..0000000
--- a/scripts/module-common.lds
+++ /dev/null
@@ -1,26 +0,0 @@ 
-/*
- * Common module linker script, always used when linking a module.
- * Archs are free to supply their own linker scripts.  ld will
- * combine them automatically.
- */
-SECTIONS {
-	/DISCARD/ : {
-		*(.discard)
-		*(.discard.*)
-	}
-
-	__ksymtab		0 : { *(SORT(___ksymtab+*)) }
-	__ksymtab_gpl		0 : { *(SORT(___ksymtab_gpl+*)) }
-	__ksymtab_unused	0 : { *(SORT(___ksymtab_unused+*)) }
-	__ksymtab_unused_gpl	0 : { *(SORT(___ksymtab_unused_gpl+*)) }
-	__ksymtab_gpl_future	0 : { *(SORT(___ksymtab_gpl_future+*)) }
-	__kcrctab		0 : { *(SORT(___kcrctab+*)) }
-	__kcrctab_gpl		0 : { *(SORT(___kcrctab_gpl+*)) }
-	__kcrctab_unused	0 : { *(SORT(___kcrctab_unused+*)) }
-	__kcrctab_unused_gpl	0 : { *(SORT(___kcrctab_unused_gpl+*)) }
-	__kcrctab_gpl_future	0 : { *(SORT(___kcrctab_gpl_future+*)) }
-
-	.init_array		0 : ALIGN(8) { *(SORT(.init_array.*)) *(.init_array) }
-
-	__jump_table		0 : ALIGN(8) { KEEP(*(__jump_table)) }
-}
diff --git a/update-version b/update-version
index 94a6908..f6d231b 100755
--- a/update-version
+++ b/update-version
@@ -46,8 +46,7 @@  for thing in \
 	debian/scripts/misc/git-ubuntu-log \
 	debian/scripts/dkms-build \
 	debian/scripts/dkms-build--nvidia-N \
-	debian/scripts/fix-filenames.c \
-	scripts/module-common.lds
+	debian/scripts/fix-filenames.c
 do
 	cp -p "$master_dir/$thing" "$thing" || exit 1
 	if ! git diff --exit-code -- "$thing" >/dev/null; then