All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] package/cpupower: new package
@ 2015-05-21 23:03 James Knight
  2015-05-22 15:38 ` Matthew Weber
  2015-07-12 10:37 ` Romain Naour
  0 siblings, 2 replies; 5+ messages in thread
From: James Knight @ 2015-05-21 23:03 UTC (permalink / raw)
  To: buildroot

Signed-off-by: James Knight <james.knight@rockwellcollins.com>
---
 package/Config.in            |  1 +
 package/cpupower/Config.in   | 10 ++++++++++
 package/cpupower/cpupower.mk | 37 +++++++++++++++++++++++++++++++++++++
 3 files changed, 48 insertions(+)
 create mode 100644 package/cpupower/Config.in
 create mode 100644 package/cpupower/cpupower.mk

diff --git a/package/Config.in b/package/Config.in
index e0c2e2a..0bd6eb6 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -1378,6 +1378,7 @@ if BR2_PACKAGE_BUSYBOX_SHOW_OTHERS
 	source "package/coreutils/Config.in"
 endif
 	source "package/cpuload/Config.in"
+	source "package/cpupower/Config.in"
 if BR2_PACKAGE_BUSYBOX_SHOW_OTHERS
 	source "package/dcron/Config.in"
 	source "package/debianutils/Config.in"
diff --git a/package/cpupower/Config.in b/package/cpupower/Config.in
new file mode 100644
index 0000000..745dd2b
--- /dev/null
+++ b/package/cpupower/Config.in
@@ -0,0 +1,10 @@
+config BR2_PACKAGE_CPUPOWER
+	bool "cpupower"
+	depends on BR2_LINUX_KERNEL
+	select BR2_PACKAGE_PCIUTILS
+	help
+	  cpupower is a collection of tools to examine and tune power 
+	  saving related features of your processor.
+
+comment "cpupower needs a Linux kernel to be built"
+	depends on !BR2_LINUX_KERNEL
diff --git a/package/cpupower/cpupower.mk b/package/cpupower/cpupower.mk
new file mode 100644
index 0000000..cb1f938
--- /dev/null
+++ b/package/cpupower/cpupower.mk
@@ -0,0 +1,37 @@
+################################################################################
+#
+# cpupower
+#
+################################################################################
+
+# Source taken from the Linux kernel tree
+CPUPOWER_SOURCE =
+CPUPOWER_VERSION = $(call qstrip,$(BR2_LINUX_KERNEL_VERSION))
+
+CPUPOWER_DEPENDENCIES = linux pciutils
+
+define CPUPOWER_BUILD_CMDS
+	$(Q)if test ! -f $(LINUX_DIR)/tools/power/cpupower/Makefile ; then \
+		echo "Your kernel version is too old and does not have the cpupower tool." ; \
+		echo "At least kernel 3.4 must be used." ; \
+		exit 1 ; \
+	fi
+	
+	$(TARGET_MAKE_ENV) $(MAKE) -C $(LINUX_DIR)/tools \
+		CROSS=$(TARGET_CROSS) \
+		CPUFREQ_BENCH=false \
+		DEBUG=false \
+		cpupower
+endef
+
+define CPUPOWER_INSTALL_TARGET_CMDS
+	$(INSTALL) -D -m 755 $(LINUX_DIR)/tools/power/cpupower/cpupower \
+		$(TARGET_DIR)/usr/bin/cpupower
+
+	$(INSTALL) -D -m 0755 $(LINUX_DIR)/tools/power/cpupower/libcpupower.so.0.0.0 \
+		$(TARGET_DIR)/lib/libcpupower.so.0.0.0
+	ln -snf libcpupower.so.0.0.0 $(TARGET_DIR)/lib/libcpupower.so
+	ln -snf libcpupower.so.0.0.0 $(TARGET_DIR)/lib/libcpupower.so.0
+endef
+
+$(eval $(generic-package))
-- 
1.9.5.msysgit.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH 1/1] package/cpupower: new package
  2015-05-21 23:03 [Buildroot] [PATCH 1/1] package/cpupower: new package James Knight
