* [ptxdist] [PATCH v2 1/2] pciutils: version bump 3.1.2 -> 3.2.1
2014-04-03 18:08 [ptxdist] [PATCH v2 0/2] powertop: add new version with new features Alexander Aring
@ 2014-04-03 18:08 ` Alexander Aring
2014-04-03 18:08 ` [ptxdist] [PATCH v2 2/2] powertop: version bump 1.11 -> 2.5 Alexander Aring
2014-04-04 9:56 ` [ptxdist] [PATCH v2 0/2] powertop: add new version with new features Michael Olbrich
2 siblings, 0 replies; 4+ messages in thread
From: Alexander Aring @ 2014-04-03 18:08 UTC (permalink / raw)
To: ptxdist; +Cc: Alexander Aring
This patch bumps the version of pciutils from 3.1.2 to 3.2.1.
Also cleanup the rule files:
- remove of the prepare rule.
- use of call ptx/ifdef instead ifdefs.
- Adding support for installing libpci.
- Adding support for libkmod feature.
- Add install of /usr/bin/update-pciids.
- fit the help messages in Kconfig in 80 char width.
- fix $(PTXCONF_ARCH_STRING)--linux to $(PTXCONF_ARCH_STRING)-linux
- Add new entry for installing PCIUTILS_TOOLS.
Signed-off-by: Alexander Aring <alex.aring@gmail.com>
---
rules/pciutils.in | 40 ++++++++++++++++++++++++++++++++--------
rules/pciutils.make | 34 ++++++++++++++++++++--------------
2 files changed, 52 insertions(+), 22 deletions(-)
diff --git a/rules/pciutils.in b/rules/pciutils.in
index 1c11d65..9f9e93e 100644
--- a/rules/pciutils.in
+++ b/rules/pciutils.in
@@ -1,24 +1,48 @@
## SECTION=shell_and_console
menuconfig PCIUTILS
- select ZLIB if PCIUTILS_COMPRESS
- depends on !BUSYBOX_LSPCI || ALLYES
+ select ZLIB if PCIUTILS_COMPRESS
+ select LIBKMOD if PCIUTILS_LIBKMOD
tristate
prompt "pciutils "
help
- The PCI Utilities package contains a library for portable access to PCI bus
- configuration registers and several utilities based on this library.
+ The PCI Utilities package contains a library for portable access
+ to PCI bus configuration registers and several utilities based on
+ this library.
if PCIUTILS
+config PCIUTILS_TOOLS
+ bool
+ default y
+ depends on !BUSYBOX_LSPCI || ALLYES
+ prompt "pciutils binaries"
+ help
+ This option install the pciutils binary tools lspci, setpci and
+ update-pciids.
+
+comment "busybox' lspci is selected"
+ depends on BUSYBOX_LSPCI
+
+config PCIUTILS_LIBKMOD
+ bool
+ prompt "libkmod support"
+ depends on PCIUTILS_TOOLS
+ help
+ Use libkmod to resolve kernel modules on Linux.
+
+config PCIUTILS_LIBPCI
+ bool
+ prompt "libpci support"
+ help
+ Generate and install the shared libpci library.
+
config PCIUTILS_COMPRESS
bool
default y
prompt "compress pci_ids"
help
- Save storage space by compressing the pci-id database. Access will be a
- little bit slower then.
+ Save storage space by compressing the pci-id database. Access will
+ be a little bit slower then.
endif
-comment "busybox' lspci is selected"
- depends on BUSYBOX_LSPCI
diff --git a/rules/pciutils.make b/rules/pciutils.make
index 1490a53..f2a3720 100644
--- a/rules/pciutils.make
+++ b/rules/pciutils.make
@@ -17,8 +17,8 @@ PACKAGES-$(PTXCONF_PCIUTILS) += pciutils
#
# Paths and names
#
-PCIUTILS_VERSION := 3.1.2
-PCIUTILS_MD5 := 46387fd7a18c33fbb5311fdb3ab9ea12
+PCIUTILS_VERSION := 3.2.1
+PCIUTILS_MD5 := 425b1acad6854cc2bbb06ac8e48e76fc
PCIUTILS := pciutils-$(PCIUTILS_VERSION)
PCIUTILS_SUFFIX := tar.bz2
PCIUTILS_URL := $(call ptx/mirror, KERNEL, ../software/utils/pciutils/$(PCIUTILS).$(PCIUTILS_SUFFIX))
@@ -29,27 +29,25 @@ PCIUTILS_DIR := $(BUILDDIR)/$(PCIUTILS)
# Prepare
# ----------------------------------------------------------------------------
-PCIUTILS_PATH := PATH=$(CROSS_PATH)
+PCIUTILS_CONF_TOOL := NO
PCIUTILS_COMPILE_ENV := $(CROSS_ENV)
-PCIUTILS_MAKEVARS := \
+PCIUTILS_MAKE_OPT := \
CROSS_COMPILE=$(COMPILER_PREFIX) \
PREFIX=/usr \
SBINDIR='\$$(PREFIX)/bin' \
- HOST=$(PTXCONF_ARCH_STRING)--linux \
+ HOST=$(PTXCONF_ARCH_STRING)-linux \
RELEASE=$(KERNEL_HEADER_VERSION) \
+ ZLIB=$(call ptx/ifdef,PTXCONF_PCIUTILS_COMPRESS,yes,no) \
+ LIBKMOD=$(call ptx/ifdef,PTXCONF_PCIUTILS_LIBKMOD,yes,no) \
+ SHARED=$(call ptx/ifdef,PTXCONF_PCIUTILS_LIBPCI,yes,no) \
STRIP= \
DNS=no
-ifdef PTXCONF_PCIUTILS_COMPRESS
-PCIUTILS_MAKEVARS += ZLIB=yes
-else
-PCIUTILS_MAKEVARS += ZLIB=no
-endif
-
-$(STATEDIR)/pciutils.prepare:
- @$(call targetinfo)
- @$(call touch)
+PCIUTILS_INSTALL_OPT := \
+ $(PCIUTILS_MAKE_OPT) \
+ install \
+ $(call ptx/ifdef,PTXCONF_PCIUTILS_LIBPCI,install-lib,)
# ----------------------------------------------------------------------------
# Target-Install
@@ -64,8 +62,16 @@ $(STATEDIR)/pciutils.targetinstall:
@$(call install_fixup, pciutils,AUTHOR,"Robert Schwebel <r.schwebel@pengutronix.de>")
@$(call install_fixup, pciutils,DESCRIPTION,missing)
+ifdef PTXCONF_PCIUTILS_TOOLS
@$(call install_copy, pciutils, 0, 0, 0755, -, /usr/bin/lspci)
@$(call install_copy, pciutils, 0, 0, 0755, -, /usr/bin/setpci)
+ @$(call install_copy, pciutils, 0, 0, 0755, -, /usr/bin/update-pciids)
+endif
+
+ifdef PTXCONF_PCIUTILS_LIBPCI
+ @$(call install_lib, pciutils, 0, 0, 0644, libpci)
+endif
+
ifdef PTXCONF_PCIUTILS_COMPRESS
@$(call install_copy, pciutils, 0, 0, 0644, -, \
/usr/share/pci.ids.gz, n)
--
1.9.1
--
ptxdist mailing list
ptxdist@pengutronix.de
^ permalink raw reply [flat|nested] 4+ messages in thread
* [ptxdist] [PATCH v2 2/2] powertop: version bump 1.11 -> 2.5
2014-04-03 18:08 [ptxdist] [PATCH v2 0/2] powertop: add new version with new features Alexander Aring
2014-04-03 18:08 ` [ptxdist] [PATCH v2 1/2] pciutils: version bump 3.1.2 -> 3.2.1 Alexander Aring
@ 2014-04-03 18:08 ` Alexander Aring
2014-04-04 9:56 ` [ptxdist] [PATCH v2 0/2] powertop: add new version with new features Michael Olbrich
2 siblings, 0 replies; 4+ messages in thread
From: Alexander Aring @ 2014-04-03 18:08 UTC (permalink / raw)
To: ptxdist; +Cc: Alexander Aring
This patch adds the new powertop package with pci support. With the old
one I got a 404 while receiving sources. The newer implementation uses
autotools than plain Makefiles. The libpci patch adds a option for
--enable-pci and --disable-pci for the configure argument, which enable
or disable pci support explicit.
Also add a missing LICENSE env in the rule and dependency on !BUSYBOX_POWERTOP
which was reported by Sophie CARAYOL <s.carayol@lacroix-electronics.com>.
Signed-off-by: Alexander Aring <alex.aring@gmail.com>
---
patches/powertop-1.11/add-ldflags.diff | 31 ----------
patches/powertop-1.11/remove-bashism.patch | 37 ------------
patches/powertop-1.11/series | 2 -
.../0001-powertop-add-enable-pci-argument.patch | 68 ++++++++++++++++++++++
patches/powertop-2.5/autogen.sh | 1 +
patches/powertop-2.5/series | 1 +
rules/powertop.in | 26 ++++++++-
rules/powertop.make | 28 ++++-----
8 files changed, 105 insertions(+), 89 deletions(-)
delete mode 100644 patches/powertop-1.11/add-ldflags.diff
delete mode 100644 patches/powertop-1.11/remove-bashism.patch
delete mode 100644 patches/powertop-1.11/series
create mode 100644 patches/powertop-2.5/0001-powertop-add-enable-pci-argument.patch
create mode 120000 patches/powertop-2.5/autogen.sh
create mode 100644 patches/powertop-2.5/series
diff --git a/patches/powertop-1.11/add-ldflags.diff b/patches/powertop-1.11/add-ldflags.diff
deleted file mode 100644
index 44c92f0..0000000
--- a/patches/powertop-1.11/add-ldflags.diff
+++ /dev/null
@@ -1,31 +0,0 @@
-From: Marc Kleine-Budde <mkl@pengutronix.de>
-Subject: use LDFLAGS during linking
-
-powertop fails to link, if ncursesw isn't in the
-standard library search path.
-
-It fails even if the LDFLAGS have the appropriate -L.
-This patch add LDFLAGS to the linker invocation.
-
-Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
-
-send upstream to power@bughost.org
-should appear here soon: http://www.bughost.org/pipermail/power/2009-April/thread.html
-
----
- Makefile | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-Index: powertop-1.11/Makefile
-===================================================================
---- powertop-1.11.orig/Makefile
-+++ powertop-1.11/Makefile
-@@ -20,7 +20,7 @@ OBJS = powertop.o config.o process.o mis
-
-
- powertop: $(OBJS) Makefile powertop.h
-- $(CC) ${CFLAGS} $(OBJS) -lncursesw -o powertop
-+ $(CC) ${CFLAGS} $(LDFLAGS) $(OBJS) -lncursesw -o powertop
- @(cd po/ && $(MAKE))
-
- powertop.1.gz: powertop.1
diff --git a/patches/powertop-1.11/remove-bashism.patch b/patches/powertop-1.11/remove-bashism.patch
deleted file mode 100644
index ba2bce8..0000000
--- a/patches/powertop-1.11/remove-bashism.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-From: http://ftp.de.debian.org/debian/pool/main/p/powertop/powertop_1.11-1.diff.gz
-
-Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
-
-#! /bin/sh /usr/share/dpatch/dpatch-run
-## remove-bashism.dpatch by Patrick Winnertz <winnie@debian.org>
-##
-## All lines beginning with `## DP:' are a description of the patch.
-## DP: remove some bashisms in the output
-
-@DPATCH@
-diff --git a/cpufreq.c b/cpufreq.c
-index ab84dc4..a291fdf 100644
---- a/cpufreq.c
-+++ b/cpufreq.c
-@@ -39,7 +39,7 @@ static void activate_ondemand(void)
- FILE *file;
- char filename[PATH_MAX];
-
-- system("/sbin/modprobe cpufreq_ondemand &> /dev/null");
-+ system("/sbin/modprobe cpufreq_ondemand > /dev/null 2>&1");
-
-
- dir = opendir("/sys/devices/system/cpu");
-diff --git a/powertop.c b/powertop.c
-index fc605ec..4d18de8 100644
---- a/powertop.c
-+++ b/powertop.c
-@@ -798,7 +798,7 @@ int main(int argc, char **argv)
- if (!dump)
- ticktime = 5.0;
-
-- system("/sbin/modprobe cpufreq_stats &> /dev/null");
-+ system("/sbin/modprobe cpufreq_stats > /dev/null 2>&1");
- read_data(&start_usage[0], &start_duration[0]);
-
-
diff --git a/patches/powertop-1.11/series b/patches/powertop-1.11/series
deleted file mode 100644
index 1bb7176..0000000
--- a/patches/powertop-1.11/series
+++ /dev/null
@@ -1,2 +0,0 @@
-add-ldflags.diff
-remove-bashism.patch
diff --git a/patches/powertop-2.5/0001-powertop-add-enable-pci-argument.patch b/patches/powertop-2.5/0001-powertop-add-enable-pci-argument.patch
new file mode 100644
index 0000000..aeb5a7e
--- /dev/null
+++ b/patches/powertop-2.5/0001-powertop-add-enable-pci-argument.patch
@@ -0,0 +1,68 @@
+From f62aebb863312b624aec0ebef304a0bdb362e77b Mon Sep 17 00:00:00 2001
+From: Alexander Aring <alex.aring@gmail.com>
+Date: Thu, 3 Apr 2014 09:30:13 +0200
+Subject: [PATCH] powertop: add --enable-pci argument
+
+Signed-off-by: Alexander Aring <alex.aring@gmail.com>
+---
+ configure.ac | 37 +++++++++++++++++++++++--------------
+ 1 file changed, 23 insertions(+), 14 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index b69d608..27c01af 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -48,10 +48,29 @@ AC_CHECK_FUNCS([fdatasync getpagesize gettimeofday memmove memset mkdir munmap p
+
+ AC_SEARCH_LIBS([delwin], [ncursesw ncurses], [], AC_MSG_ERROR([ncurses is required but was not found]), [])
+
+-has_libpci=0
+-PKG_CHECK_MODULES([PCIUTILS], [libpci],[has_libpci=1],[
+- AC_SEARCH_LIBS([pci_get_dev], [pci],[has_libpci=1], [has_libpci=0] )])
+-
++AC_ARG_ENABLE([pci],
++ AS_HELP_STRING([--enable-pci], [enable pci support @<:@default=disabled@:>@]),
++ [enable_pci=$enableval], [enable_pci=no])
++AS_IF([test "x$enable_pci" = "xno"], [
++ AC_DEFINE(HAVE_NO_PCI, [1], [pci support.])
++])
++
++if (test "$enable_pci" == "yes"); then
++ has_libpci=0
++ PKG_CHECK_MODULES([PCIUTILS], [libpci],[has_libpci=1],[
++ AC_SEARCH_LIBS([pci_get_dev], [pci],[has_libpci=1], [has_libpci=0])])
++
++ if (test "$has_libpci" -eq 0); then
++ AC_DEFINE([HAVE_NO_PCI],[1],[Define if pci is not supported])
++ AC_MSG_ERROR([
++ ************* LIBPCI SUPPORT NOT CONFIGURED**************
++ If you need pci support, please install libpci and
++ re-configure PowerTOP with --enable-pci or disable pci
++ support with --disable-pci.
++ *********************************************************
++ ])
++ fi
++fi
+
+ has_libnl_ver=0
+ # libnl-2 provides only libnl-2.0.pc file, so we check for separate libnl-genl-3.0.pc
+@@ -67,16 +86,6 @@ if (test "$has_libnl_ver" -gt 1); then
+ AC_DEFINE([HAVE_LIBNL20], [1], [Define if you have libnl-2.0 or higher])
+ fi
+
+-if (test "$has_libpci" -eq 0); then
+- AC_DEFINE([HAVE_NO_PCI],[1],[Define if pci is not supported])
+- AC_MSG_WARN([
+- ************* LIBPCI SUPPORT NOT CONFIGURED**************
+- If you need or want pci support, please install libpci
+- and re-configure PowerTOP.
+- *********************************************************
+- ])
+-fi
+-
+ AC_SEARCH_LIBS([pthread_create], [pthread], [], AC_MSG_ERROR([libpthread is required but was not found]), [])
+ AC_SEARCH_LIBS([inet_aton], [resolv], [], AC_MSG_ERROR([libresolv is required but was not found]), [])
+
+--
+1.9.1
+
diff --git a/patches/powertop-2.5/autogen.sh b/patches/powertop-2.5/autogen.sh
new file mode 120000
index 0000000..9f8a4cb
--- /dev/null
+++ b/patches/powertop-2.5/autogen.sh
@@ -0,0 +1 @@
+../autogen.sh
\ No newline at end of file
diff --git a/patches/powertop-2.5/series b/patches/powertop-2.5/series
new file mode 100644
index 0000000..143dde4
--- /dev/null
+++ b/patches/powertop-2.5/series
@@ -0,0 +1 @@
+0001-powertop-add-enable-pci-argument.patch
diff --git a/rules/powertop.in b/rules/powertop.in
index 56e7521..2b6b3b8 100644
--- a/rules/powertop.in
+++ b/rules/powertop.in
@@ -1,10 +1,15 @@
## SECTION=debug_tools
-config POWERTOP
+menuconfig POWERTOP
tristate
- prompt "powertop"
- select GCCLIBS_GCC_S
+ prompt "powertop "
select NCURSES
+ select LIBNL3
+ select LIBC_RESOLV
+ select LIBC_PTHREAD
+ select PCIUTILS if POWERTOP_PCI_SUPPORT
+ select PCIUTILS_LIBPCI if POWERTOP_PCI_SUPPORT
+ depends on !BUSYBOX_POWERTOP || ALLYES
help
PowerTOP is a Linux tool that finds the software
component(s) that make your laptop use more power than
@@ -19,3 +24,18 @@ config POWERTOP
various sources of information from the kernel into one
convenient screen so that you can see how well your system
is doing, and which components are the biggest problem.
+
+if POWERTOP
+
+config POWERTOP_PCI_SUPPORT
+ bool
+ prompt "pci support"
+ help
+ This adds powertop support for the PCI bus. Should only be
+ enabled if you have PCI support.
+
+endif
+
+comment "BusyBox' powertop is selected!"
+ depends on BUSYBOX_POWERTOP
+
diff --git a/rules/powertop.make b/rules/powertop.make
index a3be360..36bc52a 100644
--- a/rules/powertop.make
+++ b/rules/powertop.make
@@ -1,6 +1,7 @@
# -*-makefile-*-
#
# Copyright (C) 2009 by Marc Kleine-Budde <mkl@pengutronix.de>
+# 2014 by Alexander Aring <aar@pengutronix.de>
#
# See CREDITS for details about who has contributed to this project.
#
@@ -16,31 +17,26 @@ PACKAGES-$(PTXCONF_POWERTOP) += powertop
#
# Paths and names
#
-POWERTOP_VERSION := 1.11
-POWERTOP_MD5 := 3498f5983c683c3a57dce7379a722082
+POWERTOP_VERSION := 2.5
+POWERTOP_MD5 := 806bbcbd44fcea1f807c9582fc1f7d3e
POWERTOP := powertop-$(POWERTOP_VERSION)
POWERTOP_SUFFIX := tar.gz
-POWERTOP_URL := http://www.lesswatts.org/projects/powertop/download/$(POWERTOP).$(POWERTOP_SUFFIX)
+POWERTOP_URL := https://01.org/sites/default/files/downloads/powertop/$(POWERTOP).$(POWERTOP_SUFFIX)
POWERTOP_SOURCE := $(SRCDIR)/$(POWERTOP).$(POWERTOP_SUFFIX)
POWERTOP_DIR := $(BUILDDIR)/$(POWERTOP)
+POWERTOP_LICENSE := GPLv2
# ----------------------------------------------------------------------------
# Prepare
# ----------------------------------------------------------------------------
-POWERTOP_PATH := PATH=$(CROSS_PATH)
-
-POWERTOP_COMPILE_ENV := $(CROSS_ENV)
-POWERTOP_MAKEVARS := BINDIR=/usr/sbin
-
-$(STATEDIR)/powertop.prepare:
- @$(call targetinfo)
-ifdef PTXCONF_NCURSES_WIDE_CHAR
- sed -i -e "s/-lncurses[^ ]*/-lncursesw/g" "$(POWERTOP_DIR)/Makefile"
-else
- sed -i -e "s/-lncurses[^ ]*/-lncurses/g" "$(POWERTOP_DIR)/Makefile"
-endif
- @$(call touch)
+#
+# autoconf
+#
+POWERTOP_CONF_TOOL := autoconf
+POWERTOP_CONF_OPT := \
+ $(CROSS_AUTOCONF_USR) \
+ --$(call ptx/endis, PTXCONF_POWERTOP_PCI_SUPPORT)-pci
# ----------------------------------------------------------------------------
# Target-Install
--
1.9.1
--
ptxdist mailing list
ptxdist@pengutronix.de
^ permalink raw reply [flat|nested] 4+ messages in thread