I like it. Much more deterministic.
Do it.
-Brian
Thus spake A Righi ([EMAIL PROTECTED]):
Brian,
I propose the attached patch to retrieve the needed UYOK module files.
Using modinfo instead of doing some finds on /lib/modules/$uname_r
should be able to handle more particular cases... for example with SuSE
if you use bonding the modules when loaded is renamed to the particular
interface (bond0 for example).
Anyway in general is possible to load a module and rename it with a
custom string so that in /proc/modules will appear a different name...
modinfo is able in any case to map the module name into the right filename.
What do you think?
Cheers,
-Andrea
Index: lib/SystemImager/UseYourOwnKernel.pm
===================================================================
--- lib/SystemImager/UseYourOwnKernel.pm (revision 3487)
+++ lib/SystemImager/UseYourOwnKernel.pm (working copy)
@@ -97,18 +97,8 @@
print ">>> Appending insmod commands to
./my_modules_dir/INSMOD_COMMANDS...\n" if( $verbose );
my @modules = get_load_ordered_list_of_running_modules();
foreach my $module ( @modules ) {
-
- $module =~ s/[-_]/(-|_)/g; # match against either
underscores or hyphens -BEF-
-
- if( $module_paths =~ m#(.*/$module\.(ko|o))# ) {
-
- print " >> insmod $1\n" if( $verbose );
- print FILE "insmod $1\n";
-
- } else {
-
- print STDERR qq(\nWARNING: Couldn't find module
"$module" (skipping it)!\n);
- }
+ print " >> insmod $module\n" if( $verbose );
+ print FILE "insmod $1\n";
}
close(FILE);
@@ -490,13 +480,18 @@
open(MODULES,"<$file") or die("Couldn't open $file for reading.");
while(<MODULES>) {
my ($module) = split;
- push (@modules, $module);
+ chomp($module_file = `modinfo -F filename $module
2>/dev/null`);
+ if ($?) {
+ print STDERR qq(WARNING: Couldn't find module "$module
" (skipping it)!\n);
+ next;
+ }
+ push (@modules, $module_file);
}
close(MODULES);
-
+
# reverse order list of running modules
@modules = reverse(@modules);
-
+
return @modules;
}
--
Brian Elliott Finley
Mobile: 630.631.6621
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Sisuite-devel mailing list
Sisuite-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sisuite-devel