1 # Maintainer: Sébastien Luttringer
7 'cgroup_event_listener'
16 'x86_energy_perf_policy'
22 url='https://www.kernel.org'
25 # split packages need all package dependencies set manually in makedepends
27 makedepends+=('asciidoc' 'xmlto')
29 makedepends+=('perl' 'python' 'python-setuptools' 'slang' 'elfutils' 'libunwind' 'numactl' 'audit' 'zstd' 'libcap')
31 makedepends+=('pciutils')
33 makedepends+=('glib2' 'sysfsutils' 'udev')
35 makedepends+=('ncurses')
37 makedepends+=('readline' 'zlib' 'libelf' 'libcap' 'python-docutils')
39 makedepends+=('libcap')
41 makedepends+=('llvm' 'clang')
43 source=("git+https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git#tag=v${pkgver//_/-}?signed"
44 # "https://cdn.kernel.org/pub/linux/kernel/v5.x/patch-$pkgver.1.xz"
49 'hv_fcopy_daemon.service'
50 'hv_kvp_daemon.service'
51 'hv_vss_daemon.service')
53 'ABAF11C65A2970B130ABE3C479BE3E4300411886' # Linus Torvalds
54 '647F28654894E3BD457199BE38DBBDC86092693E' # Greg Kroah-Hartman
57 '4fa509949d6863d001075fa3e8671eff2599c046d20c98bb4a70778595cd1c3f'
58 'b692f4859ed3fd9831a058a450a84d8c409bf7e3e45aac1c2896a14bb83f3d7a'
59 '42d2ec9f1d9cc255ee7945a27301478364ef482f5a6ddfc960189f03725ccec2'
60 '2e187734d8aec58a3046d79883510d779aa93fb3ab20bd3132c1a607ebe5498f'
61 '16855c197d2334f820cb190312a5a7fffe9165189db01344a957e582e39e17d8'
62 'b1315cb77a35454e1af9172f821a52e2a0cb18561be05a340d21cf337b01ae61'
63 '2d5e2f8d40b6f19bf2e1dead57ca105d72098fb0b418c09ff2e0cb91089710af')
68 # apply patch from the source array (should be a pacman feature)
70 for src in "${source[@]}"; do
74 [[ $src = *.patch || $src = patch-* ]] || continue
75 echo ":: Applying patch $src"
76 patch -p1 -N -i "$srcdir/$src"
82 pushd linux/tools/perf
83 make -f Makefile.perf \
86 perfexecdir=lib/perf \
87 EXTRA_CFLAGS=' -Wno-error=bad-function-cast -Wno-error=declaration-after-statement -Wno-error=switch-enum' \
90 PYTHON_CONFIG=python-config \
91 PERF_VERSION=$pkgver-$pkgrel \
96 pushd linux/tools/power/cpupower
97 make VERSION=$pkgver-$pkgrel
100 echo ':: x86_energy_perf_policy'
101 pushd linux/tools/power/x86/x86_energy_perf_policy
106 pushd linux/tools/usb/usbip
107 # Fix gcc compilation
108 sed -i 's,-Wall -Werror -Wextra,-fcommon,' configure.ac
110 ./configure --prefix=/usr --sbindir=/usr/bin
115 pushd linux/tools/thermal/tmon
119 echo ':: cgroup_event_listener'
120 pushd linux/tools/cgroup
125 pushd linux/tools/power/x86/turbostat
131 CFLAGS+=' -DKVP_SCRIPTS_PATH=\"/usr/lib/hyperv/kvp_scripts/\"' make
135 pushd linux/tools/bpf
136 # doesn't compile when we don't first compile bpftool in its own directory and
137 # man pages require to be also launch from the subdirectory
138 make -C bpftool all doc
139 # runqslower, require kernel binary path to build, skip it
144 pushd linux/tools/bootconfig
149 package_linux-tools-meta() {
150 pkgdesc='Linux kernel tools meta package'
155 'cgroup_event_listener'
163 'x86_energy_perf_policy'
171 pkgdesc='Linux kernel performance auditing tool'
172 depends=('glibc' 'perl' 'python' 'slang' 'elfutils' 'libunwind' 'binutils'
173 'numactl' 'audit' 'coreutils' 'glib2' 'xz' 'zlib' 'libelf' 'bash'
177 make -f Makefile.perf \
180 perfexecdir=lib/perf \
181 EXTRA_CFLAGS=' -Wno-error=bad-function-cast -Wno-error=declaration-after-statement -Wno-error=switch-enum' \
184 PYTHON_CONFIG=python-config \
185 PERF_VERSION=$pkgver-$pkgrel \
189 # add linker search path
190 mkdir "$pkgdir/etc/ld.so.conf.d"
191 echo '/usr/lib/perf' > "$pkgdir/etc/ld.so.conf.d/$pkgname.conf"
192 # move completion in new directory
193 install -Dm644 etc/bash_completion.d/perf usr/share/bash-completion/completions/perf
194 rm -r etc/bash_completion.d
195 # no exec on usr/share
196 find usr/share -type f -exec chmod a-x {} \;
199 #package_python-perf(){
200 # pkgdesc='Linux kernel performance auditing tool (python bindings)'
203 # cd linux/tools/perf
205 # make install-python_ext PYTHON=python DESTDIR="$pkgdir"
210 pkgdesc='Linux kernel tool to examine and tune power saving related features of your processor'
211 backup=('etc/default/cpupower')
212 depends=('glibc' 'bash' 'pciutils')
213 conflicts=('cpufrequtils')
214 replaces=('cpufrequtils')
215 install=cpupower.install
217 pushd linux/tools/power/cpupower
222 mandir='/usr/share/man' \
223 docdir='/usr/share/doc/cpupower' \
226 # install startup scripts
227 install -Dm 644 $pkgname.default "$pkgdir/etc/default/$pkgname"
228 install -Dm 644 $pkgname.service "$pkgdir/usr/lib/systemd/system/$pkgname.service"
229 install -Dm 755 $pkgname.systemd "$pkgdir/usr/lib/systemd/scripts/$pkgname"
232 package_x86_energy_perf_policy() {
233 pkgdesc='Read or write MSR_IA32_ENERGY_PERF_BIAS'
236 cd linux/tools/power/x86/x86_energy_perf_policy
237 install -Dm 755 x86_energy_perf_policy "$pkgdir/usr/bin/x86_energy_perf_policy"
238 install -Dm 644 x86_energy_perf_policy.8 "$pkgdir/usr/share/man/man8/x86_energy_perf_policy.8"
242 pkgdesc='An USB device sharing system over IP network'
243 depends=('glibc' 'glib2' 'sysfsutils' 'systemd-libs')
245 pushd linux/tools/usb/usbip
246 make install DESTDIR="$pkgdir"
249 install -Dm 644 /dev/null "$pkgdir/usr/lib/modules-load.d/$pkgname.conf"
250 printf 'usbip-core\nusbip-host\n' > "$pkgdir/usr/lib/modules-load.d/$pkgname.conf"
252 install -Dm 644 usbipd.service "$pkgdir/usr/lib/systemd/system/usbipd.service"
256 pkgdesc='Monitoring and Testing Tool for Linux kernel thermal subsystem'
257 depends=('glibc' 'ncurses')
259 cd linux/tools/thermal/tmon
260 make install INSTALL_ROOT="$pkgdir"
263 package_cgroup_event_listener() {
264 pkgdesc='Simple listener of cgroup events'
267 cd linux/tools/cgroup
268 install -Dm755 cgroup_event_listener "$pkgdir/usr/bin/cgroup_event_listener"
271 package_turbostat() {
272 pkgdesc='Report processor frequency and idle statistics'
273 depends=('glibc' 'libcap')
275 cd linux/tools/power/x86/turbostat
276 make install DESTDIR="$pkgdir"
280 pkgdesc='Hyper-V tools'
284 for _p in hv_fcopy_daemon hv_kvp_daemon hv_vss_daemon; do
285 install -Dm755 "$_p" "$pkgdir/usr/bin/$_p"
286 install -Dm644 "$srcdir/$_p.service" "$pkgdir/usr/lib/systemd/system/$_p.service"
288 install -dm755 "$pkgdir/usr/lib/hyperv/kvp_scripts"
293 depends=('glibc' 'readline' 'zlib' 'libelf' 'libcap')
296 # skip runsqlower until disabled in build
297 make -W runqslower_install install prefix=/usr DESTDIR="$pkgdir"
298 # fix bpftool hard written path
299 mv "$pkgdir"/usr/sbin/bpftool "$pkgdir"/usr/bin/bpftool
300 rmdir "$pkgdir"/usr/sbin
302 make -C bpftool doc-install prefix=/usr/share DESTDIR="$pkgdir"
305 package_bootconfig() {
306 pkgdesc='Apply, delete or show boot config to initrd'
309 cd linux/tools/bootconfig
310 install -dm755 "$pkgdir/usr/bin"
311 make install DESTDIR="$pkgdir"
314 # vim:set ts=2 sw=2 et: