Patchwork powertop: update to 2.0+git

login
register
mail settings
Submitter Koen Kooi
Date July 14, 2012, 9:59 a.m.
Message ID <1342259955-8875-1-git-send-email-koen@dominion.thruhere.net>
Download mbox | patch
Permalink /patch/32065/
State New
Headers show

Comments

Koen Kooi - July 14, 2012, 9:59 a.m.
The recipe is autotools based now, the COPYING file was replaced with the complete GPLv2 license text.
No more 'lspci' needed ad runtime, but zlib and libnl are needed nowadays.
Add 2 patches, one to fix cross builds and one from Linaro to fix C state parsing on !x86.

Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
---
 .../stub_out_the_ncurses_calls_in_dump_mode.patch  |   33 ----
 ...csstoh-replace-with-a-simple-shell-script.patch |  182 ++++++++++++++++++++
 .../0002-fix-cpuidle-state-name-parsing.patch      |   29 ++++
 meta/recipes-kernel/powertop/powertop_1.13.bb      |   42 -----
 meta/recipes-kernel/powertop/powertop_2.0.bb       |   35 ++++
 5 files changed, 246 insertions(+), 75 deletions(-)
 delete mode 100644 meta/recipes-kernel/powertop/powertop-1.13/stub_out_the_ncurses_calls_in_dump_mode.patch
 create mode 100644 meta/recipes-kernel/powertop/powertop/0001-csstoh-replace-with-a-simple-shell-script.patch
 create mode 100644 meta/recipes-kernel/powertop/powertop/0002-fix-cpuidle-state-name-parsing.patch
 delete mode 100644 meta/recipes-kernel/powertop/powertop_1.13.bb
 create mode 100644 meta/recipes-kernel/powertop/powertop_2.0.bb
Koen Kooi - July 14, 2012, 11:46 a.m.
Op 14 jul. 2012, om 11:59 heeft Koen Kooi het volgende geschreven:

> The recipe is autotools based now, the COPYING file was replaced with the complete GPLv2 license text.
> No more 'lspci' needed ad runtime, but zlib and libnl are needed nowadays.
> Add 2 patches, one to fix cross builds and one from Linaro to fix C state parsing on !x86.

Please ignore this one, it needs a few more patches to work properly on ARM.
Otavio Salvador - July 15, 2012, 9:25 p.m.
On Sat, Jul 14, 2012 at 6:59 AM, Koen Kooi <koen@dominion.thruhere.net> wrote:
> The recipe is autotools based now, the COPYING file was replaced with the complete GPLv2 license text.
> No more 'lspci' needed ad runtime, but zlib and libnl are needed nowadays.
> Add 2 patches, one to fix cross builds and one from Linaro to fix C state parsing on !x86.

Please add proper Upstream-Status for the patches; it is nice to have
those to track the pending patches.
Koen Kooi - July 16, 2012, 6:11 a.m.
Op 15 jul. 2012, om 23:25 heeft Otavio Salvador het volgende geschreven:

> On Sat, Jul 14, 2012 at 6:59 AM, Koen Kooi <koen@dominion.thruhere.net> wrote:
>> The recipe is autotools based now, the COPYING file was replaced with the complete GPLv2 license text.
>> No more 'lspci' needed ad runtime, but zlib and libnl are needed nowadays.
>> Add 2 patches, one to fix cross builds and one from Linaro to fix C state parsing on !x86.
> 
> Please add proper Upstream-Status for the patches; it is nice to have
> those to track the pending patches.

Isn't that field only used to put in "pending" and then backslap each other on doing such a good job?
Ross Burton - July 16, 2012, 8:47 a.m.
On 16 July 2012 07:11, Koen Kooi <koen@dominion.thruhere.net> wrote:
>> Please add proper Upstream-Status for the patches; it is nice to have
>> those to track the pending patches.
>
> Isn't that field only used to put in "pending" and then backslap each other on doing such a good job?

Personally I find it incredibly useful to differentiate between
patches that should be going upstream and patches that are OE-specific
for various reasons.

