[PATCH 1/3] package: debian: strip headers package
From: Thomas Böhler
Date: Thu Oct 31 2024 - 09:27:11 EST
The linux-headers package contains unstripped binaries. Lintian
complains about this:
E: linux-headers-6.12.0-rc4-g7e04fcfc6195: unstripped-binary-or-object [usr/src/linux-headers-6.12.0-rc4-g7e04fcfc6195/scripts/asn1_compiler]
E: linux-headers-6.12.0-rc4-g7e04fcfc6195: unstripped-binary-or-object [usr/src/linux-headers-6.12.0-rc4-g7e04fcfc6195/scripts/basic/fixdep]
E: linux-headers-6.12.0-rc4-g7e04fcfc6195: unstripped-binary-or-object [usr/src/linux-headers-6.12.0-rc4-g7e04fcfc6195/scripts/kallsyms]
E: linux-headers-6.12.0-rc4-g7e04fcfc6195: unstripped-binary-or-object [usr/src/linux-headers-6.12.0-rc4-g7e04fcfc6195/scripts/mod/modpost]
E: linux-headers-6.12.0-rc4-g7e04fcfc6195: unstripped-binary-or-object [usr/src/linux-headers-6.12.0-rc4-g7e04fcfc6195/scripts/sorttable]
It's not possible to outright strip every package built with
"debian/rules" as, for instance, the "binary-image" target shouldn't be
stripped because it contains debug information that the
"binary-image-dbg" target will make use of.
Thus conditionally use "dh_strip" on the "binary-headers" target after
using "dh_builddeb" to strip only the contents of the package lintian
complains about. Also pass the "--no-automatic-dbgsym" option to make
sure no headers-dbgsym package is created.
Signed-off-by: Thomas Böhler <t.boehler@xxxxxxxxxx>
---
scripts/package/debian/rules | 2 ++
1 file changed, 2 insertions(+)
diff --git a/scripts/package/debian/rules b/scripts/package/debian/rules
index ca07243bd5cd..0c75319acae1 100755
--- a/scripts/package/debian/rules
+++ b/scripts/package/debian/rules
@@ -46,6 +46,8 @@ define binary
$(Q)dh_testroot $(DH_OPTIONS)
$(Q)dh_prep $(DH_OPTIONS)
$(Q)+$(MAKE) $(make-opts) run-command KBUILD_RUN_COMMAND='+$$(srctree)/scripts/package/builddeb $(package)'
+ $(if $(filter $(headers-package),$(package)),\
+ $(Q)dh_strip $(DH_OPTIONS) --no-automatic-dbgsym)
$(Q)dh_installdocs $(DH_OPTIONS)
$(Q)dh_installchangelogs $(DH_OPTIONS)
$(Q)dh_compress $(DH_OPTIONS)
--
2.39.2