@ 2015-05-22 15:38 ` Matthew Weber
  2015-05-22 16:09   ` James Knight
  2015-07-12 10:37 ` Romain Naour
  1 sibling, 1 reply; 5+ messages in thread
From: Matthew Weber @ 2015-05-22 15:38 UTC (permalink / raw)
  To: buildroot

James,

On Thu, May 21, 2015 at 6:03 PM, James Knight
<james.knight@rockwellcollins.com> wrote:
> Signed-off-by: James Knight <james.knight@rockwellcollins.com>
> ---
>  package/Config.in            |  1 +
>  package/cpupower/Config.in   | 10 ++++++++++
>  package/cpupower/cpupower.mk | 37 +++++++++++++++++++++++++++++++++++++
>  3 files changed, 48 insertions(+)
>  create mode 100644 package/cpupower/Config.in
>  create mode 100644 package/cpupower/cpupower.mk
>
> diff --git a/package/Config.in b/package/Config.in
> index e0c2e2a..0bd6eb6 100644
> --- a/package/Config.in
> +++ b/package/Config.in
> @@ -1378,6 +1378,7 @@ if BR2_PACKAGE_BUSYBOX_SHOW_OTHERS
>         source "package/coreutils/Config.in"
>  endif
>         source "package/cpuload/Config.in"
> +       source "package/cpupower/Config.in"
>  if BR2_PACKAGE_BUSYBOX_SHOW_OTHERS
>         source "package/dcron/Config.in"
>         source "package/debianutils/Config.in"
> diff --git a/package/cpupower/Config.in b/package/cpupower/Config.in
> new file mode 100644
> index 0000000..745dd2b
> --- /dev/null
> +++ b/package/cpupower/Config.in
> @@ -0,0 +1,10 @@
> +config BR2_PACKAGE_CPUPOWER
> +       bool "cpupower"
> +       depends on BR2_LINUX_KERNEL
> +       select BR2_PACKAGE_PCIUTILS
> +       help
> +         cpupower is a collection of tools to examine and tune power
Extra space at end of the above line.

> +         saving related features of your processor.
> +
> +comment "cpupower needs a Linux kernel to be built"
> +       depends on !BR2_LINUX_KERNEL
> diff --git a/package/cpupower/cpupower.mk b/package/cpupower/cpupower.mk
> new file mode 100644
> index 0000000..cb1f938
> --- /dev/null
> +++ b/package/cpupower/cpupower.mk
> @@ -0,0 +1,37 @@
> +################################################################################
> +#
> +# cpupower
> +#
> +################################################################################
> +
> +# Source taken from the Linux kernel tree
> +CPUPOWER_SOURCE =
> +CPUPOWER_VERSION = $(call qstrip,$(BR2_LINUX_KERNEL_VERSION))
> +
> +CPUPOWER_DEPENDENCIES = linux pciutils

Add license file and type...  In this case, probably just a
duplication of the kernel, but needed for license manifest generation.
The file has to be in your source folder, so maybe the _SOURCE needs
to be set to the LINUX_DIR....  Would have to think about this one.
Maybe look at the spidev-test which is also build from Linux kernel
source.
http://git.buildroot.net/buildroot/tree/package/spidev_test/spidev_test.mk

To test the license gathering, remove your build/cpupower folder and
then make legal-info.

LIBFOO has a good example here for how those variables are set (also
look at any other package).
http://buildroot.uclibc.org/downloads/manual/manual.html#_infrastructure_for_packages_with_specific_build_systems

FYI, here's some background
http://buildroot.uclibc.org/downloads/manual/manual.html#legal-info

<snip>

The spidev_test might also shed light on another approach to adding cpupower.

Thanks, James for the submission!

-- 
Matthew L Weber / Pr Software Engineer
Airborne Information Systems / Security Systems and Software / Secure Platforms
MS 131-100, C Ave NE, Cedar Rapids, IA, 52498, USA
www.rockwellcollins.com

Note: Any Export License Required Information and License Restricted
Third Party Intellectual Property (TPIP) content must be encrypted and
sent to matthew.weber at corp.rockwellcollins.com.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH 1/1] package/cpupower: new package
  2015-05-22 15:38 ` Matthew Weber
