Hello community, here is the log from the commit of package linuxrc checked in at Thu Jul 13 17:26:37 CEST 2006. -------- --- linuxrc/linuxrc.changes 2006-06-09 15:08:11.000000000 +0200 +++ linuxrc/linuxrc.changes 2006-07-13 14:53:41.000000000 +0200 @@ -1,0 +2,5 @@ +Thu Jul 13 14:51:36 CEST 2006 - trenn@suse.de + +- activate dynamic cpufreq on supported machines (#176791) + +------------------------------------------------------------------- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ linuxrc.spec ++++++ --- /var/tmp/diff_new_pack.mwS0jq/_old 2006-07-13 17:26:25.000000000 +0200 +++ /var/tmp/diff_new_pack.mwS0jq/_new 2006-07-13 17:26:25.000000000 +0200 @@ -17,7 +17,7 @@ Autoreqprov: on Summary: SUSE Installation Program Version: 2.1.0 -Release: 1 +Release: 2 Source: linuxrc-2.1.0.tar.bz2 BuildRoot: %{_tmppath}/%{name}-%{version}-build @@ -53,6 +53,8 @@ %doc linuxrc.html %changelog -n linuxrc +* Thu Jul 13 2006 - trenn@suse.de +- activate dynamic cpufreq on supported machines (#176791) * Fri Jun 09 2006 - snwint@suse.de - fixed device name matching for hard disk install (#177055) - read /proc/cmdline with fread() instead of fgets() (i.e. do not ++++++ linuxrc-2.1.0.tar.bz2 ++++++ diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/linuxrc-2.1.0/linuxrc.c new/linuxrc-2.1.0/linuxrc.c --- old/linuxrc-2.1.0/linuxrc.c 2006-05-11 11:03:10.000000000 +0200 +++ new/linuxrc-2.1.0/linuxrc.c 2006-07-13 14:51:05.000000000 +0200 @@ -1009,6 +1009,13 @@ } } + /* Try to activate dynamic frequency scaling */ +#if (defined(__i386__) || defined(__x86_64__) || defined(__PPC__)) + fprintf(stderr, "Activate dynamic frequency scaling..."); + i = cpufreq_activate(); + fprintf(stderr, "%s\n", i ? "failed" : "done"); +#endif + if(!config.manual) { if(auto2_init()) { config.manual = 0; /* ###### does it make sense? */ diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/linuxrc-2.1.0/util.c new/linuxrc-2.1.0/util.c --- old/linuxrc-2.1.0/util.c 2006-05-18 11:17:47.000000000 +0200 +++ new/linuxrc-2.1.0/util.c 2006-07-13 14:51:05.000000000 +0200 @@ -4731,3 +4731,41 @@ return de ? 1 : 0; } + +/* + * Return: + * -1 : no hardware support + * 0 : ok + */ +#if (defined(__i386__) || defined(__x86_64__) || defined(__PPC__)) +int cpufreq_activate(void) +{ + char attrpath[256]; + unsigned i, max_cpu = 256; + FILE *f; + + for(i = 0; i < max_cpu; i++) { + sprintf(attrpath, "/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor", i); + if((f = fopen(attrpath, "w"))) { + fwrite("ondemand", 1, 8, f); + fclose(f); + } + else { + break; + } + } + + if(!i) { + /* these modules (nearly) always load successfully... + remove them again if activating cpufreq failed */ + mod_unload_module("freq_table"); + + return -1; + } + else { + fprintf (stderr, "detected cpufreq support...\n"); + } + + return 0; +} +#endif diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/linuxrc-2.1.0/util.h new/linuxrc-2.1.0/util.h --- old/linuxrc-2.1.0/util.h 2006-04-26 16:25:13.000000000 +0200 +++ new/linuxrc-2.1.0/util.h 2006-07-13 14:51:05.000000000 +0200 @@ -154,3 +154,7 @@ char *get_translation(slist_t *trans, char *locale); int util_process_running(char *name); +#if (defined(__i386__) || defined(__x86_64__) || defined(__PPC__)) +int cpufreq_activate(void); +#endif + ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-commit-unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit-help@opensuse.org