Ross
Richard Purdie - July 16, 2012, 9:59 a.m.
On Mon, 2012-07-16 at 08:11 +0200, Koen Kooi wrote:
> Op 15 jul. 2012, om 23:25 heeft Otavio Salvador het volgende geschreven:
> 
> > On Sat, Jul 14, 2012 at 6:59 AM, Koen Kooi <koen@dominion.thruhere.net> wrote:
> >> The recipe is autotools based now, the COPYING file was replaced with the complete GPLv2 license text.
> >> No more 'lspci' needed ad runtime, but zlib and libnl are needed nowadays.
> >> Add 2 patches, one to fix cross builds and one from Linaro to fix C state parsing on !x86.
> > 
> > Please add proper Upstream-Status for the patches; it is nice to have
> > those to track the pending patches.
> 
> Isn't that field only used to put in "pending" and then backslap each
> other on doing such a good job?

I think that having the combination of knowing where the patch came
from, a description of what it does and some idea of how hacky it is
makes a significant difference to anyone subsequently looking at the
patch.

Over time I also believe we can make a significant change in the amount
of patches we're carrying around and the field will help with that.

If you want a concrete real world example now, when upgrading a recipe,
if you see the string "backport", maybe along with a commit ID, it means
you have to do much less work in verifying it is no longer required. It
also helps me review things when I see people removing patches.

Cheers,

Richard
Koen Kooi - July 16, 2012, 10:33 a.m.
Op 16 jul. 2012, om 10:47 heeft Burton, Ross het volgende geschreven:

> On 16 July 2012 07:11, Koen Kooi <koen@dominion.thruhere.net> wrote:
>>> Please add proper Upstream-Status for the patches; it is nice to have
>>> those to track the pending patches.
>> 
>> Isn't that field only used to put in "pending" and then backslap each other on doing such a good job?
> 
> Personally I find it incredibly useful to differentiate between
> patches that should be going upstream and patches that are OE-specific
> for various reasons.

I'm not debating the usefulness of the U-S field, I'm debating the usefulness of using 'Pending' as a catch-all. I can do:

for patch in *.patch ; do
	echo "Upstream-Status: Pending" >> $patch
done

And it will get accepted, but is ultimately useless.

Anyway, I added proper U-S fields (not 'Pending') locally and will resubmit later this week.

regards,

Koen
Paul Eggleton - July 16, 2012, 10:36 a.m.
On Monday 16 July 2012 12:33:00 Koen Kooi wrote:
> Op 16 jul. 2012, om 10:47 heeft Burton, Ross het volgende geschreven:
> > On 16 July 2012 07:11, Koen Kooi <koen@dominion.thruhere.net> wrote:
> >>> Please add proper Upstream-Status for the patches; it is nice to have
> >>> those to track the pending patches.
> >> 
> >> Isn't that field only used to put in "pending" and then backslap each
> >> other on doing such a good job?> 
> > Personally I find it incredibly useful to differentiate between
> > patches that should be going upstream and patches that are OE-specific
> > for various reasons.
> 
> I'm not debating the usefulness of the U-S field, I'm debating the
> usefulness of using 'Pending' as a catch-all. I can do:
> 
> for patch in *.patch ; do
> 	echo "Upstream-Status: Pending" >> $patch
> done
> 
> And it will get accepted, but is ultimately useless.

No, it is not. It signifies that the patch is considered appropriate by the 
submitter for upstreaming.

Cheers,
Paul
Ross Burton - July 16, 2012, 10:37 a.m.
On 16 July 2012 11:33, Koen Kooi <koen@dominion.thruhere.net> wrote:
> I'm not debating the usefulness of the U-S field, I'm debating the usefulness of using 'Pending' as a catch-all. I can do:

In my eyes, "pending" means it's been submitted upstream somehow --
bug system, email, whatever.

Ross
Phil Blundell - July 16, 2012, 10:44 a.m.
On Mon, 2012-07-16 at 11:37 +0100, Burton, Ross wrote:
> On 16 July 2012 11:33, Koen Kooi <koen@dominion.thruhere.net> wrote:
> > I'm not debating the usefulness of the U-S field, I'm debating the usefulness of using 'Pending' as a catch-all. I can do:
> 
> In my eyes, "pending" means it's been submitted upstream somehow --
> bug system, email, whatever.

That is perhaps a recipe for confusion, since most people use
"submitted" to mean what you describe (and "pending" to mean something
different).  See:

http://wiki.openembedded.org/index.php/Commit_Patch_Message_Guidelines#Patch_Header_Recommendations

p.
Ross Burton - July 16, 2012, 10:48 a.m.
On 16 July 2012 11:44, Phil Blundell <philb@gnu.org> wrote:
> http://wiki.openembedded.org/index.php/Commit_Patch_Message_Guidelines#Patch_Header_Recommendations

