public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] kbuild: add debug package to pacman PKGBUILD
@ 2024-08-01 13:29 Jose Fernandez
  2024-08-01 18:36 ` Nathan Chancellor
  0 siblings, 1 reply; 9+ messages in thread
From: Jose Fernandez @ 2024-08-01 13:29 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 pacman PKGBUILD that will contain the
vmlinux image for debugging purposes. This package depends on the
-headers package and will be installed in /usr/src/debug/${pkgbase}.

The vmlinux image is needed to debug core dumps with tools like crash.

Signed-off-by: Jose Fernandez <jose.fernandez@linux.dev>
Reviewed-by: Peter Jung <ptr1337@cachyos.org>
---
 scripts/package/PKGBUILD | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/scripts/package/PKGBUILD b/scripts/package/PKGBUILD
index 663ce300dd06..beda3db21863 100644
--- a/scripts/package/PKGBUILD
+++ b/scripts/package/PKGBUILD
@@ -6,6 +6,7 @@ pkgbase=${PACMAN_PKGBASE:-linux-upstream}
 pkgname=("${pkgbase}" "${pkgbase}-api-headers")
 if grep -q CONFIG_MODULES=y include/config/auto.conf; then
 	pkgname+=("${pkgbase}-headers")
+	pkgname+=("${pkgbase}-debug")
 fi
 pkgver="${KERNELRELEASE//-/_}"
 # The PKGBUILD is evaluated multiple times.
@@ -89,6 +90,15 @@ _package-headers() {
 	ln -sr "${builddir}" "${pkgdir}/usr/src/${pkgbase}"
 }
 
+_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
+}
+
 _package-api-headers() {
 	pkgdesc="Kernel headers sanitized for use in userspace"
 	provides=(linux-api-headers)
-- 
2.46.0


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

end of thread, other threads:[~2024-08-06 14:34 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-01 13:29 [PATCH] kbuild: add debug package to pacman PKGBUILD Jose Fernandez
2024-08-01 18:36 ` Nathan Chancellor
2024-08-01 18:53   ` Thomas Weißschuh
2024-08-01 19:20     ` Nathan Chancellor
2024-08-02  4:27       ` Jose Fernandez
2024-08-02 15:40         ` Thomas Weißschuh
2024-08-03 16:41           ` Jose Fernandez
2024-08-03 14:40     ` Masahiro Yamada
2024-08-06 14:28     ` Christian Heusel

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