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

Showing the changes to scripts (1 of 1 file). Show all

Unified · Split

scripts/package/PKGBUILD+14−1
@@ -5,7 +5,7 @@ · 4 unmodified lines
5pkgbase=${PACMAN_PKGBASE:-linux-upstream}5pkgbase=${PACMAN_PKGBASE:-linux-upstream}
6pkgname=("${pkgbase}")6pkgname=("${pkgbase}")
7 7
8_extrapackages=${PACMAN_EXTRAPACKAGES-headers api-headers}8_extrapackages=${PACMAN_EXTRAPACKAGES-headers api-headers debug}
9for pkg in $_extrapackages; do9for pkg in $_extrapackages; do
10 pkgname+=("${pkgbase}-${pkg}")10 pkgname+=("${pkgbase}-${pkg}")
11done11done
@@ -111,6 +111,19 @@ _package-api-headers() { · 99 unmodified lines
111 ${MAKE} headers_install INSTALL_HDR_PATH="${pkgdir}/usr"111 ${MAKE} headers_install INSTALL_HDR_PATH="${pkgdir}/usr"
112}112}
113 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"
125}
126
114for _p in "${pkgname[@]}"; do127for _p in "${pkgname[@]}"; do
115 eval "package_$_p() {128 eval "package_$_p() {
116 $(declare -f "_package${_p#$pkgbase}")129 $(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