I've now RTFM'd, thanks. :)

Ross
Koen Kooi - July 16, 2012, 11:25 a.m.
Op 16 jul. 2012, om 12:36 heeft Paul Eggleton het volgende geschreven:

> On Monday 16 July 2012 12:33:00 Koen Kooi wrote:
>> Op 16 jul. 2012, om 10:47 heeft Burton, Ross het volgende geschreven:
>>> On 16 July 2012 07:11, Koen Kooi <koen@dominion.thruhere.net> wrote:
>>>>> Please add proper Upstream-Status for the patches; it is nice to have
>>>>> those to track the pending patches.
>>>> 
>>>> Isn't that field only used to put in "pending" and then backslap each
>>>> other on doing such a good job?> 
>>> Personally I find it incredibly useful to differentiate between
>>> patches that should be going upstream and patches that are OE-specific
>>> for various reasons.
>> 
>> I'm not debating the usefulness of the U-S field, I'm debating the
>> usefulness of using 'Pending' as a catch-all. I can do:
>> 
>> for patch in *.patch ; do
>> 	echo "Upstream-Status: Pending" >> $patch
>> done
>> 
>> And it will get accepted, but is ultimately useless.
> 
> No, it is not. It signifies that the patch is considered appropriate by the 
> submitter for upstreaming.

That's not true according to http://wiki.openembedded.org/index.php/Commit_Patch_Message_Guidelines#Patch_Header_Recommendations :

  Pending
  - No determination has been made yet or not yet submitted to upstream

I've argued before that 'Pending' should be renamed to 'Unknown' (as we already do in the meta-openembedded layers) to avoid exactly this confusion.

regards,

Koen
Richard Purdie - July 16, 2012, 12:07 p.m.
On Mon, 2012-07-16 at 13:25 +0200, Koen Kooi wrote:
> Op 16 jul. 2012, om 12:36 heeft Paul Eggleton het volgende geschreven:
> 
> > On Monday 16 July 2012 12:33:00 Koen Kooi wrote:
> >> Op 16 jul. 2012, om 10:47 heeft Burton, Ross het volgende geschreven:
> >>> On 16 July 2012 07:11, Koen Kooi <koen@dominion.thruhere.net> wrote:
> >>>>> Please add proper Upstream-Status for the patches; it is nice to have
> >>>>> those to track the pending patches.
> >>>> 
> >>>> Isn't that field only used to put in "pending" and then backslap each
> >>>> other on doing such a good job?> 
> >>> Personally I find it incredibly useful to differentiate between
> >>> patches that should be going upstream and patches that are OE-specific
> >>> for various reasons.
> >> 
> >> I'm not debating the usefulness of the U-S field, I'm debating the
> >> usefulness of using 'Pending' as a catch-all. I can do:
> >> 
> >> for patch in *.patch ; do
> >> 	echo "Upstream-Status: Pending" >> $patch
> >> done
> >> 
> >> And it will get accepted, but is ultimately useless.
> > 
> > No, it is not. It signifies that the patch is considered appropriate by the 
> > submitter for upstreaming.
> 
> That's not true according to http://wiki.openembedded.org/index.php/Commit_Patch_Message_Guidelines#Patch_Header_Recommendations :
> 
>   Pending
>   - No determination has been made yet or not yet submitted to upstream
> 
> I've argued before that 'Pending' should be renamed to 'Unknown' (as we already do in the meta-openembedded layers) to avoid exactly this confusion.

I think when this was originally discussed "Pending" was taken to mean
that it had not been submitted upstream but probably could be which ties
in with Paul's view of this too. When it was documented, it looks like
the meaning got changed slightly.

The idea was the totally inappropriate ones had been filtered out and we
could generate a list of patches where attention could be focused with
reference to upstreaming. This is different to "Unknown".

I'd therefore suggest we update the meaning of Pending in the
documentation.

Cheers,

Richard
Otavio Salvador - July 16, 2012, 12:28 p.m.
On Mon, Jul 16, 2012 at 3:11 AM, Koen Kooi <koen@dominion.thruhere.net> wrote:
>
> Op 15 jul. 2012, om 23:25 heeft Otavio Salvador het volgende geschreven:
>
>> On Sat, Jul 14, 2012 at 6:59 AM, Koen Kooi <koen@dominion.thruhere.net> wrote:
>>> The recipe is autotools based now, the COPYING file was replaced with the complete GPLv2 license text.
>>> No more 'lspci' needed ad runtime, but zlib and libnl are needed nowadays.
>>> Add 2 patches, one to fix cross builds and one from Linaro to fix C state parsing on !x86.
>>
>> Please add proper Upstream-Status for the patches; it is nice to have
>> those to track the pending patches.
>
> Isn't that field only used to put in "pending" and then backslap each other on doing such a good job?

