summaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.com>2007-10-03 22:16:35 +0000
committerOlivier Blin <oblin@mandriva.com>2007-10-03 22:16:35 +0000
commitcdcd978381f091594ae7d4fd1cbb2976301cf03c (patch)
treebad1de9da3cb4599fd52d61cb0836087ef90ef12 /kernel
parentf1f68dc05ad89a16080680fabfe423758df2c35a (diff)
downloaddrakx-cdcd978381f091594ae7d4fd1cbb2976301cf03c.tar
drakx-cdcd978381f091594ae7d4fd1cbb2976301cf03c.tar.gz
drakx-cdcd978381f091594ae7d4fd1cbb2976301cf03c.tar.bz2
drakx-cdcd978381f091594ae7d4fd1cbb2976301cf03c.tar.xz
drakx-cdcd978381f091594ae7d4fd1cbb2976301cf03c.zip
add helper to get kernel module path (to be used in draklive)
Diffstat (limited to 'kernel')
-rw-r--r--kernel/list_modules.pm20
1 files changed, 15 insertions, 5 deletions
diff --git a/kernel/list_modules.pm b/kernel/list_modules.pm
index e9d5d3965..b5359c6f6 100644
--- a/kernel/list_modules.pm
+++ b/kernel/list_modules.pm
@@ -287,13 +287,18 @@ sub load_dependencies {
%moddeps = ();
foreach (cat_($file)) {
- s![^ ]*/!!g;
- s!\.ko!!g;
- s!\.gz!!g;
- my ($filename, $d) = split ':';
- my ($modname, @deps) = map { filename2modname($_) } $filename, split(' ', $d);
+ my ($m, $d) = split ':';
+ my $path = $m;
+ my ($filename, @fdeps) = map {
+ s![^ ]*/!!g;
+ s!\.ko!!g;
+ s!\.gz!!g;
+ $_;
+ } $m, split(' ', $d);
+ my ($modname, @deps) = map { filename2modname($_) } $filename, @fdeps;
$moddeps{$modname}{deps} = \@deps;
$moddeps{$modname}{filename} = $filename;
+ $moddeps{$modname}{path} = $path;
}
}
@@ -318,6 +323,11 @@ sub modname2filename {
$moddeps{$_[0]}{filename};
}
+sub modname2path {
+ load_default_moddeps() if !%moddeps;
+ $moddeps{$_[0]}{path};
+}
+
sub category2modules {
map {
my ($t1, $t2s) = m|(.*)/(.*)|;