@ 2015-05-22 16:09   ` James Knight
  2015-05-22 16:18     ` Matthew Weber
  0 siblings, 1 reply; 5+ messages in thread
From: James Knight @ 2015-05-22 16:09 UTC (permalink / raw)
  To: buildroot

Thanks Matthew.

I was attempting to follow the `perf` package style for this new package:

   http://git.buildroot.net/buildroot/tree/package/perf/perf.mk

My main reason for following this was to prevent having the process from
re-downloading the kernel/etc. again. I don't mind adding license
information as well but I don't know the correct way in doing this since
this package is based off the selected kernel option (although I can just
copy the license value set by LINUX_LICENSE). Is the perf package
out-of-date? I don't mind following the `spidev_test` package; I just want
to make sure I'm doing it right.

On Friday, May 22, 2015, Matthew Weber <matthew.weber@rockwellcollins.com>
wrote:

> James,
>
> On Thu, May 21, 2015 at 6:03 PM, James Knight
> <james.knight@rockwellcollins.com <javascript:;>> wrote:
> > Signed-off-by: James Knight <james.knight@rockwellcollins.com
> <javascript:;>>
> > ---
> >  package/Config.in            |  1 +
> >  package/cpupower/Config.in   | 10 ++++++++++
> >  package/cpupower/cpupower.mk | 37 +++++++++++++++++++++++++++++++++++++
> >  3 files changed, 48 insertions(+)
> >  create mode 100644 package/cpupower/Config.in
> >  create mode 100644 package/cpupower/cpupower.mk
> >
> > diff --git a/package/Config.in b/package/Config.in
> > index e0c2e2a..0bd6eb6 100644
> > --- a/package/Config.in
> > +++ b/package/Config.in
> > @@ -1378,6 +1378,7 @@ if BR2_PACKAGE_BUSYBOX_SHOW_OTHERS
> >         source "package/coreutils/Config.in"
> >  endif
> >         source "package/cpuload/Config.in"
> > +       source "package/cpupower/Config.in"
> >  if BR2_PACKAGE_BUSYBOX_SHOW_OTHERS
> >         source "package/dcron/Config.in"
> >         source "package/debianutils/Config.in"
> > diff --git a/package/cpupower/Config.in b/package/cpupower/Config.in
> > new file mode 100644
> > index 0000000..745dd2b
> > --- /dev/null
> > +++ b/package/cpupower/Config.in
> > @@ -0,0 +1,10 @@
> > +config BR2_PACKAGE_CPUPOWER
> > +       bool "cpupower"
> > +       depends on BR2_LINUX_KERNEL
> > +       select BR2_PACKAGE_PCIUTILS
> > +       help
> > +         cpupower is a collection of tools to examine and tune power
> Extra space at end of the above line.
>
> > +         saving related features of your processor.
> > +
> > +comment "cpupower needs a Linux kernel to be built"
> > +       depends on !BR2_LINUX_KERNEL
> > diff --git a/package/cpupower/cpupower.mk b/package/cpupower/cpupower.mk
> > new file mode 100644
> > index 0000000..cb1f938
> > --- /dev/null
> > +++ b/package/cpupower/cpupower.mk
> > @@ -0,0 +1,37 @@
> >
> +################################################################################
> > +#
> > +# cpupower
> > +#
> >
> +################################################################################
> > +
> > +# Source taken from the Linux kernel tree
> > +CPUPOWER_SOURCE =
> > +CPUPOWER_VERSION = $(call qstrip,$(BR2_LINUX_KERNEL_VERSION))
> > +
> > +CPUPOWER_DEPENDENCIES = linux pciutils
>
> Add license file and type...  In this case, probably just a
> duplication of the kernel, but needed for license manifest generation.
> The file has to be in your source folder, so maybe the _SOURCE needs
> to be set to the LINUX_DIR....  Would have to think about this one.
> Maybe look at the spidev-test which is also build from Linux kernel
> source.
> http://git.buildroot.net/buildroot/tree/package/spidev_test/spidev_test.mk
>
> To test the license gathering, remove your build/cpupower folder and
> then make legal-info.
>
> LIBFOO has a good example here for how those variables are set (also
> look at any other package).
>
> http://buildroot.uclibc.org/downloads/manual/manual.html#_infrastructure_for_packages_with_specific_build_systems
>
> FYI, here's some background
> http://buildroot.uclibc.org/downloads/manual/manual.html#legal-info
>
> <snip>
>
> The spidev_test might also shed light on another approach to adding
> cpupower.
>
> Thanks, James for the submission!
>
> --
> Matthew L Weber / Pr Software Engineer
> Airborne Information Systems / Security Systems and Software / Secure
> Platforms
> MS 131-100, C Ave NE, Cedar Rapids, IA, 52498, USA
> www.rockwellcollins.com
>
> Note: Any Export License Required Information and License Restricted
> Third Party Intellectual Property (TPIP) content must be encrypted and
> sent to matthew.weber at corp.rockwellcollins.com <javascript:;>.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20150522/f82bfff9/attachment.html>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH 1/1] package/cpupower: new package
  2015-05-22 16:09   ` James Knight
@ 2015-05-22 16:18     ` Matthew Weber
  0 siblings, 0 replies; 5+ messages in thread
