diff options
Diffstat (limited to 'meta/recipes-kernel/powertop')
4 files changed, 132 insertions, 32 deletions
diff --git a/meta/recipes-kernel/powertop/powertop/0001-src-fix-compatibility-with-ncurses-6.3.patch b/meta/recipes-kernel/powertop/powertop/0001-src-fix-compatibility-with-ncurses-6.3.patch new file mode 100644 index 0000000000..84b05ac971 --- /dev/null +++ b/meta/recipes-kernel/powertop/powertop/0001-src-fix-compatibility-with-ncurses-6.3.patch @@ -0,0 +1,52 @@ +From 76d3f0851520bc8488e432f423941f1e72cc7405 Mon Sep 17 00:00:00 2001 +From: Alexander Kanavin <alex@linutronix.de> +Date: Mon, 25 Oct 2021 17:47:23 +0200 +Subject: [PATCH] src: fix compatibility with ncurses 6.3 + +Upstream-Status: Submitted [https://github.com/fenrus75/powertop/pull/92] +Signed-off-by: Alexander Kanavin <alex@linutronix.de> +--- + src/devices/devfreq.cpp | 2 +- + src/display.cpp | 2 +- + src/lib.cpp | 2 +- + 3 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/src/devices/devfreq.cpp b/src/devices/devfreq.cpp +index 0509d0f..b194ac4 100644 +--- a/src/devices/devfreq.cpp ++++ b/src/devices/devfreq.cpp +@@ -297,7 +297,7 @@ void display_devfreq_devices(void) + df->fill_freq_utilization(j, buf); + strcat(fline, buf); + strcat(fline, "\n"); +- wprintw(win, fline); ++ wprintw(win, "%s", fline); + } + wprintw(win, "\n"); + } +diff --git a/src/display.cpp b/src/display.cpp +index 7131144..cc03919 100644 +--- a/src/display.cpp ++++ b/src/display.cpp +@@ -125,7 +125,7 @@ void show_tab(unsigned int tab) + + c = bottom_lines[tab_names[tab]].c_str(); + if (c && strlen(c) > 0) +- mvwprintw(bottom_line, 0,0, c); ++ mvwprintw(bottom_line, 0,0, "%s", c); + else + mvwprintw(bottom_line, 0, 0, + "<ESC> %s | <TAB> / <Shift + TAB> %s | ", _("Exit"), +diff --git a/src/lib.cpp b/src/lib.cpp +index 5e48f37..5cd1c4a 100644 +--- a/src/lib.cpp ++++ b/src/lib.cpp +@@ -583,7 +583,7 @@ void ui_notify_user_ncurses(const char *frmt, ...) + * buffer */ + vsnprintf(notify, UI_NOTIFY_BUFF_SZ - 1, frmt, list); + va_end(list); +- mvprintw(1, 0, notify); ++ mvprintw(1, 0, "%s", notify); + attroff(COLOR_PAIR(1)); + } + diff --git a/meta/recipes-kernel/powertop/powertop/0001-wakeup_xxx.h-include-limits.h.patch b/meta/recipes-kernel/powertop/powertop/0001-wakeup_xxx.h-include-limits.h.patch new file mode 100644 index 0000000000..7bfca8abfd --- /dev/null +++ b/meta/recipes-kernel/powertop/powertop/0001-wakeup_xxx.h-include-limits.h.patch @@ -0,0 +1,55 @@ +From 4c24fdd8e0a42359df7308155b2d43c28a5e02fd Mon Sep 17 00:00:00 2001 +From: Fabrice Fontaine <fontaine.fabrice@gmail.com> +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 <fontaine.fabrice@gmail.com> +Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> + +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 + diff --git a/meta/recipes-kernel/powertop/powertop_2.14.bb b/meta/recipes-kernel/powertop/powertop_2.14.bb new file mode 100644 index 0000000000..a2f30040b5 --- /dev/null +++ b/meta/recipes-kernel/powertop/powertop_2.14.bb @@ -0,0 +1,25 @@ +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" +LICENSE = "GPL-2.0-only" +LIC_FILES_CHKSUM = "file://COPYING;md5=12f884d2ae1ff87c09e5b7ccc2c4ca7e" + +SRC_URI = "git://github.com/fenrus75/powertop;protocol=https;branch=master \ + file://0001-wakeup_xxx.h-include-limits.h.patch \ + file://0001-src-fix-compatibility-with-ncurses-6.3.patch \ + " +SRCREV = "52f022f9bbe6e060fba11701d657a8d9762702ba" + +S = "${WORKDIR}/git" + +LDFLAGS:append = " -pthread" + +inherit autotools gettext pkgconfig bash-completion + +inherit update-alternatives +ALTERNATIVE:${PN} = "powertop" +ALTERNATIVE_TARGET[powertop] = "${sbindir}/powertop" +ALTERNATIVE_LINK_NAME[powertop] = "${sbindir}/powertop" +ALTERNATIVE_PRIORITY = "100" diff --git a/meta/recipes-kernel/powertop/powertop_2.7.bb b/meta/recipes-kernel/powertop/powertop_2.7.bb deleted file mode 100644 index 5ba07e9ab9..0000000000 --- a/meta/recipes-kernel/powertop/powertop_2.7.bb +++ /dev/null @@ -1,32 +0,0 @@ -SUMMARY = "Power usage tool" -DESCRIPTION = "Linux tool to diagnose issues with power consumption and power management." -HOMEPAGE = "http://01.org/powertop/" -BUGTRACKER = "http://bugzilla.lesswatts.org/" -DEPENDS = "ncurses libnl pciutils" -LICENSE = "GPLv2" -LIC_FILES_CHKSUM = "file://COPYING;md5=12f884d2ae1ff87c09e5b7ccc2c4ca7e" - -SRC_URI = "http://01.org/sites/default/files/downloads/powertop/powertop-${PV}.tar.gz" - -SRC_URI[md5sum] = "e0d686e47daaf7e9d89031f7763432ef" -SRC_URI[sha256sum] = "8d4b1490e2baad4467c0ded3c423db4472dcbf7b2dd8f8f2a928f54047c678ca" - -inherit autotools gettext pkgconfig - -# we need to explicitly link with libintl in uClibc systems -EXTRA_LDFLAGS ?= "" -EXTRA_LDFLAGS_libc-uclibc = "-lintl" -LDFLAGS += "${EXTRA_LDFLAGS}" - -# we do not want libncursesw if we can -do_configure_prepend() { - # configure.ac checks for delwin() in "ncursesw ncurses" so let's drop first one - sed -i -e "s/ncursesw//g" ${S}/configure.ac - mkdir -p ${B}/src/tuning/ -} - -inherit update-alternatives -ALTERNATIVE_${PN} = "powertop" -ALTERNATIVE_TARGET[powertop] = "${sbindir}/powertop" -ALTERNATIVE_LINK_NAME[powertop] = "${sbindir}/powertop" -ALTERNATIVE_PRIORITY = "100" |