community/linux-tools: upgrade to 6.2

- use kernel _kernvers to allow bare non-patch versions
- clean up to modern style (amove, listify) to make diffs more obvious,
  prune empty dirs left behind in packages
- add libtraceevent since perf trace plugins are in external library
  now, and not in perf. since the plugins are no longer vendored, depend
  on them directly. this also upgrades libtraceevent from 1.1 to 1.7+
  because it's external.
- add python/zstd support for perf to increase tool usefulness (python
  plugins!)
- add llvm for better bpftool support

🎉
This commit is contained in:
psykose 2023-02-20 13:29:51 +00:00
parent d527e8b78d
commit 11d5200c19

View File

@ -3,8 +3,11 @@
# Contributor: Natanael Copa <ncopa@alpinelinux.org> # Contributor: Natanael Copa <ncopa@alpinelinux.org>
# Maintainer: Milan P. Stanić <mps@arvanta.net> # Maintainer: Milan P. Stanić <mps@arvanta.net>
pkgname=linux-tools pkgname=linux-tools
pkgver=6.1.6 pkgver=6.2
_kernver=${pkgver%.*} case $pkgver in
*.*.*) _kernver=${pkgver%.*};;
*.*) _kernver=$pkgver;;
esac
pkgrel=0 pkgrel=0
pkgdesc="Linux kernel tools meta package" pkgdesc="Linux kernel tools meta package"
url="https://www.kernel.org/" url="https://www.kernel.org/"
@ -12,12 +15,41 @@ arch="all"
license="GPL-2.0-only" license="GPL-2.0-only"
depends="perf cpupower $pkgname-gpio $pkgname-iio" depends="perf cpupower $pkgname-gpio $pkgname-iio"
depends_dev="pciutils-dev readline-dev gettext-dev" depends_dev="pciutils-dev readline-dev gettext-dev"
makedepends="$depends_dev elfutils-dev bash linux-headers flex bison diffutils makedepends="
zlib-dev findutils python3 ncurses-dev $depends_dev
automake autoconf libtool libudev-zero-dev sysfsutils-dev glib-dev asciidoc
libbpf binutils-dev clang llvm libcap-dev xmlto asciidoc" autoconf
subpackages="perf perf-bash-completion:perf_bashcomp:noarch automake
cpupower cpupower-openrc cpupower-bash-completion:cpupower_bashcomp:noarch bash
binutils-dev
bison
clang
diffutils
elfutils-dev
findutils
flex
glib-dev
libbpf-dev
libcap-dev
libtool
libtraceevent-dev
libudev-zero-dev
linux-headers
llvm-dev
ncurses-dev
numactl-dev
python3-dev
sysfsutils-dev
xmlto
zlib-dev
zstd-dev
"
subpackages="
perf
perf-bash-completion:perf_bashcomp:noarch
cpupower
cpupower-openrc:cpupower_openrc
cpupower-bash-completion:cpupower_bashcomp:noarch
$pkgname-dev $pkgname-dev
$pkgname-doc $pkgname-doc
$pkgname-gpio $pkgname-gpio
@ -25,10 +57,10 @@ subpackages="perf perf-bash-completion:perf_bashcomp:noarch
$pkgname-spi $pkgname-spi
$pkgname-tmon $pkgname-tmon
$pkgname-usbip $pkgname-usbip
$pkgname-usbip-openrc $pkgname-usbip-openrc:usbip_openrc
bpftool bpftool-bash-completion:bpftool_bashcomp:noarch" bpftool bpftool-bash-completion:bpftool_bashcomp:noarch
"
source="https://kernel.org/pub/linux/kernel/v6.x/linux-$_kernver.tar.xz source="https://kernel.org/pub/linux/kernel/v6.x/linux-$_kernver.tar.xz
https://kernel.org/pub/linux/kernel/v6.x/patch-$pkgver.xz
cpupower-libs.patch cpupower-libs.patch
dt_lnk.patch dt_lnk.patch
cpupower.initd cpupower.initd
@ -36,6 +68,17 @@ source="https://kernel.org/pub/linux/kernel/v6.x/linux-$_kernver.tar.xz
usbip.initd usbip.initd
usbip.confd usbip.confd
" "
# append patch for non .0
case $pkgver in
*.*.0)
;;
*.*.*)
source="
$source
https://cdn.kernel.org/pub/linux/kernel/v${pkgver%%.*}.x/patch-$pkgver.xz
"
;;
esac
builddir="$srcdir"/linux-$_kernver builddir="$srcdir"/linux-$_kernver
@ -93,35 +136,42 @@ package() {
( cd tools/usb/usbip ; ( cd tools/usb/usbip ;
make DESTDIR="$pkgdir" install; ) make DESTDIR="$pkgdir" install; )
# perf completion is wrongly installed in /etc/bash_completion.d # we only support bash completions in usr/share/bash-completion
mv "$pkgdir"/etc/bash_completion.d/* "$pkgdir"/usr/share/bash-completion/completions/ mv "$pkgdir"/etc/bash_completion.d/* "$pkgdir"/usr/share/bash-completion/completions/
rmdir "$pkgdir"/etc/bash_completion.d rmdir "$pkgdir"/etc/bash_completion.d
install -Dm755 "$srcdir"/cpupower.initd "$pkgdir"/etc/init.d/cpupower
install -Dm644 "$srcdir"/cpupower.confd "$pkgdir"/etc/conf.d/cpupower
install -Dm755 "$srcdir"/usbip.initd "$pkgdir"/etc/init.d/usbip
install -Dm644 "$srcdir"/usbip.confd "$pkgdir"/etc/conf.d/usbip
} }
cpupower() { cpupower() {
pkgdesc="Linux kernel tool to set CPU power features" pkgdesc="Linux kernel tool to set CPU power features"
depends="" depends=""
mkdir -p "$subpkgdir"/usr/sbin \
"$subpkgdir"/usr/bin \
"$subpkgdir"/usr/lib \
"$subpkgdir"/etc
mv "$pkgdir"/usr/bin/cpu* "$subpkgdir"/usr/bin/ amove \
mv "$pkgdir"/usr/sbin/cpu* "$subpkgdir"/usr/sbin/ usr/bin/cpu* \
mv "$pkgdir"/usr/lib/libcpu*.so.* "$subpkgdir"/usr/lib/ usr/sbin/cpu* \
mv "$pkgdir"/etc/cpu* "$subpkgdir"/etc/ usr/lib/libcpu*.so.* \
install -Dm755 "$srcdir"/$subpkgname.initd \ etc/cpu*
"$pkgdir"/etc/init.d/$subpkgname }
install -Dm644 "$srcdir"/$subpkgname.confd \
"$pkgdir"/etc/conf.d/$subpkgname cpupower_openrc() {
pkgdesc="Linux kernel tool to set CPU power features (OpenRC init scripts)"
depends=""
install_if="cpupower=$pkgver-r$pkgrel openrc"
amove \
etc/init.d/cpupower \
etc/conf.d/cpupower
} }
cpupower_bashcomp() { cpupower_bashcomp() {
pkgdesc="Bash completion for cpupower" pkgdesc="Bash completion for cpupower"
install_if="cpupower=$pkgver-r$pkgrel bash-completion" install_if="cpupower=$pkgver-r$pkgrel bash-completion"
mkdir -p "$subpkgdir"/usr/share/bash-completion/completions
mv "$pkgdir"/usr/share/bash-completion/completions/cpupower \ amove usr/share/bash-completion/completions/cpupower
"$subpkgdir"/usr/share/bash-completion/completions/
} }
usbip() { usbip() {
@ -129,33 +179,35 @@ usbip() {
replaces="usbip-utils" replaces="usbip-utils"
provides="usbip-utils=$pkgver-r$pkgrel" provides="usbip-utils=$pkgver-r$pkgrel"
depends="" depends=""
mkdir -p "$subpkgdir"/usr/sbin \
"$subpkgdir"/usr/lib \ amove \
"$subpkgdir"/usr/include/usbip \ usr/sbin/usb* \
"$subpkgdir"/etc usr/lib/libusb*
mv "$pkgdir"/usr/sbin/usb* "$subpkgdir"/usr/sbin }
mv "$pkgdir"/usr/lib/libusb* "$subpkgdir"/usr/lib
install -Dm755 "$srcdir"/usbip.initd "$pkgdir"/etc/init.d/usbip usbip_openrc() {
install -Dm644 "$srcdir"/usbip.confd "$pkgdir"/etc/conf.d/usbip pkgdesc="utilities for USB device sharing over IP network (OpenRC init scripts)"
depends=""
install_if="$pkgname-usbip=$pkgver-r$pkgrel openrc"
amove \
etc/init.d/usbip \
etc/conf.d/usbip
} }
perf() { perf() {
pkgdesc="Linux kernel performance auditing tool" pkgdesc="Linux kernel performance auditing tool"
depends="" depends="libtraceevent-plugins"
mkdir -p "$subpkgdir"/usr/bin "$subpkgdir"/usr/lib
mv "$pkgdir"/usr/bin/perf \ amove \
"$pkgdir"/usr/bin/trace \ usr/bin/perf \
"$subpkgdir"/usr/bin usr/bin/trace \
mv "$pkgdir"/usr/lib/traceevent \ usr/lib/perf \
"$pkgdir"/usr/lib/perf \ usr/libexec
"$subpkgdir"/usr/lib/
mv "$pkgdir"/usr/libexec "$subpkgdir"/usr/
# /usr/share/perf-core is apprently not installed on all arches # /usr/share/perf-core is apprently not installed on all arches
if [ -e "$pkgdir"/usr/share/perf-core ]; then if [ -e "$pkgdir"/usr/share/perf-core ]; then
mkdir -p "$subpkgdir"/usr/share amove usr/share/perf-core
mv "$pkgdir"/usr/share/perf-core \
"$subpkgdir"/usr/share/
fi fi
} }
@ -163,57 +215,54 @@ perf_bashcomp() {
replaces="$pkgname-bash-completion" # Backward compatibility replaces="$pkgname-bash-completion" # Backward compatibility
pkgdesc="Bash completion for perf" pkgdesc="Bash completion for perf"
install_if="perf=$pkgver-r$pkgrel bash-completion" install_if="perf=$pkgver-r$pkgrel bash-completion"
mkdir -p "$subpkgdir"/usr/share/bash-completion/completions
mv "$pkgdir"/usr/share/bash-completion/completions/perf \ amove usr/share/bash-completion/completions/perf
"$subpkgdir"/usr/share/bash-completion/completions/
} }
gpio() { gpio() {
pkgdesc="Linux kernel GPIO tools" pkgdesc="Linux kernel GPIO tools"
depends="" depends=""
mkdir -p "$subpkgdir"/usr/bin
mv "$pkgdir"/usr/bin/*gpio* "$subpkgdir"/usr/bin amove usr/bin/*gpio*
} }
iio() { iio() {
pkgdesc="Linux kernel IIO tools" pkgdesc="Linux kernel IIO tools"
depends="" depends=""
mkdir -p "$subpkgdir"/usr/bin
mv "$pkgdir"/usr/bin/*iio* "$subpkgdir"/usr/bin amove usr/bin/*iio*
} }
spi() { spi() {
pkgdesc="Linux kernel SPI tools" pkgdesc="Linux kernel SPI tools"
depends="" depends=""
mkdir -p "$subpkgdir"/usr/bin
mv "$pkgdir"/usr/bin/spi* "$subpkgdir"/usr/bin amove usr/bin/spi*
} }
tmon() { tmon() {
pkgdesc="Linux kernel thermal monitor tools" pkgdesc="Linux kernel thermal monitor tools"
replaces="tmon" replaces="tmon"
depends="" depends=""
mkdir -p "$subpkgdir"/usr/bin
mv "$pkgdir"/usr/bin/tmon "$subpkgdir"/usr/bin amove usr/bin/tmon
} }
bpftool() { bpftool() {
pkgdesc="Linux kernel bpf manipulation tool" pkgdesc="Linux kernel bpf manipulation tool"
mkdir -p "$subpkgdir"/usr/sbin
mv "$pkgdir"/usr/sbin/bpftool "$subpkgdir"/usr/sbin/ amove usr/sbin/bpftool
} }
bpftool_bashcomp() { bpftool_bashcomp() {
pkgdesc="Bash completion for bpftool" pkgdesc="Bash completion for bpftool"
install_if="bpftool=$pkgver-r$pkgrel bash-completion" install_if="bpftool=$pkgver-r$pkgrel bash-completion"
mkdir -p "$subpkgdir"/usr/share/bash-completion/completions
mv "$pkgdir"/usr/share/bash-completion/completions/bpftool \ amove usr/share/bash-completion/completions/bpftool
"$subpkgdir"/usr/share/bash-completion/completions/
} }
sha512sums=" sha512sums="
6ed2a73c2699d0810e54753715635736fc370288ad5ce95c594f2379959b0e418665cd71bc512a0273fe226fe90074d8b10d14c209080a6466498417a4fdda68 linux-6.1.tar.xz a01bee0b968b95183934fe3504516be7ef5811944a061f5aed05ecebaa27b5eb64e33232fd0a8dd622b3c8743bfe462ef7e464d381734d111a0ad6a6d9f66ddd linux-6.2.tar.xz
e4ad2541e2f4975ca206195f4410c05029091a98f647dd734bca157fcf57829ba13b0021c3dff8b457bea026ac97aa0d5ea4ab6a4aa63e8ca0dfb5fa457f907a patch-6.1.6.xz
a46e3a84b00a39a356618831d0ddfb7f0d10f0a3799d1307ba2cc832e73c01f8d637a4e801a6dd25025f6f13155c6ad8b836422ff72d365e51063ac0bf907f52 cpupower-libs.patch a46e3a84b00a39a356618831d0ddfb7f0d10f0a3799d1307ba2cc832e73c01f8d637a4e801a6dd25025f6f13155c6ad8b836422ff72d365e51063ac0bf907f52 cpupower-libs.patch
0657b461659e79c1926379aab30e7b7ab2d59eaf3e686f1dce468b79eb1320c188c14a0507361660abd2553bccffa9e149fa5b6e4d770d10c99bf5dafd2e05ee dt_lnk.patch 0657b461659e79c1926379aab30e7b7ab2d59eaf3e686f1dce468b79eb1320c188c14a0507361660abd2553bccffa9e149fa5b6e4d770d10c99bf5dafd2e05ee dt_lnk.patch
97ecfeaaaa8efca7af585316b843bf7be885e88095bbdfbf52bc9a96b14dc862435482781e205ea022ab208978aaa4aabb317354fab890ed514a5088ae5045c8 cpupower.initd 97ecfeaaaa8efca7af585316b843bf7be885e88095bbdfbf52bc9a96b14dc862435482781e205ea022ab208978aaa4aabb317354fab890ed514a5088ae5045c8 cpupower.initd