aboutsummaryrefslogtreecommitdiff
path: root/scripts/package
diff options
context:
space:
mode:
authorJose Fernandez2024-08-24 16:07:56 -0600
committerMasahiro Yamada2024-09-07 17:24:08 +0900
commit4929f5b95f6b20ae10f2c409fb2ca58253e73706 (patch)
tree83fa4022d48db6539e3093f10f71371cd7996f96 /scripts/package
parentd97eae80d57220477a02435e49b48ac6f01e289c (diff)
kbuild: add debug package to pacman PKGBUILD
Add a new debug package to the PKGBUILD for the pacman-pkg target. The debug package includes the non-stripped vmlinux file with debug symbols for kernel debugging and profiling. The file is installed at /usr/src/debug/${pkgbase}, with a symbolic link at /usr/lib/modules/$(uname -r)/build/vmlinux. The debug package is built by default. Signed-off-by: Jose Fernandez <jose.fernandez@linux.dev> Reviewed-by: Peter Jung <ptr1337@cachyos.org> Acked-by: Thomas Weißschuh <linux@weissschuh.net> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Diffstat (limited to 'scripts/package')
-rw-r--r--scripts/package/PKGBUILD15
1 files changed, 14 insertions, 1 deletions
diff --git a/scripts/package/PKGBUILD b/scripts/package/PKGBUILD
index 839cd5e634d2..f83493838cf9 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
@@ -111,6 +111,19 @@ _package-api-headers() {
${MAKE} headers_install INSTALL_HDR_PATH="${pkgdir}/usr"
}
+_package-debug(){
+ pkgdesc="Non-stripped vmlinux file for the ${pkgdesc} kernel"
+
+ local debugdir="${pkgdir}/usr/src/debug/${pkgbase}"
+ local builddir="${pkgdir}/usr/${MODLIB}/build"
+
+ _prologue
+
+ install -Dt "${debugdir}" -m644 vmlinux
+ mkdir -p "${builddir}"
+ ln -sr "${debugdir}/vmlinux" "${builddir}/vmlinux"
+}
+
for _p in "${pkgname[@]}"; do
eval "package_$_p() {
$(declare -f "_package${_p#$pkgbase}")