From: Matthew Weber @ 2015-05-22 16:18 UTC (permalink / raw)
  To: buildroot

James,


On Fri, May 22, 2015 at 11:09 AM, James Knight
<james.knight@rockwellcollins.com> wrote:
> Thanks Matthew.
>
Please don't top post.

> I was attempting to follow the `perf` package style for this new package:
>
>    http://git.buildroot.net/buildroot/tree/package/perf/perf.mk
>
> My main reason for following this was to prevent having the process from
> re-downloading the kernel/etc. again. I don't mind adding license
> information as well but I don't know the correct way in doing this since
> this package is based off the selected kernel option (although I can just
> copy the license value set by LINUX_LICENSE). Is the perf package
> out-of-date? I don't mind following the `spidev_test` package; I just want
> to make sure I'm doing it right.

Yep, completely understand that approach.  Ah perf, that doesn't have
license info.....  I'll leave that as an open question (I'm not sure)

Thanks,
-- 
Matthew L Weber / Pr Software Engineer
Airborne Information Systems / Security Systems and Software / Secure Platforms
MS 131-100, C Ave NE, Cedar Rapids, IA, 52498, USA
www.rockwellcollins.com

Note: Any Export License Required Information and License Restricted
Third Party Intellectual Property (TPIP) content must be encrypted and
sent to matthew.weber at corp.rockwellcollins.com.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH 1/1] package/cpupower: new package
  2015-05-21 23:03 [Buildroot] [PATCH 1/1] package/cpupower: new package James Knight
  2015-05-22 15:38 ` Matthew Weber
@ 2015-07-12 10:37 ` Romain Naour
  1 sibling, 0 replies; 5+ messages in thread
From: Romain Naour @ 2015-07-12 10:37 UTC (permalink / raw)
  To: buildroot

Hi James,

Le 22/05/2015 01:03, James Knight a ?crit :
> Signed-off-by: James Knight <james.knight@rockwellcollins.com>
> ---
>  package/Config.in            |  1 +
>  package/cpupower/Config.in   | 10 ++++++++++
>  package/cpupower/cpupower.mk | 37 +++++++++++++++++++++++++++++++++++++
>  3 files changed, 48 insertions(+)
>  create mode 100644 package/cpupower/Config.in
>  create mode 100644 package/cpupower/cpupower.mk
> 
> diff --git a/package/Config.in b/package/Config.in
> index e0c2e2a..0bd6eb6 100644
> --- a/package/Config.in
> +++ b/package/Config.in
> @@ -1378,6 +1378,7 @@ if BR2_PACKAGE_BUSYBOX_SHOW_OTHERS
>  	source "package/coreutils/Config.in"
>  endif
>  	source "package/cpuload/Config.in"
> +	source "package/cpupower/Config.in"
>  if BR2_PACKAGE_BUSYBOX_SHOW_OTHERS
>  	source "package/dcron/Config.in"
>  	source "package/debianutils/Config.in"
> diff --git a/package/cpupower/Config.in b/package/cpupower/Config.in
> new file mode 100644
> index 0000000..745dd2b
> --- /dev/null
> +++ b/package/cpupower/Config.in
> @@ -0,0 +1,10 @@
> +config BR2_PACKAGE_CPUPOWER
> +	bool "cpupower"
> +	depends on BR2_LINUX_KERNEL
> +	select BR2_PACKAGE_PCIUTILS

