Linux kbuild/kconfig development
 help / color / mirror / Atom feed
* [PATCH v2] kbuild: add debug package to pacman PKGBUILD
@ 2024-08-17 15:11 Jose Fernandez
  2024-08-17 15:54 ` Nicolas Schier
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Jose Fernandez @ 2024-08-17 15:11 UTC (permalink / raw)
  To: Thomas Weißschuh, Christian Heusel, Nathan Chancellor,
	Masahiro Yamada, Nicolas Schier
  Cc: Jose Fernandez, Peter Jung, linux-kbuild, linux-kernel

Add a new debug package to the PKGBUILD for the pacman-pkg target. The
debug package includes the non-stripped vmlinux file, providing access
to debug symbols needed for kernel debugging and profiling. The vmlinux
file will be installed to /usr/src/debug/${pkgbase}. The debug package
will be built by default and can be excluded by overriding PACMAN_EXTRAPACKAGES.

Signed-off-by: Jose Fernandez <jose.fernandez@linux.dev>
Reviewed-by: Peter Jung <ptr1337@cachyos.org>
---
v1->v2:
- Use the new PACMAN_EXTRAPACKAGES [1] variable to allow users to disable the
debug package if desired, instead of always including it.

[1] https://lore.kernel.org/lkml/20240813185900.GA140556@thelio-3990X/T/

 scripts/package/PKGBUILD | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/scripts/package/PKGBUILD b/scripts/package/PKGBUILD
index fbd7eb10a52c..d40d282353de 100644
--- a/scripts/package/PKGBUILD
+++ b/scripts/package/PKGBUILD
@@ -5,7 +5,7 @@
 pkgbase=${PACMAN_PKGBASE:-linux-upstream}
 pkgname=("${pkgbase}")
 
-_extrapackages=${PACMAN_EXTRAPACKAGES-headers api-headers}
+_extrapackages=${PACMAN_EXTRAPACKAGES-headers api-headers debug}
 for pkg in $_extrapackages; do
 	pkgname+=("${pkgbase}-${pkg}")
 done
@@ -106,6 +106,15 @@ _package-api-headers() {
 	${MAKE} headers_install INSTALL_HDR_PATH="${pkgdir}/usr"
 }
 
+_package-debug(){
+	pkgdesc="Non-stripped vmlinux file for the ${pkgdesc} kernel"
+	depends=(${pkgbase}-headers)
+
+	cd "${objtree}"
+	mkdir -p "$pkgdir/usr/src/debug/${pkgbase}"
+	install -Dt "$pkgdir/usr/src/debug/${pkgbase}" -m644 vmlinux
+}
+
 for _p in "${pkgname[@]}"; do
 	eval "package_$_p() {
 		$(declare -f "_package${_p#$pkgbase}")

base-commit: 869679673d3bbaaf1c2a43dba53930f5241e1d30
-- 
2.46.0


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2024-08-24 15:56 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-17 15:11 [PATCH v2] kbuild: add debug package to pacman PKGBUILD Jose Fernandez
2024-08-17 15:54 ` Nicolas Schier
2024-08-24 15:56   ` Jose Fernandez
2024-08-17 17:15 ` Thomas Weißschuh
2024-08-18  1:43   ` Jose Fernandez
2024-08-18 12:35 ` Masahiro Yamada
2024-08-20 14:28   ` Jose Fernandez
2024-08-23 12:42     ` Masahiro Yamada

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox