Hi all,

this patch adds powertop:


http://www.lesswatts.org/projects/powertop/

Computer programs can make your computer use more power. PowerTOP is a
Linux tool that helps you find those programs that are misbehaving
while your computer is idle. The application that misbehaved the most
was the Linux kernel. However, as of version 2.6.21, the Linux kernel
went tickless, and no longer has a fixed 1000Hz timer tick. The result
(in theory) is huge power savings because the CPU stays in low power
mode for longer periods during system idle.


-Raphael

PS: this closes https://dev.openwrt.org/ticket/6570
diff -pruN utils.orig/powertop/Makefile utils/powertop/Makefile
--- utils.orig/powertop/Makefile	1970-01-01 01:00:00.000000000 +0100
+++ utils/powertop/Makefile	2010-01-27 17:17:22.920970066 +0100
@@ -0,0 +1,39 @@
+#
+# Copyright (C) 2006-2010 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=powertop
+PKG_VERSION:=1.11
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://www.lesswatts.org/projects/powertop/download/
+PKG_MD5SUM:=3498f5983c683c3a57dce7379a722082
+
+PKG_INSTALL:=1
+PKG_FIXUP:=libtool
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/powertop
+  SECTION:=utils
+  CATEGORY:=Utilities
+  TITLE:=PowerTOP
+  DEPENDS:=+libncurses
+  KCONFIG:=CONFIG_DEBUG_KERNEL=y CONFIG_TIMER_STATS=y
+  URL:=http://www.lesswatts.org/
+endef
+
+define Package/powertop/description
+  PowerTOP is a Linux tool that helps you find those programs that are misbehaving while your computer is idle.
+endef
+
+define Package/powertop/install
+	$(CP) $(PKG_INSTALL_DIR)/* $(1)
+endef
+
+$(eval $(call BuildPackage,powertop))
diff -pruN utils.orig/powertop/patches/100-no-wide-ncurses.patch utils/powertop/patches/100-no-wide-ncurses.patch
--- utils.orig/powertop/patches/100-no-wide-ncurses.patch	1970-01-01 01:00:00.000000000 +0100
+++ utils/powertop/patches/100-no-wide-ncurses.patch	2010-01-27 17:15:20.001469193 +0100
@@ -0,0 +1,12 @@
+diff -pruN powertop-1.11.orig/Makefile powertop-1.11/Makefile
+--- powertop-1.11.orig/Makefile	2010-01-25 18:15:58.136730412 +0100
++++ powertop-1.11/Makefile	2010-01-25 18:17:52.114555881 +0100
+@@ -20,7 +20,7 @@ OBJS = powertop.o config.o process.o mis
+ 	
+ 
+ powertop: $(OBJS) Makefile powertop.h
+-	$(CC) ${CFLAGS}  $(OBJS) -lncursesw -o powertop
++	$(CC) ${LDFLAGS}  $(OBJS) -lncurses -o powertop
+ 	@(cd po/ && $(MAKE))
+ 
+ powertop.1.gz: powertop.1
diff -pruN utils.orig/powertop/patches/200-no-gettext.patch utils/powertop/patches/200-no-gettext.patch
--- utils.orig/powertop/patches/200-no-gettext.patch	1970-01-01 01:00:00.000000000 +0100
+++ utils/powertop/patches/200-no-gettext.patch	2010-01-27 17:13:50.645223581 +0100
@@ -0,0 +1,50 @@
+diff -pruN powertop-1.11.orig/powertop.c powertop-1.11/powertop.c
+--- powertop-1.11.orig/powertop.c	2010-01-25 18:15:58.136730412 +0100
++++ powertop-1.11/powertop.c	2010-01-25 18:26:00.752868032 +0100
+@@ -30,7 +30,9 @@
+ #include <stdint.h>
+ #include <sys/types.h>
+ #include <dirent.h>
++#ifdef ENABLE_GETTEXT
+ #include <libintl.h>
++#endif
+ #include <ctype.h>
+ #include <assert.h>
+ #include <locale.h>
+@@ -783,9 +785,11 @@ int main(int argc, char **argv)
+ 	uint64_t cur_usage[8], cur_duration[8];
+ 	double wakeups_per_second = 0;
+ 
++#ifdef ENABLE_GETTEXT
+ 	setlocale (LC_ALL, "");
+ 	bindtextdomain ("powertop", "/usr/share/locale");
+ 	textdomain ("powertop");
++#endif
+ 
+  	while (1) {
+  		static struct option opts[] = {
+diff -pruN powertop-1.11.orig/powertop.h powertop-1.11/powertop.h
+--- powertop-1.11.orig/powertop.h	2010-01-25 18:15:58.136730412 +0100
++++ powertop-1.11/powertop.h	2010-01-25 18:24:03.928723362 +0100
+@@ -26,7 +26,9 @@
+ #ifndef __INCLUDE_GUARD_POWERTOP_H_
+ #define __INCLUDE_GUARD_POWERTOP_H_
+ 
++#ifdef ENABLE_GETTEXT
+ #include <libintl.h>
++#endif
+ 
+ struct line {
+ 	char	*string;
+@@ -86,7 +88,11 @@ extern suggestion_func *suggestion_activ
+         _x < _y ? _x : _y; })
+ 
+ 
++#ifdef ENABLE_GETTEXT
+ #define _(STRING)    gettext(STRING)
++#else
++#define _(STRING)    STRING
++#endif
+ 
+ 
+ #define PT_COLOR_DEFAULT    1
_______________________________________________
openwrt-devel mailing list
[email protected]
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to