Commit 0adc0e24 authored by Steven Noonan's avatar Steven Noonan Committed by Thomas Petazzoni
Browse files

powertop: new package



[Thomas:
  - fix commit title
  - powertop wants libintl unconditionally, so make sure
    BR2_PACKAGE_GETTEXT is selected when BR2_NEEDS_GETTEXT is set, and
    add gettext to the dependencies.
  - add missing comment about thread dependency.
  - add missing dependency on host-pkgconf, without which powertop
    cannot find libnl.
  - patch src/Makefile.am to not pass -fstack-protector, which fails
    to build if the toolchain does not have SSP support.
  - rename patch powertop-autotune.patch to confirm to the patch
    naming convention.]

Signed-off-by: default avatarSteven Noonan <steven@uplinklabs.net>
Signed-off-by: default avatarThomas Petazzoni <thomas.petazzoni@free-electrons.com>
parent 4c6bc6f2
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -364,6 +364,7 @@ endif
	source "package/pciutils/Config.in"
	source "package/picocom/Config.in"
	source "package/pifmrds/Config.in"
	source "package/powertop/Config.in"
	source "package/pps-tools/Config.in"
	source "package/read-edid/Config.in"
	source "package/rng-tools/Config.in"
+15 −0
Original line number Diff line number Diff line
Patch pulled from https://projects.archlinux.org/svntogit/community.git/tree/trunk?h=packages/powertop&id=37469c47b885c50365f57044e4ad72e0e3512b91

Fixes a use-after-close bug in create_all_devfreq_devices().

Signed-off-by: Steven Noonan <steven@uplinklabs.net>

--- a/src/devices/devfreq.cpp
+++ b/src/devices/devfreq.cpp
@@ -247,6 +247,7 @@ void create_all_devfreq_devices(void)
		fprintf(stderr, "Devfreq not enabled\n");
		is_enabled = false;
		closedir(dir);
+		dir = NULL;
		return;
	}
+18 −0
Original line number Diff line number Diff line
Do not pass -fstack-protector unconditionally

Using -fstack-protector only works when the toolchain has SSP support.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

Index: b/src/Makefile.am
===================================================================
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -127,7 +127,6 @@
 	-Wformat \
 	-Wshadow \
 	-fno-omit-frame-pointer \
-	-fstack-protector \
 	$(GLIB2_CFLAGS) \
 	$(LIBNL_CFLAGS) \
 	$(NCURSES_CFLAGS) \
+18 −0
Original line number Diff line number Diff line
config BR2_PACKAGE_POWERTOP
	bool "powertop"
	# pciutils dependency
	depends on !BR2_bfin
	# libnl dependency
	depends on BR2_TOOLCHAIN_HAS_THREADS
	select BR2_PACKAGE_NCURSES
	select BR2_PACKAGE_PCIUTILS
	select BR2_PACKAGE_LIBNL
	select BR2_PACKAGE_GETTEXT if BR2_NEEDS_GETTEXT
	help
	  A tool to diagnose issues with power consumption and power management

	  https://01.org/powertop/

comment "powertop needs a toolchain w/ threads"
	depends on !BR2_bfin
	depends on !BR2_TOOLCHAIN_HAS_THREADS
+2 −0
Original line number Diff line number Diff line
# Locally-generated hash
sha256	8d4b1490e2baad4467c0ded3c423db4472dcbf7b2dd8f8f2a928f54047c678ca	powertop-2.7.tar.gz
Loading