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.
Showing the changes to scripts (1 of 1 file). Show all
Unified · Split
| @@ -5,7 +5,7 @@ · 4 unmodified lines | ||
| 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 |
| @@ -111,6 +111,19 @@ _package-api-headers() { · 99 unmodified lines | ||
| 111 | 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 | + | |
| 114 | 127 | for _p in "${pkgname[@]}"; do |
| 115 | 128 | eval "package_$_p() { |
| 116 | 129 | $(declare -f "_package${_p#$pkgbase}") |