Author: pebender
Date: Fri Jun 12 08:38:41 2009
New Revision: 4930
Modified:
trunk/gar-minimyth/html/minimyth/document-changelog.txt
trunk/gar-minimyth/script/meta/minimyth/files/source/rootfs/etc/rc.d/init/conf/MM_CPU.pm
trunk/gar-minimyth/script/meta/minimyth/files/source/rootfs/etc/rc.d/init/cpu.pm
Log:
- Moved cpu's frequency scaling / governor module detection and loading to
earlier in the init process.
Modified: trunk/gar-minimyth/html/minimyth/document-changelog.txt
==============================================================================
--- trunk/gar-minimyth/html/minimyth/document-changelog.txt (original)
+++ trunk/gar-minimyth/html/minimyth/document-changelog.txt Fri Jun 12
08:38:41 2009
@@ -1,7 +1,7 @@
MiniMyth Changelog
--------------------------------------------------------------------------------
-Changes since 67 (2009-06-11):
+Changes since 67 (2009-06-12):
Current MythTV versions
MythTV 0.20-softpad: version 0.20.2.softpad, release-0-20-fixes branch
svn 16082 and
@@ -12,6 +12,8 @@
MythTV trunk: version trunk.20667 trunk svn 20667.
Modified init
+ - Moved cpu's frequency scaling / governor module detection and
loading to
+ earlier in the init process.
- Moved g15daemon's uinput kernel module detection and loading to
earlier
in the init process.
- Moved wiimote's uinput kernel module detection and loading to earlier
Modified:
trunk/gar-minimyth/script/meta/minimyth/files/source/rootfs/etc/rc.d/init/conf/MM_CPU.pm
==============================================================================
---
trunk/gar-minimyth/script/meta/minimyth/files/source/rootfs/etc/rc.d/init/conf/MM_CPU.pm
(original)
+++
trunk/gar-minimyth/script/meta/minimyth/files/source/rootfs/etc/rc.d/init/conf/MM_CPU.pm
Fri Jun 12 08:38:41 2009
@@ -7,6 +7,8 @@
use warnings;
use feature "switch";
+use File::Spec ();
+
my %var_list;
sub var_list
@@ -123,7 +125,7 @@
};
$var_list{'MM_CPU_KERNEL_MODULE_LIST'} =
{
- prerequisite => [ 'MM_CPU_FAMILY', 'MM_CPU_MODEL', 'MM_CPU_VENDOR' ],
+ prerequisite =>
[ 'MM_CPU_FAMILY', 'MM_CPU_MODEL', 'MM_CPU_VENDOR', 'MM_CPU_FREQUENCY_GOVERNOR'
],
value_clean => sub
{
my $minimyth = shift;
@@ -142,6 +144,8 @@
my @kernel_modules;
+ my $devnull = File::Spec->devnull;
+
my $vendor = $minimyth->var_get('MM_CPU_VENDOR');
my $family = $minimyth->var_get('MM_CPU_FAMILY');
my $model = $minimyth->var_get('MM_CPU_MODEL');
@@ -166,6 +170,54 @@
}
}
}
+ }
+
+ if ($minimyth->var_get('MM_CPU_FREQUENCY_GOVERNOR')
ne 'performance')
+ {
+ my $kernel_version = '';
+ if ((-d '/lib/modules') &&
+ (opendir(DIR, '/lib/modules')))
+ {
+ foreach (grep(! /^\./, readdir(DIR)))
+ {
+ $kernel_version = $_;
+ last;
+ }
+ closedir(DIR);
+ }
+ my $kernel_arch = '';
+ if (($kernel_version) &&
+ (-d "/lib/modules/$kernel_version/kernel/arch") &&
+ (opendir(DIR, "/lib/modules/$kernel_version/kernel/arch")))
+ {
+ foreach (grep(! /^\./, readdir(DIR)))
+ {
+ $kernel_arch = $_;
+ last;
+ }
+ closedir(DIR);
+ }
+ if (($kernel_version) && ($kernel_arch) &&
+
(-d "/lib/modules/$kernel_version/kernel/arch/$kernel_arch/kernel/cpu/cpufreq")
&&
+
(opendir(DIR,
"/lib/modules/$kernel_version/kernel/arch/$kernel_arch/kernel/cpu/cpufreq")))
+ {
+ foreach (grep(! /^\./, readdir(DIR)))
+ {
+ if (/^(.*)\.ko$/)
+ {
+ # Kernel modules that do not support the CPU
should fail to load.
+ if (system(qq(/sbin/modprobe $1 > $devnull 2>&1))
== 0)
+ {
+ system(qq(/sbin/modprobe -r $1 > $devnull
2>&1));
+ push(@kernel_modules, $1);
+ }
+ }
+ }
+ closedir(DIR);
+ }
+
+ # Add frequency governor kernel module.
+ push(@kernel_modules, 'cpufreq-' .
$minimyth->var_get('MM_CPU_FREQUENCY_GOVERNOR'));
}
return join(' ', @kernel_modules);
Modified:
trunk/gar-minimyth/script/meta/minimyth/files/source/rootfs/etc/rc.d/init/cpu.pm
==============================================================================
---
trunk/gar-minimyth/script/meta/minimyth/files/source/rootfs/etc/rc.d/init/cpu.pm
(original)
+++
trunk/gar-minimyth/script/meta/minimyth/files/source/rootfs/etc/rc.d/init/cpu.pm
Fri Jun 12 08:38:41 2009
@@ -55,55 +55,6 @@
if ($minimyth->var_get('MM_CPU_FREQUENCY_GOVERNOR') ne 'performance')
{
- # Load CPU frequency scaling processor kernel modules.
- # Kernel modules that do not support the CPU should fail to load.
- my $kernel_version = '';
- if ((-d '/lib/modules') &&
- (opendir(DIR, '/lib/modules')))
- {
- foreach (grep(! /^\./, readdir(DIR)))
- {
- $kernel_version = $_;
- last;
- }
- closedir(DIR);
- }
- my $kernel_arch = '';
- if (($kernel_version) &&
- (-d "/lib/modules/$kernel_version/kernel/arch") &&
- (opendir(DIR, "/lib/modules/$kernel_version/kernel/arch")))
- {
- foreach (grep(! /^\./, readdir(DIR)))
- {
- $kernel_arch = $_;
- last;
- }
- closedir(DIR);
- }
- if (($kernel_version) && ($kernel_arch) &&
-
(-d "/lib/modules/$kernel_version/kernel/arch/$kernel_arch/kernel/cpu/cpufreq")
&&
-
(opendir(DIR,
"/lib/modules/$kernel_version/kernel/arch/$kernel_arch/kernel/cpu/cpufreq")))
- {
- foreach (grep(! /^\./, readdir(DIR)))
- {
- if (/^(.*)\.ko$/)
- {
- system(qq(/sbin/modprobe $1 > $devnull 2>&1));
- }
- }
- closedir(DIR);
- }
-
- # Load CPU frequency governor kernel module.
- my $kernel_module = 'cpufreq-' .
$minimyth->var_get('MM_CPU_FREQUENCY_GOVERNOR');
- if (system(qq(/sbin/modprobe $kernel_module > $devnull 2>&1)) != 0)
- {
- $minimyth->message_output('err', "failed to load kernel
module: $kernel_module");
- return 0;
- }
- # Wait for everything to settle.
- system(qq(/sbin/udevadm settle --timeout=60));
-
if ((-d '/sys/devices/system/cpu') &&
(opendir(DIR, '/sys/devices/system/cpu')))
{
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"minimyth-commits" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/minimyth-commits?hl=en
-~----------~----~----~----~------~----~------~--~---