diff --git a/srcpkgs/linux-tools/patches/musl.patch b/srcpkgs/linux-tools/patches/musl.patch new file mode 100644 index 00000000000..740607a8f7e --- /dev/null +++ b/srcpkgs/linux-tools/patches/musl.patch @@ -0,0 +1,32 @@ +--- tools/include/uapi/linux/perf_event.h.orig ++++ tools/include/uapi/linux/perf_event.h +@@ -14,6 +14,7 @@ + #ifndef _UAPI_LINUX_PERF_EVENT_H + #define _UAPI_LINUX_PERF_EVENT_H + ++#include + #include + #include + #include +--- tools/power/x86/turbostat/turbostat.c.orig ++++ tools/power/x86/turbostat/turbostat.c +@@ -43,6 +43,7 @@ + #include + #include + #include ++#include + + char *proc_stat = "/proc/stat"; + FILE *outf; +--- tools/thermal/tmon/tmon.h.orig ++++ tools/thermal/tmon/tmon.h +@@ -19,6 +19,9 @@ + #ifndef TMON_H + #define TMON_H + ++#include ++#include ++ + #define MAX_DISP_TEMP 125 + #define MAX_CTRL_TEMP 105 + #define MIN_CTRL_TEMP 40 diff --git a/srcpkgs/linux-tools/patches/turbostat.patch b/srcpkgs/linux-tools/patches/turbostat.patch new file mode 100644 index 00000000000..a060eaa1cd7 --- /dev/null +++ b/srcpkgs/linux-tools/patches/turbostat.patch @@ -0,0 +1,20 @@ +--- tools/power/x86/turbostat/Makefile.orig ++++ tools/power/x86/turbostat/Makefile +@@ -8,13 +8,13 @@ + endif + + turbostat : turbostat.c +-CFLAGS += -Wall +-CFLAGS += -DMSRHEADER='"../../../../arch/x86/include/asm/msr-index.h"' +-CFLAGS += -DINTEL_FAMILY_HEADER='"../../../../arch/x86/include/asm/intel-family.h"' ++override CFLAGS += -Wall ++override CFLAGS += -DMSRHEADER='"../../../../arch/x86/include/asm/msr-index.h"' ++override CFLAGS += -DINTEL_FAMILY_HEADER='"../../../../arch/x86/include/asm/intel-family.h"' + + %: %.c + @mkdir -p $(BUILD_OUTPUT) +- $(CC) $(CFLAGS) $< -o $(BUILD_OUTPUT)/$@ ++ $(CC) $(CFLAGS) $< -o $(BUILD_OUTPUT)/$@ $(LDFLAGS) + + .PHONY : clean + clean : diff --git a/srcpkgs/linux-tools/template b/srcpkgs/linux-tools/template index 7376a87c06c..716b83f5c97 100644 --- a/srcpkgs/linux-tools/template +++ b/srcpkgs/linux-tools/template @@ -1,29 +1,29 @@ # Template file for 'linux-tools' pkgname=linux-tools -version=4.9 -revision=2 +version=4.12 +revision=1 build_style=meta wrksrc="linux-${version}" short_desc="Linux kernel tools meta-pkg" hostmakedepends="flex perl asciidoc xmlto python automake libtool" makedepends="pciutils-devel python-devel libglib-devel libsysfs-devel elfutils-devel libunwind-devel binutils-devel zlib-devel slang-devel - eudev-libudev-devel liblzma-devel libressl-devel" + eudev-libudev-devel liblzma-devel libressl-devel ncurses-devel" depends="cpupower-${version}_${revision} perf-${version}_${revision} usbip-${version}_${revision}" maintainer="Juan RP " license="GPL-2" homepage="https://www.kernel.org" distfiles="${KERNEL_SITE}/kernel/v4.x/linux-${version}.tar.xz" -checksum=029098dcffab74875e086ae970e3828456838da6e0ba22ce3f64ef764f3d7f1a +checksum=a45c3becd4d08ce411c14628a949d08e2433d8cdeca92036c7013980e93858ab -subpackages="cpupower libcpupower libcpupower-devel libusbip libusbip-devel usbip perf freefall" +subpackages="cpupower libcpupower libcpupower-devel libusbip libusbip-devel usbip perf freefall tmon" CFLAGS="-Wno-error" case "$XBPS_TARGET_MACHINE" in i686*|x86_64*) makedepends+=" libnuma-devel" - depends+=" x86_energy_perf_policy>=${version}" - subpackages+=" x86_energy_perf_policy" + depends+=" x86_energy_perf_policy>=${version} turbostat>=${version}" + subpackages+=" x86_energy_perf_policy turbostat" ;; esac @@ -32,6 +32,7 @@ nocross=yes post_extract() { sed -i 's/\$(LIBS)/& $(LDFLAGS)/' tools/power/cpupower/bench/Makefile sed -i 's/SIGCLD/SIGCHLD/g' tools/usb/usbip/src/usbipd.c + sed -i 's/^CFLAGS/override &/g' tools/thermal/tmon/Makefile } do_build() { cd ${wrksrc}/tools/perf @@ -48,6 +49,9 @@ do_build() { i686*|x86_64*) cd ${wrksrc}/tools/power/x86/x86_energy_perf_policy make ${makejobs} + + cd ${wrksrc}/tools/power/x86/turbostat + make ${makejobs} CC=$CC LD=$LD CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS" esac cd ${wrksrc}/tools/laptop/freefall @@ -59,6 +63,9 @@ do_build() { ./autogen.sh ./configure --prefix=/usr --sbindir=/usr/bin make ${makejobs} + + cd ${wrksrc}/tools/thermal/tmon + make ${makejobs} CC=$CC LD=$LD CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS" } do_install() { @@ -174,3 +181,19 @@ freefall_package() { vsv freefall } } +turbostat_package() { + short_desc="Report processor frequency and idle statistics" + pkg_install() { + cd ${wrksrc}/tools/power/x86/turbostat + vbin turbostat + vman turbostat.8 + } +} +tmon_package() { + short_desc="Monitoring and Testing Tool for Linux kernel thermal subsystem" + pkg_install() { + cd ${wrksrc}/tools/thermal/tmon + vbin tmon + vman tmon.8 + } +} diff --git a/srcpkgs/tmon b/srcpkgs/tmon new file mode 120000 index 00000000000..6594bfcc259 --- /dev/null +++ b/srcpkgs/tmon @@ -0,0 +1 @@ +linux-tools \ No newline at end of file diff --git a/srcpkgs/turbostat b/srcpkgs/turbostat new file mode 120000 index 00000000000..6594bfcc259 --- /dev/null +++ b/srcpkgs/turbostat @@ -0,0 +1 @@ +linux-tools \ No newline at end of file