diff options
author | Olivier Blin <oblin@mandriva.com> | 2007-10-03 22:16:35 +0000 |
---|---|---|
committer | Olivier Blin <oblin@mandriva.com> | 2007-10-03 22:16:35 +0000 |
commit | cdcd978381f091594ae7d4fd1cbb2976301cf03c (patch) | |
tree | bad1de9da3cb4599fd52d61cb0836087ef90ef12 /kernel | |
parent | f1f68dc05ad89a16080680fabfe423758df2c35a (diff) | |
download | drakx-backup-do-not-use-cdcd978381f091594ae7d4fd1cbb2976301cf03c.tar drakx-backup-do-not-use-cdcd978381f091594ae7d4fd1cbb2976301cf03c.tar.gz drakx-backup-do-not-use-cdcd978381f091594ae7d4fd1cbb2976301cf03c.tar.bz2 drakx-backup-do-not-use-cdcd978381f091594ae7d4fd1cbb2976301cf03c.tar.xz drakx-backup-do-not-use-cdcd978381f091594ae7d4fd1cbb2976301cf03c.zip |
add helper to get kernel module path (to be used in draklive)
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/list_modules.pm | 20 |
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|(.*)/(.*)|; |