pciutils depends on !BR2_bfin, so cpupower shouldn't be selected with bfin target.

> +	help
> +	  cpupower is a collection of tools to examine and tune power 
> +	  saving related features of your processor.
> +
> +comment "cpupower needs a Linux kernel to be built"
> +	depends on !BR2_LINUX_KERNEL
> diff --git a/package/cpupower/cpupower.mk b/package/cpupower/cpupower.mk
> new file mode 100644
> index 0000000..cb1f938
> --- /dev/null
> +++ b/package/cpupower/cpupower.mk
> @@ -0,0 +1,37 @@
> +################################################################################
> +#
> +# cpupower
> +#
> +################################################################################
> +
> +# Source taken from the Linux kernel tree
> +CPUPOWER_SOURCE =
> +CPUPOWER_VERSION = $(call qstrip,$(BR2_LINUX_KERNEL_VERSION))
> +
> +CPUPOWER_DEPENDENCIES = linux pciutils
> +
> +define CPUPOWER_BUILD_CMDS
> +	$(Q)if test ! -f $(LINUX_DIR)/tools/power/cpupower/Makefile ; then \
> +		echo "Your kernel version is too old and does not have the cpupower tool." ; \
> +		echo "At least kernel 3.4 must be used." ; \
> +		exit 1 ; \
> +	fi
> +	
> +	$(TARGET_MAKE_ENV) $(MAKE) -C $(LINUX_DIR)/tools \
> +		CROSS=$(TARGET_CROSS) \
> +		CPUFREQ_BENCH=false \
> +		DEBUG=false \
> +		cpupower
> +endef
> +
> +define CPUPOWER_INSTALL_TARGET_CMDS
> +	$(INSTALL) -D -m 755 $(LINUX_DIR)/tools/power/cpupower/cpupower \
> +		$(TARGET_DIR)/usr/bin/cpupower
> +
> +	$(INSTALL) -D -m 0755 $(LINUX_DIR)/tools/power/cpupower/libcpupower.so.0.0.0 \
> +		$(TARGET_DIR)/lib/libcpupower.so.0.0.0
> +	ln -snf libcpupower.so.0.0.0 $(TARGET_DIR)/lib/libcpupower.so
> +	ln -snf libcpupower.so.0.0.0 $(TARGET_DIR)/lib/libcpupower.so.0
> +endef

It would be better to use cpupower_install target available in cpupower's
Makefile instead:

define CPUPOWER_INSTALL_TARGET_CMDS
	$(TARGET_MAKE_ENV) $(MAKE) -C $(LINUX_DIR)/tools \
		CROSS=$(TARGET_CROSS) \
		CPUFREQ_BENCH=false \
		DEBUG=false \
		DESTDIR=$(TARGET_DIR) \
		cpupower_install
endef

Since cpupower install a shared library, it should be also available in staging.
So you should also add:

CPUPOWER_INSTALL_STAGING = YES

define CPUPOWER_INSTALL_STAGING_CMDS
	$(TARGET_MAKE_ENV) $(MAKE) -C $(LINUX_DIR)/tools \
		CROSS=$(TARGET_CROSS) \
		CPUFREQ_BENCH=false \
		DEBUG=false \
		DESTDIR=$(STAGING_DIR) \
		cpupower_install
endef

By the way, do you know a tool that can link against libcpupower.so ?

Best regards,
Romain Naour

> +
> +$(eval $(generic-package))
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-07-12 10:37 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-21 23:03 [Buildroot] [PATCH 1/1] package/cpupower: new package James Knight
2015-05-22 15:38 ` Matthew Weber
2015-05-22 16:09   ` James Knight
2015-05-22 16:18     ` Matthew Weber
2015-07-12 10:37 ` Romain Naour

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.