From what I read, those are backports; so you can use Backport
[applied in version X.Y]
Koen Kooi - July 16, 2012, 1:22 p.m.
Op 16 jul. 2012, om 14:28 heeft Otavio Salvador het volgende geschreven:

> On Mon, Jul 16, 2012 at 3:11 AM, Koen Kooi <koen@dominion.thruhere.net> wrote:
>> 
>> Op 15 jul. 2012, om 23:25 heeft Otavio Salvador het volgende geschreven:
>> 
>>> On Sat, Jul 14, 2012 at 6:59 AM, Koen Kooi <koen@dominion.thruhere.net> wrote:
>>>> The recipe is autotools based now, the COPYING file was replaced with the complete GPLv2 license text.
>>>> No more 'lspci' needed ad runtime, but zlib and libnl are needed nowadays.
>>>> Add 2 patches, one to fix cross builds and one from Linaro to fix C state parsing on !x86.
>>> 
>>> Please add proper Upstream-Status for the patches; it is nice to have
>>> those to track the pending patches.
>> 
>> Isn't that field only used to put in "pending" and then backslap each other on doing such a good job?
> 
> From what I read, those are backports; so you can use Backport
> [applied in version X.Y]

No, they were pulled of the powertop mailinglist and git-am'ed :)
Otavio Salvador - July 16, 2012, 1:34 p.m.
On Mon, Jul 16, 2012 at 10:22 AM, Koen Kooi <koen@dominion.thruhere.net> wrote:
>> From what I read, those are backports; so you can use Backport
>> [applied in version X.Y]
>
> No, they were pulled of the powertop mailinglist and git-am'ed :)

So it is pending.
Koen Kooi - July 16, 2012, 1:40 p.m.
Op 16 jul. 2012, om 15:34 heeft Otavio Salvador het volgende geschreven:

> On Mon, Jul 16, 2012 at 10:22 AM, Koen Kooi <koen@dominion.thruhere.net> wrote:
>>> From what I read, those are backports; so you can use Backport
>>> [applied in version X.Y]
>> 
>> No, they were pulled of the powertop mailinglist and git-am'ed :)
> 
> So it is pending.

If a response from the maintainer saying "rejected" means "pending", then yes.
Otavio Salvador - July 16, 2012, 3:23 p.m.
On Mon, Jul 16, 2012 at 10:40 AM, Koen Kooi <koen@dominion.thruhere.net> wrote:
>> On Mon, Jul 16, 2012 at 10:22 AM, Koen Kooi <koen@dominion.thruhere.net> wrote:
>>>> From what I read, those are backports; so you can use Backport
>>>> [applied in version X.Y]
>>>
>>> No, they were pulled of the powertop mailinglist and git-am'ed :)
>>
>> So it is pending.
>
> If a response from the maintainer saying "rejected" means "pending", then yes.

So put Rejected.

It is important to track the status, idependently of which status is it.

Patch

