Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Jose Fernandez and committed by
Masahiro Yamada
4929f5b9 d97eae80

+14 -1
+14 -1
scripts/package/PKGBUILD
··· 5 5 pkgbase=${PACMAN_PKGBASE:-linux-upstream} 6 6 pkgname=("${pkgbase}") 7 7 8 - _extrapackages=${PACMAN_EXTRAPACKAGES-headers api-headers} 8 + _extrapackages=${PACMAN_EXTRAPACKAGES-headers api-headers debug} 9 9 for pkg in $_extrapackages; do 10 10 pkgname+=("${pkgbase}-${pkg}") 11 11 done ··· 109 109 _prologue 110 110 111 111 ${MAKE} headers_install INSTALL_HDR_PATH="${pkgdir}/usr" 112 + } 113 + 114 + _package-debug(){ 115 + pkgdesc="Non-stripped vmlinux file for the ${pkgdesc} kernel" 116 + 117 + local debugdir="${pkgdir}/usr/src/debug/${pkgbase}" 118 + local builddir="${pkgdir}/usr/${MODLIB}/build" 119 + 120 + _prologue 121 + 122 + install -Dt "${debugdir}" -m644 vmlinux 123 + mkdir -p "${builddir}" 124 + ln -sr "${debugdir}/vmlinux" "${builddir}/vmlinux" 112 125 } 113 126 114 127 for _p in "${pkgname[@]}"; do