build: conditionalize -dbgsym package

via a new, namespaced build profile.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
This commit is contained in:
Fabian Grünbichler 2021-07-21 14:10:40 +02:00 committed by Thomas Lamprecht
parent f778e4031d
commit 04f7144d55
2 changed files with 6 additions and 1 deletions

1
debian/control.in vendored
View File

@ -71,6 +71,7 @@ Architecture: any
Provides: linux-debug Provides: linux-debug
Section: devel Section: devel
Priority: optional Priority: optional
Build-Profiles: <pkg.pve-kernel.debug>
Description: The Proxmox PVE Kernel debug image Description: The Proxmox PVE Kernel debug image
This package provides the kernel debug image for version @KVNAME@. The debug This package provides the kernel debug image for version @KVNAME@. The debug
kernel image contained in this package is NOT meant to boot from - it is kernel image contained in this package is NOT meant to boot from - it is

6
debian/rules vendored
View File

@ -138,7 +138,10 @@ binary: install
# remove firmware # remove firmware
rm -rf debian/${PVE_KERNEL_PKG}/lib/firmware rm -rf debian/${PVE_KERNEL_PKG}/lib/firmware
# debug package ifeq ($(filter pkg.pve-kernel.debug,$(DEB_BUILD_PROFILES)),)
echo "'pkg.pve-kernel.debug' build profile disabled, skipping -dbgsym creation"
else
echo "'pkg.pve-kernel.debug' build profile enabled, creating -dbgsym contents"
mkdir -p debian/${PVE_DEBUG_KERNEL_PKG}/usr/lib/debug/lib/modules/${KVNAME} mkdir -p debian/${PVE_DEBUG_KERNEL_PKG}/usr/lib/debug/lib/modules/${KVNAME}
mkdir debian/${PVE_DEBUG_KERNEL_PKG}/usr/lib/debug/boot mkdir debian/${PVE_DEBUG_KERNEL_PKG}/usr/lib/debug/boot
install -m 644 ${KERNEL_SRC}/vmlinux debian/${PVE_DEBUG_KERNEL_PKG}/usr/lib/debug/boot/vmlinux-${KVNAME} install -m 644 ${KERNEL_SRC}/vmlinux debian/${PVE_DEBUG_KERNEL_PKG}/usr/lib/debug/boot/vmlinux-${KVNAME}
@ -146,6 +149,7 @@ binary: install
rm -f debian/${PVE_DEBUG_KERNEL_PKG}/usr/lib/debug/lib/modules/${KVNAME}/source rm -f debian/${PVE_DEBUG_KERNEL_PKG}/usr/lib/debug/lib/modules/${KVNAME}/source
rm -f debian/${PVE_DEBUG_KERNEL_PKG}/usr/lib/debug/lib/modules/${KVNAME}/build rm -f debian/${PVE_DEBUG_KERNEL_PKG}/usr/lib/debug/lib/modules/${KVNAME}/build
rm -f debian/${PVE_DEBUG_KERNEL_PKG}/usr/lib/debug/lib/modules/${KVNAME}/modules.* rm -f debian/${PVE_DEBUG_KERNEL_PKG}/usr/lib/debug/lib/modules/${KVNAME}/modules.*
endif
# strip debug info # strip debug info
find debian/${PVE_KERNEL_PKG}/lib/modules -name \*.ko -print | while read f ; do strip --strip-debug "$$f"; done find debian/${PVE_KERNEL_PKG}/lib/modules -name \*.ko -print | while read f ; do strip --strip-debug "$$f"; done