From: Romain Naour <romain.naour@openwide.fr>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 1/1] package/cpupower: new package
Date: Sun, 12 Jul 2015 12:37:10 +0200 [thread overview]
Message-ID: <55A24356.8000804@openwide.fr> (raw)
In-Reply-To: <1432249380-5920-1-git-send-email-james.knight@rockwellcollins.com>
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))
>
prev parent reply other threads:[~2015-07-12 10:37 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
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 message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=55A24356.8000804@openwide.fr \
--to=romain.naour@openwide.fr \
--cc=buildroot@busybox.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox