History

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.

Jose Fernandez committed 2 years ago

Commit 4929f5b1 parent d97eae81 file · +14 −1Browse files

Unified · Split

scripts/package/PKGBUILD+14−1
@@ -5,7 +5,7 @@ · 4 unmodified lines
55 pkgbase=${PACMAN_PKGBASE:-linux-upstream}
66 pkgname=("${pkgbase}")
77
8−_extrapackages=${PACMAN_EXTRAPACKAGES-headers api-headers}
8+_extrapackages=${PACMAN_EXTRAPACKAGES-headers api-headers debug}
99 for pkg in $_extrapackages; do
1010 pkgname+=("${pkgbase}-${pkg}")
1111 done
@@ -111,6 +111,19 @@ _package-api-headers() { · 99 unmodified lines
111111 ${MAKE} headers_install INSTALL_HDR_PATH="${pkgdir}/usr"
112112 }
113113
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"
125+}
126+
114127 for _p in "${pkgname[@]}"; do
115128 eval "package_$_p() {
116129 $(declare -f "_package${_p#$pkgbase}")

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t