diff options
Diffstat (limited to 'package/cpufrequtils')
-rw-r--r-- | package/cpufrequtils/Makefile | 33 | ||||
-rw-r--r-- | package/cpufrequtils/patches/patch-Makefile | 155 | ||||
-rw-r--r-- | package/cpufrequtils/patches/patch-bench_Makefile | 8 | ||||
-rw-r--r-- | package/cpufrequtils/patches/patch-utils_info_c | 244 | ||||
-rw-r--r-- | package/cpufrequtils/patches/patch-utils_set_c | 118 |
5 files changed, 558 insertions, 0 deletions
diff --git a/package/cpufrequtils/Makefile b/package/cpufrequtils/Makefile new file mode 100644 index 000000000..0e4d22450 --- /dev/null +++ b/package/cpufrequtils/Makefile @@ -0,0 +1,33 @@ +# This file is part of the OpenADK project. OpenADK is copyrighted +# material, please see the LICENCE file in the top-level directory. + +include $(TOPDIR)/rules.mk + +PKG_NAME:= cpufrequtils +PKG_VERSION:= 007 +PKG_RELEASE:= 1 +PKG_MD5SUM:= 40271a1e1eadce31457e9891cdb071f1 +PKG_DESCR:= Userspace utilities for the Linux kernel cpufreq subsystem +PKG_SECTION:= utils +PKG_URL:= http://www.kernel.org/pub/linux/utils/kernel/cpufreq/cpufrequtils.html +PKG_SITES:= http://www.kernel.org/pub/linux/utils/kernel/cpufreq/ + +include $(TOPDIR)/mk/package.mk + +$(eval $(call PKG_template,CPUFREQUTILS,$(PKG_NAME),$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION})) + +BUILD_STYLE:= auto +INSTALL_STYLE:= auto +MAKE_FLAGS+= CROSS=${TARGET_CROSS} + +post-install: + $(INSTALL_DIR) $(IDIR_CPUFREQUTILS)/usr/lib + $(CP) $(WRKINST)/usr/lib/libcpufreq.so* \ + $(IDIR_CPUFREQUTILS)/usr/lib + $(INSTALL_DIR) $(IDIR_CPUFREQUTILS)/usr/bin + $(INSTALL_BIN) $(WRKINST)/usr/bin/cpufreq-set \ + $(IDIR_CPUFREQUTILS)/usr/bin + $(INSTALL_BIN) $(WRKINST)/usr/bin/cpufreq-info \ + $(IDIR_CPUFREQUTILS)/usr/bin + +include ${TOPDIR}/mk/pkg-bottom.mk diff --git a/package/cpufrequtils/patches/patch-Makefile b/package/cpufrequtils/patches/patch-Makefile new file mode 100644 index 000000000..c85aba1ab --- /dev/null +++ b/package/cpufrequtils/patches/patch-Makefile @@ -0,0 +1,155 @@ +--- cpufrequtils-007.orig/Makefile 2010-01-16 14:47:44.000000000 +0100 ++++ cpufrequtils-007/Makefile 2010-01-23 18:52:15.905985935 +0100 +@@ -27,11 +27,11 @@ + DEBUG ?= false + + # make the build silent. Set this to something else to make it noisy again. +-V ?= false ++V ?= true + + # Internationalization support (output in different languages). + # Requires gettext. +-NLS ?= true ++NLS ?= false + + # Set the following to 'true' to build/install the + # cpufreq-bench benchmarking tool +@@ -55,7 +55,9 @@ DESTDIR ?= + # and _should_ modify the PACKAGE_BUGREPORT definition + + VERSION = 007 +-LIB_VERSION = 0:0:0 ++LIB_MAJ= 0.0.0 ++LIB_MIN= 0 ++ + PACKAGE = cpufrequtils + PACKAGE_BUGREPORT = cpufreq@vger.kernel.org + LANGUAGES = de fr it cs pt +@@ -80,7 +82,6 @@ INSTALL = /usr/bin/install -c + INSTALL_PROGRAM = ${INSTALL} + INSTALL_DATA = ${INSTALL} -m 644 + INSTALL_SCRIPT = ${INSTALL_PROGRAM} +-LIBTOOL = /usr/bin/libtool + + # If you are running a cross compiler, you may want to set this + # to something more interesting, like "arm-linux-". If you want +@@ -116,20 +117,22 @@ WARNINGS += -Wshadow + CPPFLAGS += -DVERSION=\"$(VERSION)\" -DPACKAGE=\"$(PACKAGE)\" \ + -DPACKAGE_BUGREPORT=\"$(PACKAGE_BUGREPORT)\" -D_GNU_SOURCE + +-UTIL_OBJS = utils/info.c utils/set.c ++UTIL_SRC = utils/info.c utils/set.c + LIB_HEADERS = lib/cpufreq.h lib/interfaces.h +-LIB_OBJS = lib/cpufreq.c lib/proc.c lib/sysfs.c +-LIB_PARTS = lib/cpufreq.lo ++LIB_SRC = lib/cpufreq.c ++LIB_OBJS = lib/cpufreq.o + + CFLAGS += -pipe + + ifeq ($(strip $(PROC)),true) +- LIB_PARTS += lib/proc.lo ++ LIB_OBJS += lib/proc.o ++ LIB_SRC += lib/proc.c + CPPFLAGS += -DINTERFACE_PROC + endif + + ifeq ($(strip $(SYSFS)),true) +- LIB_PARTS += lib/sysfs.lo ++ LIB_OBJS += lib/sysfs.o ++ LIB_SRC += lib/sysfs.c + CPPFLAGS += -DINTERFACE_SYSFS + endif + +@@ -147,11 +150,9 @@ CFLAGS += $(WARNINGS) + + ifeq ($(strip $(V)),false) + QUIET=@$(PWD)/build/ccdv +- LIBTOOL_OPT=--silent + HOST_PROGS=build/ccdv + else + QUIET= +- LIBTOOL_OPT= + HOST_PROGS= + endif + +@@ -175,24 +176,26 @@ all: ccdv libcpufreq utils $(COMPILE_NLS + ccdv: build/ccdv + build/ccdv: build/ccdv.c + @echo "Building ccdv" +- @$(HOSTCC) -O1 -O1 $< -o $@ ++ @$(HOSTCC) -O1 $< -o $@ + +-%.lo: $(LIB_OBJS) $(LIB_HEADERS) ccdv +- $(QUIET) $(LIBTOOL) $(LIBTOOL_OPT) --mode=compile $(CC) $(CPPFLAGS) $(CFLAGS) -o $@ -c $*.c ++lib/%.o: $(LIB_SRC) $(LIB_HEADERS) build/ccdv ++ $(QUIET) $(CC) $(CPPFLAGS) $(CFLAGS) -fPIC -o $@ -c lib/$*.c + +-libcpufreq.la: $(LIB_OBJS) $(LIB_HEADERS) $(LIB_PARTS) Makefile ++libcpufreq.so.$(LIB_MAJ): $(LIB_OBJS) + @if [ $(strip $(SYSFS)) != true -a $(strip $(PROC)) != true ]; then \ + echo '*** At least one of /sys support or /proc support MUST be enabled ***'; \ + exit -1; \ + fi; +- $(QUIET) $(LIBTOOL) $(LIBTOOL_OPT) --mode=link $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o libcpufreq.la -rpath \ +- ${libdir} -version-info $(LIB_VERSION) $(LIB_PARTS) ++ $(QUIET) $(CC) -shared $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ \ ++ -Wl,-soname,libcpufreq.so.$(LIB_MIN) $(LIB_OBJS) ++ @ln -sf $@ libcpufreq.so ++ @ln -sf $@ libcpufreq.so.$(LIB_MIN) + +-libcpufreq: libcpufreq.la ++libcpufreq: libcpufreq.so.$(LIB_MAJ) + +-cpufreq-%: libcpufreq.la $(UTIL_OBJS) ++cpufreq-%: libcpufreq.so.$(LIB_MAJ) $(UTIL_OBJS) + $(QUIET) $(CC) $(CPPFLAGS) $(CFLAGS) -I. -I./lib/ -c -o utils/$@.o utils/$*.c +- $(QUIET) $(CC) $(CFLAGS) $(LDFLAGS) -L. -L./.libs/ -o $@ utils/$@.o -lcpufreq ++ $(QUIET) $(CC) $(CFLAGS) $(LDFLAGS) -L. -o $@ utils/$@.o -lcpufreq + $(QUIET) $(STRIPCMD) $@ + + utils: cpufreq-info cpufreq-set cpufreq-aperf +@@ -217,22 +220,21 @@ update-gmo: po/$(PACKAGE).pot + done; + + compile-bench: libcpufreq +- @V=$(V) confdir=$(confdir) make -C bench ++ @V=$(V) confdir=$(confdir) $(MAKE) -C bench + + clean: +- -find . \( -not -type d \) -and \( -name '*~' -o -name '*.[oas]' -o -name '*.l[oas]' \) -type f -print \ ++ -find . \( -not -type d \) -and \( -name '*~' -o -name '*.[oas]' \) -type f -print \ + | xargs rm -f +- -rm -rf lib/.libs +- -rm -rf .libs + -rm -f cpufreq-info cpufreq-set cpufreq-aperf ++ -rm -f libcpufreq.so* + -rm -f build/ccdv + -rm -rf po/*.gmo po/*.pot +- make -C bench clean ++ $(MAKE) -C bench clean + + + install-lib: + $(INSTALL) -d $(DESTDIR)${libdir} +- $(LIBTOOL) --mode=install $(INSTALL) libcpufreq.la $(DESTDIR)${libdir}/libcpufreq.la ++ $(INSTALL) libcpufreq.so* $(DESTDIR)${libdir}/ + $(INSTALL) -d $(DESTDIR)${includedir} + $(INSTALL_DATA) lib/cpufreq.h $(DESTDIR)${includedir}/cpufreq.h + +@@ -255,7 +257,7 @@ install-gmo: + + install-bench: + @#DESTDIR must be set from outside to survive +- @sbindir=$(sbindir) bindir=$(bindir) docdir=$(docdir) confdir=$(confdir) make -C bench install ++ @sbindir=$(sbindir) bindir=$(bindir) docdir=$(docdir) confdir=$(confdir) $(MAKE) -C bench install + + install: install-lib install-tools install-man $(INSTALL_NLS) $(INSTALL_BENCH) + +@@ -271,5 +273,5 @@ uninstall: + rm -f $(DESTDIR)${localedir}/$$HLANG/LC_MESSAGES/cpufrequtils.mo; \ + done; + +-.PHONY: all utils libcpufreq update-po update-gmo install-lib install-tools install-man install-gmo install uninstall \ ++.PHONY: all utils libcpufreq ccdv update-po update-gmo install-lib install-tools install-man install-gmo install uninstall \ + clean diff --git a/package/cpufrequtils/patches/patch-bench_Makefile b/package/cpufrequtils/patches/patch-bench_Makefile new file mode 100644 index 000000000..08b0049ca --- /dev/null +++ b/package/cpufrequtils/patches/patch-bench_Makefile @@ -0,0 +1,8 @@ +--- cpufrequtils-007.orig/bench/Makefile 2010-01-16 14:47:44.000000000 +0100 ++++ cpufrequtils-007/bench/Makefile 2010-01-23 18:51:28.329986048 +0100 +@@ -1,4 +1,4 @@ +-LIBS = -L../.libs/ -lm -lcpufreq ++LIBS = -L../ -lm -lcpufreq + + OBJS = main.o parse.o system.o benchmark.o + CFLAGS += -D_GNU_SOURCE -I../lib -DDEFAULT_CONFIG_FILE=\"$(confdir)/cpufreq-bench.conf\" diff --git a/package/cpufrequtils/patches/patch-utils_info_c b/package/cpufrequtils/patches/patch-utils_info_c new file mode 100644 index 000000000..d8047f798 --- /dev/null +++ b/package/cpufrequtils/patches/patch-utils_info_c @@ -0,0 +1,244 @@ +--- cpufrequtils-007.orig/utils/info.c 2010-01-16 14:47:44.000000000 +0100 ++++ cpufrequtils-007/utils/info.c 2010-01-23 18:51:50.165866845 +0100 +@@ -10,9 +10,6 @@ + #include <errno.h> + #include <stdlib.h> + #include <string.h> +-#include <libintl.h> +-#include <locale.h> +- + #include <getopt.h> + + #include "cpufreq.h" +@@ -33,7 +30,7 @@ static unsigned int count_cpus(void) + + fp = fopen("/proc/stat", "r"); + if(!fp) { +- printf(gettext("Couldn't count the number of CPUs (%s: %s), assuming 1\n"), "/proc/stat", strerror(errno)); ++ printf("Couldn't count the number of CPUs (%s: %s), assuming 1\n", "/proc/stat", strerror(errno)); + return 1; + } + +@@ -65,7 +62,7 @@ static void proc_cpufreq_output(void) + unsigned int max_pctg = 0; + unsigned long min, max; + +- printf(gettext(" minimum CPU frequency - maximum CPU frequency - governor\n")); ++ printf(" minimum CPU frequency - maximum CPU frequency - governor\n"); + + nr_cpus = count_cpus(); + for (cpu=0; cpu < nr_cpus; cpu++) { +@@ -153,26 +150,26 @@ static void debug_output_one(unsigned in + struct cpufreq_stats *stats; + + if (cpufreq_cpu_exists(cpu)) { +- printf(gettext ("couldn't analyze CPU %d as it doesn't seem to be present\n"), cpu); ++ printf("couldn't analyze CPU %d as it doesn't seem to be present\n", cpu); + return; + } + +- printf(gettext ("analyzing CPU %d:\n"), cpu); ++ printf("analyzing CPU %d:\n", cpu); + + freq_kernel = cpufreq_get_freq_kernel(cpu); + freq_hardware = cpufreq_get_freq_hardware(cpu); + + driver = cpufreq_get_driver(cpu); + if (!driver) { +- printf(gettext (" no or unknown cpufreq driver is active on this CPU\n")); ++ printf(" no or unknown cpufreq driver is active on this CPU\n"); + } else { +- printf(gettext (" driver: %s\n"), driver); ++ printf(" driver: %s\n", driver); + cpufreq_put_driver(driver); + } + + cpus = cpufreq_get_related_cpus(cpu); + if (cpus) { +- printf(gettext (" CPUs which run at the same hardware frequency: ")); ++ printf(" CPUs which run at the same hardware frequency: "); + while (cpus->next) { + printf("%d ", cpus->cpu); + cpus = cpus->next; +@@ -183,7 +180,7 @@ static void debug_output_one(unsigned in + + cpus = cpufreq_get_affected_cpus(cpu); + if (cpus) { +- printf(gettext (" CPUs which need to have their frequency coordinated by software: ")); ++ printf(" CPUs which need to have their frequency coordinated by software: "); + while (cpus->next) { + printf("%d ", cpus->cpu); + cpus = cpus->next; +@@ -194,13 +191,13 @@ static void debug_output_one(unsigned in + + latency = cpufreq_get_transition_latency(cpu); + if (latency) { +- printf(gettext (" maximum transition latency: ")); ++ printf(" maximum transition latency: "); + print_duration(latency); + printf(".\n"); + } + + if (!(cpufreq_get_hardware_limits(cpu, &min, &max))) { +- printf(gettext (" hardware limits: ")); ++ printf(" hardware limits: "); + print_speed(min); + printf(" - "); + print_speed(max); +@@ -209,7 +206,7 @@ static void debug_output_one(unsigned in + + freqs = cpufreq_get_available_frequencies(cpu); + if (freqs) { +- printf(gettext (" available frequency steps: ")); ++ printf(" available frequency steps: "); + while (freqs->next) { + print_speed(freqs->frequency); + printf(", "); +@@ -222,7 +219,7 @@ static void debug_output_one(unsigned in + + governors = cpufreq_get_available_governors(cpu); + if (governors) { +- printf(gettext (" available cpufreq governors: ")); ++ printf(" available cpufreq governors: "); + while (governors->next) { + printf("%s, ", governors->governor); + governors = governors->next; +@@ -233,23 +230,23 @@ static void debug_output_one(unsigned in + + policy = cpufreq_get_policy(cpu); + if (policy) { +- printf(gettext (" current policy: frequency should be within ")); ++ printf(" current policy: frequency should be within "); + print_speed(policy->min); +- printf(gettext (" and ")); ++ printf(" and "); + print_speed(policy->max); + + printf(".\n "); +- printf(gettext ("The governor \"%s\" may" +- " decide which speed to use\n within this range.\n"), ++ printf("The governor \"%s\" may" ++ " decide which speed to use\n within this range.\n", + policy->governor); + cpufreq_put_policy(policy); + } + + if (freq_kernel || freq_hardware) { +- printf(gettext (" current CPU frequency is ")); ++ printf(" current CPU frequency is "); + if (freq_hardware) { + print_speed(freq_hardware); +- printf(gettext (" (asserted by call to hardware)")); ++ printf(" (asserted by call to hardware)"); + } + else + print_speed(freq_kernel); +@@ -257,7 +254,7 @@ static void debug_output_one(unsigned in + } + stats = cpufreq_get_stats(cpu, &total_time); + if (stats) { +- printf(gettext (" cpufreq stats: ")); ++ printf(" cpufreq stats: "); + while (stats) { + print_speed(stats->frequency); + printf(":%.2f%%", (100.0 * stats->time_in_state) / total_time); +@@ -437,37 +434,37 @@ static int get_latency(unsigned int cpu, + + static void print_header(void) { + printf(PACKAGE " " VERSION ": cpufreq-info (C) Dominik Brodowski 2004-2009\n"); +- printf(gettext ("Report errors and bugs to %s, please.\n"), PACKAGE_BUGREPORT); ++ printf("Report errors and bugs to %s, please.\n", PACKAGE_BUGREPORT); + } + + static void print_help(void) { +- printf(gettext ("Usage: cpufreq-info [options]\n")); +- printf(gettext ("Options:\n")); +- printf(gettext (" -c CPU, --cpu CPU CPU number which information shall be determined about\n")); +- printf(gettext (" -e, --debug Prints out debug information\n")); +- printf(gettext (" -f, --freq Get frequency the CPU currently runs at, according\n" +- " to the cpufreq core *\n")); +- printf(gettext (" -w, --hwfreq Get frequency the CPU currently runs at, by reading\n" +- " it from hardware (only available to root) *\n")); +- printf(gettext (" -l, --hwlimits Determine the minimum and maximum CPU frequency allowed *\n")); +- printf(gettext (" -d, --driver Determines the used cpufreq kernel driver *\n")); +- printf(gettext (" -p, --policy Gets the currently used cpufreq policy *\n")); +- printf(gettext (" -g, --governors Determines available cpufreq governors *\n")); +- printf(gettext (" -r, --related-cpus Determines which CPUs run at the same hardware frequency *\n")); +- printf(gettext (" -a, --affected-cpus Determines which CPUs need to have their frequency\n" +- " coordinated by software *\n")); +- printf(gettext (" -s, --stats Shows cpufreq statistics if available\n")); +- printf(gettext (" -y, --latency Determines the maximum latency on CPU frequency changes *\n")); +- printf(gettext (" -o, --proc Prints out information like provided by the /proc/cpufreq\n" +- " interface in 2.4. and early 2.6. kernels\n")); +- printf(gettext (" -m, --human human-readable output for the -f, -w, -s and -y parameters\n")); +- printf(gettext (" -h, --help Prints out this screen\n")); ++ printf("Usage: cpufreq-info [options]\n"); ++ printf("Options:\n"); ++ printf(" -c CPU, --cpu CPU CPU number which information shall be determined about\n"); ++ printf(" -e, --debug Prints out debug information\n"); ++ printf(" -f, --freq Get frequency the CPU currently runs at, according\n" ++ " to the cpufreq core *\n"); ++ printf(" -w, --hwfreq Get frequency the CPU currently runs at, by reading\n" ++ " it from hardware (only available to root) *\n"); ++ printf(" -l, --hwlimits Determine the minimum and maximum CPU frequency allowed *\n"); ++ printf(" -d, --driver Determines the used cpufreq kernel driver *\n"); ++ printf(" -p, --policy Gets the currently used cpufreq policy *\n"); ++ printf(" -g, --governors Determines available cpufreq governors *\n"); ++ printf(" -r, --related-cpus Determines which CPUs run at the same hardware frequency *\n"); ++ printf(" -a, --affected-cpus Determines which CPUs need to have their frequency\n" ++ " coordinated by software *\n"); ++ printf(" -s, --stats Shows cpufreq statistics if available\n"); ++ printf(" -y, --latency Determines the maximum latency on CPU frequency changes *\n"); ++ printf(" -o, --proc Prints out information like provided by the /proc/cpufreq\n" ++ " interface in 2.4. and early 2.6. kernels\n"); ++ printf(" -m, --human human-readable output for the -f, -w, -s and -y parameters\n"); ++ printf(" -h, --help Prints out this screen\n"); + + printf("\n"); +- printf(gettext ("If no argument or only the -c, --cpu parameter is given, debug output about\n" +- "cpufreq is printed which is useful e.g. for reporting bugs.\n")); +- printf(gettext ("For the arguments marked with *, omitting the -c or --cpu argument is\n" +- "equivalent to setting it to zero\n")); ++ printf("If no argument or only the -c, --cpu parameter is given, debug output about\n" ++ "cpufreq is printed which is useful e.g. for reporting bugs.\n"); ++ printf("For the arguments marked with *, omitting the -c or --cpu argument is\n" ++ "equivalent to setting it to zero\n"); + } + + static struct option info_opts[] = { +@@ -497,9 +494,6 @@ int main(int argc, char **argv) { + unsigned int human = 0; + int output_param = 0; + +- setlocale(LC_ALL, ""); +- textdomain (PACKAGE); +- + do { + ret = getopt_long(argc, argv, "c:hoefwldpgrasmy", info_opts, NULL); + switch (ret) { +@@ -560,7 +554,7 @@ int main(int argc, char **argv) { + case 'o': + if (cpu_defined) { + print_header(); +- printf(gettext ("The argument passed to this tool can't be combined with passing a --cpu argument\n")); ++ printf("The argument passed to this tool can't be combined with passing a --cpu argument\n"); + return -EINVAL; + } + break; +@@ -573,13 +567,13 @@ int main(int argc, char **argv) { + switch (output_param) { + case -1: + print_header(); +- printf(gettext ("You can't specify more than one --cpu parameter and/or\n" +- "more than one output-specific argument\n")); ++ printf("You can't specify more than one --cpu parameter and/or\n" ++ "more than one output-specific argument\n"); + return -EINVAL; + break; + case '?': + print_header(); +- printf(gettext ("invalid or unknown argument\n")); ++ printf("invalid or unknown argument\n"); + print_help(); + ret = -EINVAL; + break; diff --git a/package/cpufrequtils/patches/patch-utils_set_c b/package/cpufrequtils/patches/patch-utils_set_c new file mode 100644 index 000000000..b1dee1b3f --- /dev/null +++ b/package/cpufrequtils/patches/patch-utils_set_c @@ -0,0 +1,118 @@ +--- cpufrequtils-007.orig/utils/set.c 2010-01-16 14:47:44.000000000 +0100 ++++ cpufrequtils-007/utils/set.c 2010-01-23 18:51:50.185869113 +0100 +@@ -12,9 +12,6 @@ + #include <limits.h> + #include <string.h> + #include <ctype.h> +-#include <libintl.h> +-#include <locale.h> +- + #include <getopt.h> + + #include "cpufreq.h" +@@ -28,29 +25,29 @@ + static void print_header(void) + { + printf(PACKAGE " " VERSION ": cpufreq-set (C) Dominik Brodowski 2004-2009\n"); +- printf(gettext("Report errors and bugs to %s, please.\n"), PACKAGE_BUGREPORT); ++ printf("Report errors and bugs to %s, please.\n", PACKAGE_BUGREPORT); + } + + static void print_help(void) + { +- printf(gettext("Usage: cpufreq-set [options]\n")); +- printf(gettext("Options:\n")); +- printf(gettext(" -c CPU, --cpu CPU number of CPU where cpufreq settings shall be modified\n")); +- printf(gettext(" -d FREQ, --min FREQ new minimum CPU frequency the governor may select\n")); +- printf(gettext(" -u FREQ, --max FREQ new maximum CPU frequency the governor may select\n")); +- printf(gettext(" -g GOV, --governor GOV new cpufreq governor\n")); +- printf(gettext(" -f FREQ, --freq FREQ specific frequency to be set. Requires userspace\n" +- " governor to be available and loaded\n")); +- printf(gettext(" -r, --related Switches all hardware-related CPUs\n")); +- printf(gettext(" -h, --help Prints out this screen\n")); ++ printf("Usage: cpufreq-set [options]\n"); ++ printf("Options:\n"); ++ printf(" -c CPU, --cpu CPU number of CPU where cpufreq settings shall be modified\n"); ++ printf(" -d FREQ, --min FREQ new minimum CPU frequency the governor may select\n"); ++ printf(" -u FREQ, --max FREQ new maximum CPU frequency the governor may select\n"); ++ printf(" -g GOV, --governor GOV new cpufreq governor\n"); ++ printf(" -f FREQ, --freq FREQ specific frequency to be set. Requires userspace\n" ++ " governor to be available and loaded\n"); ++ printf(" -r, --related Switches all hardware-related CPUs\n"); ++ printf(" -h, --help Prints out this screen\n"); + printf("\n"); +- printf(gettext("Notes:\n" ++ printf("Notes:\n" + "1. Omitting the -c or --cpu argument is equivalent to setting it to zero\n" + "2. The -f FREQ, --freq FREQ parameter cannot be combined with any other parameter\n" + " except the -c CPU, --cpu CPU parameter\n" + "3. FREQuencies can be passed in Hz, kHz (default), MHz, GHz, or THz\n" + " by postfixing the value with the wanted unit name, without any space\n" +- " (FREQuency in kHz =^ Hz * 0.001 =^ MHz * 1000 =^ GHz * 1000000).\n")); ++ " (FREQuency in kHz =^ Hz * 0.001 =^ MHz * 1000 =^ GHz * 1000000).\n"); + + } + +@@ -66,13 +63,13 @@ static struct option set_opts[] = { + + static void print_error(void) + { +- printf(gettext("Error setting new values. Common errors:\n" ++ printf("Error setting new values. Common errors:\n" + "- Do you have proper administration rights? (super-user?)\n" + "- Is the governor you requested available and modprobed?\n" + "- Trying to set an invalid policy?\n" + "- Trying to set a specific frequency, but userspace governor is not available,\n" + " for example because of hardware which cannot be set to a specific frequency\n" +- " or because the userspace governor isn't loaded?\n")); ++ " or because the userspace governor isn't loaded?\n"); + }; + + struct freq_units { +@@ -92,7 +89,7 @@ const struct freq_units def_units[] = { + static void print_unknown_arg(void) + { + print_header(); +- printf(gettext("invalid or unknown argument\n")); ++ printf("invalid or unknown argument\n"); + print_help(); + } + +@@ -180,7 +177,7 @@ static int do_new_policy(unsigned int cp + int ret; + + if (!cur_pol) { +- printf(gettext("wrong, unknown or unhandled CPU?\n")); ++ printf("wrong, unknown or unhandled CPU?\n"); + return -EINVAL; + } + +@@ -248,9 +245,6 @@ int main(int argc, char **argv) + }; + struct cpufreq_affected_cpus *cpus = NULL; + +- setlocale(LC_ALL, ""); +- textdomain (PACKAGE); +- + /* parameter parsing */ + do { + ret = getopt_long(argc, argv, "c:d:u:g:f:hr", set_opts, NULL); +@@ -333,14 +327,14 @@ int main(int argc, char **argv) + } + + if (freq && policychange) { +- printf(gettext("the -f/--freq parameter cannot be combined with -d/--min, -u/--max or\n" +- "-g/--governor parameters\n")); ++ printf("the -f/--freq parameter cannot be combined with -d/--min, -u/--max or\n" ++ "-g/--governor parameters\n"); + return -EINVAL; + } + + if (!freq && !policychange) { +- printf(gettext("At least one parameter out of -f/--freq, -d/--min, -u/--max, and\n" +- "-g/--governor must be passed\n")); ++ printf("At least one parameter out of -f/--freq, -d/--min, -u/--max, and\n" ++ "-g/--governor must be passed\n"); + return -EINVAL; + } + |