powertop: upgrade to 2.16
cover powertop: upgrade to 2.16
Upgrade powertop from 2.15 to 2.16. This required importing libtracefs from meta-oe since upstream removed its internal libtraceevent copy and now links against the external libtracefs library.
The 2.16 release also switches to meson as the default build system [1]. The autotools build is broken (C++11 in configure.ac but the codebase uses C++20 features throughout). See upstream issue #124 [2] which has been open since 2025 with no fix.
A corresponding removal patch for meta-openembedded is needed once this series lands (libtracefs moving from meta-oe to oe-core).
[1] https://github.com/fenrus75/powertop/releases/tag/v2.16
[2] https://github.com/fenrus75/powertop/issues/124
Jaipaul Cheernam (2):
libtracefs: import recipe from meta-oe
powertop: upgrade 2.15 -> 2.16
meta/conf/distro/include/maintainers.inc | 1 +
...not-preserve-ownership-in-cp-command.patch | 28 ++++++++++
.../libtracefs/libtracefs_1.8.3.bb | 25 +++++++++
.../0001-wakeup_xxx.h-include-limits.h.patch | 55 -------------------
.../{powertop_2.15.bb => powertop_2.16.bb} | 14 ++---
5 files changed, 61 insertions(+), 62 deletions(-)
create mode 100644 meta/recipes-kernel/libtracefs/libtracefs/0001-makefile-Do-not-preserve-ownership-in-cp-command.patch
create mode 100644 meta/recipes-kernel/libtracefs/libtracefs_1.8.3.bb
delete mode 100644 meta/recipes-kernel/powertop/powertop/0001-wakeup_xxx.h-include-limits.h.patch
rename meta/recipes-kernel/powertop/{powertop_2.15.bb => powertop_2.16.bb} (67%)PATCH 1/2 libtracefs: import recipe from meta-oe
powertop 2.16 requires libtracefs (2b133ed [1]). Since powertop is in oe-core and libtraceevent is already here, bring libtracefs over.
[1] https://github.com/fenrus75/powertop/commit/2b133ed512c6852cf81cb98831bdfd585c0317bf
Changes from meta-oe version:
- fix SUMMARY
- add maintainer entry
--- meta/conf/distro/include/maintainers.inc | 1 + ...not-preserve-ownership-in-cp-command.patch | 28 +++++++++++++++++++ .../libtracefs/libtracefs_1.8.3.bb | 25 +++++++++++++++++ 3 files changed, 54 insertions(+) create mode 100644 meta/recipes-kernel/libtracefs/libtracefs/0001-makefile-Do-not-preserve-ownership-in-cp-command.patch create mode 100644 meta/recipes-kernel/libtracefs/libtracefs_1.8.3.bb
meta/conf/distro/include/maintainers.inc +1 -0
@@ -414,6 +414,7 @@ RECIPE_MAINTAINER:pn-libtool = "Robert Yang <[email protected]>" RECIPE_MAINTAINER:pn-libtool-cross = "Robert Yang <[email protected]>" RECIPE_MAINTAINER:pn-libtool-native = "Robert Yang <[email protected]>" RECIPE_MAINTAINER:pn-libtraceevent = "Bruce Ashfield <[email protected]>" +RECIPE_MAINTAINER:pn-libtracefs = "Unassigned <[email protected]>" RECIPE_MAINTAINER:pn-libtry-tiny-perl = "Tim Orling <[email protected]>" RECIPE_MAINTAINER:pn-libubootenv = "Stefano Babic <[email protected]>" RECIPE_MAINTAINER:pn-libucontext = "Khem Raj <[email protected]>"
meta/recipes-kernel/libtracefs/libtracefs/0001-makefile-Do-not-preserve-ownership-in-cp-command.patch new file +28 -0
@@ -0,0 +1,28 @@ +From ab6f78bfd6811c648ee71663cfc4dc8be151a519 Mon Sep 17 00:00:00 2001 +From: Khem Raj <[email protected]> +Date: Wed, 21 Dec 2022 22:50:56 -0800 +Subject: [PATCH] makefile: Do not preserve ownership in cp command + +Fixes +ERROR: libtracefs-1.6.3-r0 do_package_qa: QA Issue: libtracefs: /usr/lib/libtracefs.so is owned by uid 1000, which is the same as the user running bitbake. This may be due to host contamination [host-user-contaminated] + +Upstream-Status: Pending + +Signed-off-by: Khem Raj <[email protected]> +--- + Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Makefile b/Makefile +index 7f4f5c3..1ba7b9d 100644 +--- a/Makefile ++++ b/Makefile +@@ -296,7 +296,7 @@ endif # DESTDIR = "" + + install_libs: libs install_pkgconfig + $(Q)$(call do_install,$(LIBTRACEFS_SHARED),$(libdir_SQ)); \ +- cp -fpR $(LIB_INSTALL) $(DESTDIR)$(libdir_SQ) ++ cp --no-preserve=ownership --recursive $(LIB_INSTALL) $(DESTDIR)$(libdir_SQ) + $(Q)$(call do_install,$(src)/include/tracefs.h,$(includedir_SQ),644) + $(Q)$(call install_ld_config) +
meta/recipes-kernel/libtracefs/libtracefs_1.8.3.bb new file +25 -0
@@ -0,0 +1,25 @@ +# Copyright (C) 2022 Khem Raj <[email protected]> +# Released under the MIT license (see COPYING.MIT for the terms) + +SUMMARY = "Library to access the kernel tracefs directory" +HOMEPAGE = "https://git.kernel.org/pub/scm/libs/libtrace/libtracefs.git/" +LICENSE = "GPL-2.0-or-later AND LGPL-2.1-or-later" +LIC_FILES_CHKSUM = "file://LICENSES/GPL-2.0;md5=e6a75371ba4d16749254a51215d13f97 \ + file://LICENSES/LGPL-2.1;md5=b370887980db5dd40659b50909238dbd" +SECTION = "libs" +DEPENDS = "libtraceevent bison-native flex-native" + +SRCREV = "6fad6a14ba0d4c4b437d9e4eed7098d4bb07b4fc" +SRC_URI = "git://git.kernel.org/pub/scm/libs/libtrace/libtracefs.git;branch=${BPN};protocol=https \ + file://0001-makefile-Do-not-preserve-ownership-in-cp-command.patch \ + " + +inherit pkgconfig bash-completion + +do_compile:prepend() { + touch ${S}/src/sqlhist.tab.c +} + +do_install() { + oe_runmake install DESTDIR=${D} pkgconfig_dir=${libdir}/pkgconfig +}
PATCH 2/2 powertop: upgrade 2.15 -> 2.16
In reply to Jaipaul CheernamRelease: https://github.com/fenrus75/powertop/releases/tag/v2.16
CompareLog: https://github.com/fenrus75/powertop/compare/v2.15...v2.16
- switch to meson (upstream default since 2.16, 6a18fe2 [1])
- add libtracefs to DEPENDS (internal copy removed upstream, 2b133ed [2])
- use --bindir to keep installing to /usr/sbin
- drop autoconf-archive-native and LDFLAGS -pthread
- drop 0001-wakeup_xxx.h-include-limits.h.patch (PATH_MAX no longer used in those headers after upstream C++ modernization)
[1] https://github.com/fenrus75/powertop/commit/6a18fe2d933ad0f16ccc64b40e832f571319c518
[2] https://github.com/fenrus75/powertop/commit/2b133ed512c6852cf81cb98831bdfd585c0317bf
---
.../0001-wakeup_xxx.h-include-limits.h.patch | 55 -------------------
.../{powertop_2.15.bb => powertop_2.16.bb} | 14 ++---
2 files changed, 7 insertions(+), 62 deletions(-)
delete mode 100644 meta/recipes-kernel/powertop/powertop/0001-wakeup_xxx.h-include-limits.h.patch
rename meta/recipes-kernel/powertop/{powertop_2.15.bb => powertop_2.16.bb} (67%)meta/recipes-kernel/powertop/powertop/0001-wakeup_xxx.h-include-limits.h.patch deleted +0 -55
@@ -1,55 +0,0 @@ -From 4c24fdd8e0a42359df7308155b2d43c28a5e02fd Mon Sep 17 00:00:00 2001 -From: Fabrice Fontaine <[email protected]> -Date: Mon, 20 May 2019 20:25:00 +0200 -Subject: [PATCH] wakeup_xxx.h: include limits.h - -limits.h must be included to define PATH_MAX otherwise build will fail -on: - -In file included from wakeup/wakeup_ethernet.cpp:45:0: -wakeup/wakeup_ethernet.h:35:16: error: 'PATH_MAX' was not declared in this scope - char eth_path[PATH_MAX]; - -In file included from wakeup/wakeup_usb.cpp:45:0: -wakeup/wakeup_usb.h:35:16: error: 'PATH_MAX' was not declared in this scope - char usb_path[PATH_MAX]; - -Fixes: - - http://autobuild.buildroot.org/results/a0b3337cf4a827e6566f8b15b6bb180f0dcef7a3 - -Signed-off-by: Fabrice Fontaine <[email protected]> -Signed-off-by: Martin Jansa <[email protected]> - -Upstream-Status: Submitted [https://lists.01.org/pipermail/powertop/2019-May/002052.html] ---- - src/wakeup/wakeup_ethernet.h | 1 + - src/wakeup/wakeup_usb.h | 1 + - 2 files changed, 2 insertions(+) - -diff --git a/src/wakeup/wakeup_ethernet.h b/src/wakeup/wakeup_ethernet.h -index 682bf95..e0fa628 100644 ---- a/src/wakeup/wakeup_ethernet.h -+++ b/src/wakeup/wakeup_ethernet.h -@@ -25,6 +25,7 @@ - #ifndef _INCLUDE_GUARD_ETHERNET_WAKEUP_H - #define _INCLUDE_GUARD_ETHERNET_WAKEUP_H - -+#include <limits.h> - #include <vector> - - #include "wakeup.h" -diff --git a/src/wakeup/wakeup_usb.h b/src/wakeup/wakeup_usb.h -index f7a1f7e..15898e3 100644 ---- a/src/wakeup/wakeup_usb.h -+++ b/src/wakeup/wakeup_usb.h -@@ -25,6 +25,7 @@ - #ifndef _INCLUDE_GUARD_USB_WAKEUP_H - #define _INCLUDE_GUARD_USB_WAKEUP_H - -+#include <limits.h> - #include <vector> - - #include "wakeup.h" --- -2.20.1 -
meta/recipes-kernel/powertop/powertop_2.16.bb renamed from meta/recipes-kernel/powertop/powertop_2.15.bb +7 -7
@@ -2,21 +2,21 @@ SUMMARY = "Power usage tool" DESCRIPTION = "Linux tool to diagnose issues with power consumption and power management." HOMEPAGE = "https://01.org/powertop/" BUGTRACKER = "https://app.devzing.com/powertopbugs/bugzilla" -DEPENDS = "ncurses libnl pciutils autoconf-archive-native" +DEPENDS = "ncurses libnl pciutils libtracefs" LICENSE = "GPL-2.0-only" LIC_FILES_CHKSUM = "file://COPYING;md5=12f884d2ae1ff87c09e5b7ccc2c4ca7e" -SRC_URI = "git://github.com/fenrus75/powertop;protocol=https;branch=master;tag=v${PV} \ - file://0001-wakeup_xxx.h-include-limits.h.patch \ - " -SRCREV = "d51ad395436d4d1dcc3ca46e1519ffeb475bf651" +SRC_URI = "git://github.com/fenrus75/powertop;protocol=https;branch=master;tag=v${PV}" +SRCREV = "6147262e506c607036eaca4182ee491b61d06aa3" -LDFLAGS += "-pthread" +inherit meson gettext pkgconfig bash-completion -inherit autotools gettext pkgconfig bash-completion +# meson defaults to /usr/bin, keep /usr/sbin for backward compatibility +EXTRA_OEMESON = "--bindir=${sbindir}" inherit update-alternatives ALTERNATIVE:${PN} = "powertop" ALTERNATIVE_TARGET[powertop] = "${sbindir}/powertop" ALTERNATIVE_LINK_NAME[powertop] = "${sbindir}/powertop" ALTERNATIVE_PRIORITY = "100" +