public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jose Fernandez <jose.fernandez@linux.dev>
To: "Thomas Weißschuh" <linux@weissschuh.net>,
	"Christian Heusel" <christian@heusel.eu>,
	"Nathan Chancellor" <nathan@kernel.org>,
	"Masahiro Yamada" <masahiroy@kernel.org>,
	"Nicolas Schier" <nicolas@fjasle.eu>
Cc: Jose Fernandez <jose.fernandez@linux.dev>,
	Peter Jung <ptr1337@cachyos.org>,
	linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] kbuild: add debug package to pacman PKGBUILD
Date: Thu,  1 Aug 2024 07:29:40 -0600	[thread overview]
Message-ID: <20240801132945.47963-1-jose.fernandez@linux.dev> (raw)

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


             reply	other threads:[~2024-08-01 13:30 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-01 13:29 Jose Fernandez [this message]
2024-08-01 18:36 ` [PATCH] kbuild: add debug package to pacman PKGBUILD 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240801132945.47963-1-jose.fernandez@linux.dev \
    --to=jose.fernandez@linux.dev \
    --cc=christian@heusel.eu \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@weissschuh.net \
    --cc=masahiroy@kernel.org \
    --cc=nathan@kernel.org \
    --cc=nicolas@fjasle.eu \
    --cc=ptr1337@cachyos.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox