Linux kbuild/kconfig development
 help / color / mirror / Atom feed
From: "Thomas Weißschuh" <linux@weissschuh.net>
To: Jose Fernandez <jose.fernandez@linux.dev>
Cc: Christian Heusel <christian@heusel.eu>,
	 Nathan Chancellor <nathan@kernel.org>,
	Masahiro Yamada <masahiroy@kernel.org>,
	 Nicolas Schier <nicolas@fjasle.eu>,
	Peter Jung <ptr1337@cachyos.org>,
	linux-kbuild@vger.kernel.org,  linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] kbuild: add debug package to pacman PKGBUILD
Date: Sat, 17 Aug 2024 19:15:33 +0200	[thread overview]
Message-ID: <0dbfa069-a931-416d-ac1f-e9ceaee96b80@t-8ch.de> (raw)
In-Reply-To: <20240817151147.156479-1-jose.fernandez@linux.dev>

On 2024-08-17 09:11:47+0000, Jose Fernandez wrote:
> 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}"

This should make use of _prologue() from 
"kbuild: pacman-pkg: move common commands to a separate function"

https://lore.kernel.org/lkml/20240816141844.1217356-1-masahiroy@kernel.org/

It's not yet part of the kbuild tree, but I guess will be soon.

> +	mkdir -p "$pkgdir/usr/src/debug/${pkgbase}"

The mkdir shouldn't be necessary, as install -D is used.

> +	install -Dt "$pkgdir/usr/src/debug/${pkgbase}" -m644 vmlinux

Can you also add a symlink to /usr/lib/modules/$(uname -r)/build/vmlinux
for compatibility with the vanilla package?

> +}
> +
>  for _p in "${pkgname[@]}"; do
>  	eval "package_$_p() {
>  		$(declare -f "_package${_p#$pkgbase}")
> 
> base-commit: 869679673d3bbaaf1c2a43dba53930f5241e1d30
> -- 
> 2.46.0
> 

  parent reply	other threads:[~2024-08-17 17:15 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

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=0dbfa069-a931-416d-ac1f-e9ceaee96b80@t-8ch.de \
    --to=linux@weissschuh.net \
    --cc=christian@heusel.eu \
    --cc=jose.fernandez@linux.dev \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --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