diff --git a/meta/recipes-kernel/powertop/powertop-1.13/stub_out_the_ncurses_calls_in_dump_mode.patch b/meta/recipes-kernel/powertop/powertop-1.13/stub_out_the_ncurses_calls_in_dump_mode.patch
deleted file mode 100644
index ae4cf5d..0000000
--- a/meta/recipes-kernel/powertop/powertop-1.13/stub_out_the_ncurses_calls_in_dump_mode.patch
+++ /dev/null
@@ -1,33 +0,0 @@ 
-Upstream-Status: Inappropriate [this patch is 1.13 specific and 2.0 will be coming.]
-
-Running PowerTop in Poky in dump mode (with --dump) always ends with a
-segmentation fault.
-
-The cause is: in dump mode, setup_windows() is not invoked so the
-*_window variables, like cstate_window, are still NULL; later in
-main() -> show_cstates(), the functions, like wrefresh(), will trigger
-segfault.
-
-After discussing in PowerTop mailling list, I think the right solution is
-we should stub out the ncurses calls in dump mode.
-
-(The patch was also sent to upstream PowerTop mailling list.)
-
-Signed-off-by Dexuan Cui <dexuan.cui@intel.com>, 2010-08-20
-(this patch is licensed under GPLv2)
-
---- a/display.c
-+++ b/display.c
-@@ -44,6 +44,12 @@
- static WINDOW *status_bar_window;
- 
- #define print(win, y, x, fmt, args...) do { if (dump) printf(fmt, ## args); else mvwprintw(win, y, x, fmt, ## args); } while (0)
-+#define wattrset(win, c) do { if (!dump ) wattrset(win, c); } while (0)
-+#define wbkgd(win, c) do { if (!dump ) wbkgd(win, c); } while (0)
-+#define werase(win) do { if (!dump ) werase(win); } while (0)
-+#define wrefresh(win) do { if (!dump ) wrefresh(win); } while (0)
-+#define wattron(win, a) do { if (!dump ) wattron(win, a); } while (0)
-+#define wattroff(win, a) do { if (!dump ) wattroff(win, a); } while (0)
- 
- char status_bar_slots[10][40];
- 
diff --git a/meta/recipes-kernel/powertop/powertop/0001-csstoh-replace-with-a-simple-shell-script.patch b/meta/recipes-kernel/powertop/powertop/0001-csstoh-replace-with-a-simple-shell-script.patch
new file mode 100644
index 0000000..4fe7337
--- /dev/null
+++ b/meta/recipes-kernel/powertop/powertop/0001-csstoh-replace-with-a-simple-shell-script.patch
@@ -0,0 +1,182 @@ 
+From af97815d18455f8ebdc65ee1dd925bfe06f9a6fc Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Fri, 1 Jun 2012 14:27:16 -0400
+Subject: [PATCH 1/2] csstoh: replace with a simple shell script
+
+Having a compiled program that runs during build time is a pita for
+cross-compiling.  Rather than make that work, convert it to a simple
+shell script since that's all this is really doing.  No need for C
+code here.
+
+Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+---
+ .gitignore      |   12 +---------
+ src/Makefile.am |    5 ++--
+ src/csstoh      |   18 +++++++++++++++
+ src/csstoh.c    |   69 -------------------------------------------------------
+ 4 files changed, 21 insertions(+), 83 deletions(-)
+ create mode 100755 src/csstoh
+ delete mode 100644 src/csstoh.c
+
+diff --git a/.gitignore b/.gitignore
+index 5534072..1f6906f 100644
+--- a/.gitignore
++++ b/.gitignore
+@@ -4,6 +4,7 @@
+ *.html
+ *.csv
+ *.powertop
++.deps
+ ChangeLog
+ Makefile.in
+ aclocal.m4
+@@ -22,7 +23,6 @@ config.h
+ config.log
+ config.status
+ libtool
+-pevent/.deps/
+ pevent/Makefile
+ pevent/Makefile.in
+ po/Makefile
+@@ -39,18 +39,8 @@ po/*.gmo
+ po/stamp-po
+ src/powertop
+ src/css.h
+-src/csstoh
+ src/Makefile.in
+-src/.deps/
+ src/Makefile
+-src/calibrate/.deps/
+-src/cpu/.deps/
+-src/devices/.deps/
+-src/measurement/.deps/
+-src/parameters/.deps/
+-src/perf/.deps/
+-src/process/.deps/
+-src/tuning/.deps/
+ m4
+ *.dirstamp
+ *.lo
+diff --git a/src/Makefile.am b/src/Makefile.am
+index c77b2aa..e9d2a1e 100644
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -1,8 +1,7 @@
+ AUTOMAKE_OPTIONS = subdir-objects
+ ACLOCAL_AMFLAGS = -I ../m4 
+ 
+-noinst_PROGRAMS = csstoh
+-csstoh_SOURCES = csstoh.c 
++noinst_SCRIPTS = csstoh
+ 
+ sbin_PROGRAMS = powertop
+ nodist_powertop_SOURCES = css.h
+@@ -45,5 +44,5 @@ AM_LDFLAGS = $(LIBS) $(NCURSES_LIBS) $(PCIUTILS_LIBS) $(LIBNL_LIBS) $(LIBZ_LIBS)
+ BUILT_SOURCES = css.h
+ CLEANFILES = css.h
+ css.h: csstoh powertop.css
+-	./csstoh powertop.css css.h
++	$(SHELL) $(srcdir)/csstoh powertop.css css.h
+ 
+diff --git a/src/csstoh b/src/csstoh
+new file mode 100755
+index 0000000..51d1ec1
+--- /dev/null
++++ b/src/csstoh
+@@ -0,0 +1,18 @@
++#!/bin/sh
++
++in=$1
++out=$2
++
++(
++cat <<EOF
++#ifndef __INCLUDE_GUARD_CCS_H
++#define __INCLUDE_GUARD_CCS_H
++
++const char css[] =
++EOF
++sed -e 's:^:\t":' -e 's:$:\\n":' "${in}"
++cat <<EOF
++;
++#endif
++EOF
++) > "${out}"
+diff --git a/src/csstoh.c b/src/csstoh.c
+deleted file mode 100644
+index e6b1dcf..0000000
+--- a/src/csstoh.c
++++ /dev/null
+@@ -1,69 +0,0 @@
+-/*
+- * Copyright 2010, Intel Corporation
+- *
+- * This file is part of PowerTOP
+- *
+- * This program file is free software; you can redistribute it and/or modify it
+- * under the terms of the GNU General Public License as published by the
+- * Free Software Foundation; version 2 of the License.
+- *
+- * This program is distributed in the hope that it will be useful, but WITHOUT
+- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+- * for more details.
+- *
+- * You should have received a copy of the GNU General Public License
+- * along with this program in a file named COPYING; if not, write to the
+- * Free Software Foundation, Inc,
+- * 51 Franklin Street, Fifth Floor,
+- * Boston, MA 02110-1301 USA
+- * or just google for it.
+- *
+- * Authors:
+- *	Arjan van de Ven <arjan@linux.intel.com>
+- */
+-
+-#include <stdio.h>
+-#include <stdlib.h>
+-#include <errno.h>
+-#include <string.h>
+-
+-int main(int argc, char **argv)
+-{
+-	FILE *in, *out;
+-	char line[4096];
+-
+-	if (argc < 2) {
+-		printf("Usage:  csstoh cssfile header.h \n");
+-		exit(0);
+-	}
+-	in = fopen(argv[1], "rm");
+-	if (!in) {
+-		printf("Failed to open input file %s (%s) \n", argv[1], strerror(errno));
+-		exit(0);
+-	}
+-	out = fopen(argv[2], "wm");
+-	if (!out) {
+-		printf("Failed to open output file %s (%s) \n", argv[1], strerror(errno));
+-		exit(0);
+-	}
+-
+-	fprintf(out, "#ifndef __INCLUDE_GUARD_CCS_H\n");
+-	fprintf(out, "#define __INCLUDE_GUARD_CCS_H\n");
+-	fprintf(out, "\n");
+-	fprintf(out, "const char css[] = \n");
+-
+-	while (!feof(in)) {
+-		char *c;
+-		if (fgets(line, 4095, in) == NULL)
+-			break;
+-		c = strchr(line, '\n');
+-		if (c) *c = 0;
+-		fprintf(out, "\t\"%s\\n\"\n", line);
+-	}	
+-	fprintf(out, ";\n");	
+-	fprintf(out, "#endif\n");
+-	fclose(out);
+-	fclose(in);
+-	return EXIT_SUCCESS;
+-}
+-- 
+1.7.10
+
diff --git a/meta/recipes-kernel/powertop/powertop/0002-fix-cpuidle-state-name-parsing.patch b/meta/recipes-kernel/powertop/powertop/0002-fix-cpuidle-state-name-parsing.patch
new file mode 100644
index 0000000..4a26b6f
--- /dev/null
+++ b/meta/recipes-kernel/powertop/powertop/0002-fix-cpuidle-state-name-parsing.patch
@@ -0,0 +1,29 @@ 
+From 8ab3bbf6b4c099075fe179bc4512c80a1ffac2c3 Mon Sep 17 00:00:00 2001
+From: Rajagopal Venkat <rajagopal.venkat@linaro.org>
+Date: Mon, 18 Jun 2012 11:06:25 +0530
+Subject: [PATCH 2/2] fix cpuidle state name parsing
+
+parse cpuidle C state based on sysfs file entry(stateX)
+instead of state name/description
+
+Signed-off-by: Rajagopal Venkat <rajagopal.venkat@linaro.org>
+---
+ src/cpu/abstract_cpu.cpp |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/cpu/abstract_cpu.cpp b/src/cpu/abstract_cpu.cpp
+index cd4eba0..72969fc 100644
+--- a/src/cpu/abstract_cpu.cpp
++++ b/src/cpu/abstract_cpu.cpp
+@@ -147,7 +147,7 @@ void abstract_cpu::insert_cstate(const char *linux_name, const char *human_name,
+ 	strcpy(state->linux_name, linux_name);
+ 	strcpy(state->human_name, human_name);
+ 
+-	c = human_name;
++	c = linux_name;
+ 	while (*c) {
+ 		if (strcmp(linux_name, "active")==0) {
+ 			state->line_level = LEVEL_C0;
+-- 
+1.7.10
+
diff --git a/meta/recipes-kernel/powertop/powertop_1.13.bb b/meta/recipes-kernel/powertop/powertop_1.13.bb
deleted file mode 100644
index b4f45dd..0000000
--- a/meta/recipes-kernel/powertop/powertop_1.13.bb
+++ /dev/null
@@ -1,42 +0,0 @@ 
-SUMMARY = "Power usage tool"
-DESCRIPTION = "PowerTOP, a tool that helps you find what software is using the most power."
-HOMEPAGE = "http://www.lesswatts.org/"
-BUGTRACKER = "http://bugzilla.lesswatts.org/"
-
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
-
-DEPENDS = "virtual/libintl ncurses"
-
-# powertop 1.13 needs lspci
-RDEPENDS_${PN} = "pciutils"
-
-PR = "r3"
-
-SRC_URI = "http://www.lesswatts.org/projects/powertop/download/powertop-${PV}.tar.gz \
-           file://stub_out_the_ncurses_calls_in_dump_mode.patch \
-          "
-
-SRC_URI[md5sum] = "78aa17c8f55178004223bf236654298e"
-SRC_URI[sha256sum] = "2bc866089496877dd26d2d316ad5763ab8ecb5e28aefba44bc5d355dcdc58d98"
-
-CFLAGS += "${LDFLAGS}"
-EXTRA_OEMAKE = "VERSION=\"${PV}\" EXTRA_LIBS=${EXTRA_LIBS}"
-
-EXTRA_LIBS_libc-uclibc = "-lintl"
-
-inherit update-alternatives
-ALTERNATIVE_NAME = "powertop"
-ALTERNATIVE_PATH = "${bindir}/powertop"
-ALTERNATIVE_LINK = "${base_bindir}/powertop"
-ALTERNATIVE_PRIORITY = "100"
-
-do_configure() {
-	# We do not build ncurses with wide char support
-	sed -i -e 's:lncursesw:lncurses ${EXTRA_LIBS}:g' ${S}/Makefile
-}
-
-do_install() {
-	oe_runmake install DESTDIR=${D}
-}
-
diff --git a/meta/recipes-kernel/powertop/powertop_2.0.bb b/meta/recipes-kernel/powertop/powertop_2.0.bb
new file mode 100644
index 0000000..44befbb
--- /dev/null
+++ b/meta/recipes-kernel/powertop/powertop_2.0.bb
@@ -0,0 +1,35 @@ 
+SUMMARY = "Power usage tool"
+DESCRIPTION = "PowerTOP, a tool that helps you find what software is using the most power."
+HOMEPAGE = "https://01.org/powertop/"
+BUGTRACKER = "powertop@lists.01.org"
+
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=12f884d2ae1ff87c09e5b7ccc2c4ca7e"
+
+DEPENDS = "virtual/libintl ncurses zlib pciutils libnl"
+
+inherit autotools gettext
+
+PV = "2.0+git"
+
+SRC_URI = "git://github.com/fenrus75/powertop.git \
+           file://0001-csstoh-replace-with-a-simple-shell-script.patch \
+           file://0002-fix-cpuidle-state-name-parsing.patch \
+          "
+SRCREV = "ccb84e2aaca18f3bca83288c48d9806fdf3fef4d"
+
+S = "${WORKDIR}/git"
+
+# Somehow pkg-config doesn't add the genl libs to LIBS, fix up manually
+do_configure_append() {
+	for i in $(find ${S} -name "Makefile") ; do
+		sed -i -e 's:-lnl:-lnl -lnl-genl:g' $i
+	done
+}
+
+inherit update-alternatives
+ALTERNATIVE_NAME = "powertop"
+ALTERNATIVE_PATH = "${bindir}/powertop"
+ALTERNATIVE_LINK = "${base_bindir}/powertop"
+ALTERNATIVE_PRIORITY = "100"
+