summaryrefslogtreecommitdiffstats
path: root/perl-install/modules/modprobe_conf.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2004-08-10 02:00:45 +0000
committerPascal Rigaux <pixel@mandriva.com>2004-08-10 02:00:45 +0000
commitff2191b0d6fe81de6447fe1d453f8640f1a19b42 (patch)
tree3436062bace3fe45eb9d345ec6b443f28c48d554 /perl-install/modules/modprobe_conf.pm
parentec3d78cf088439fbf9f9c71f75565417ccad831b (diff)
downloaddrakx-ff2191b0d6fe81de6447fe1d453f8640f1a19b42.tar
drakx-ff2191b0d6fe81de6447fe1d453f8640f1a19b42.tar.gz
drakx-ff2191b0d6fe81de6447fe1d453f8640f1a19b42.tar.bz2
drakx-ff2191b0d6fe81de6447fe1d453f8640f1a19b42.tar.xz
drakx-ff2191b0d6fe81de6447fe1d453f8640f1a19b42.zip
internally keep module names according to what we configure (and our kernel, 2.4 or 2.6)
Diffstat (limited to 'perl-install/modules/modprobe_conf.pm')
-rw-r--r--perl-install/modules/modprobe_conf.pm13
1 files changed, 11 insertions, 2 deletions
diff --git a/perl-install/modules/modprobe_conf.pm b/perl-install/modules/modprobe_conf.pm
index c371c1e06..1bc5e478c 100644
--- a/perl-install/modules/modprobe_conf.pm
+++ b/perl-install/modules/modprobe_conf.pm
@@ -9,8 +9,15 @@ our @ISA = qw(modules::any_conf);
sub file { '/etc/modprobe.conf' }
sub handled_fields { qw(alias options install remove) }
+sub mapping {
+ my ($_conf, @modules) = @_;
+ my @l = map { modules::mapping_24_26($_) } @modules;
+ wantarray ? @l : $l[0];
+}
+
sub get_above {
my ($conf, $module) = @_;
+ $module = $conf->mapping($module);
my (undef, $after) = parse_non_virtual($module, $conf->{$module}{install}) or return;
my ($l, $_other_cmds) = partition_modprobes($after);
@@ -18,17 +25,19 @@ sub get_above {
}
sub set_above {
my ($conf, $module, $o_modules) = @_;
+ $module = $conf->mapping($module);
+ my @modules = $conf->mapping(split(' ', $o_modules || ''));
{ #- first add to "install" command
my ($before, $after) = parse_non_virtual($module, $conf->{$module}{install});
my ($_previous_modules, $other_cmds) = partition_modprobes($after || '');
- $after = join('; ', @$other_cmds, map { "/sbin/modprobe $_" } split(' ', $o_modules || ''));
+ $after = join('; ', @$other_cmds, map { "/sbin/modprobe $_" } @modules);
$conf->{$module}{install} = unparse_non_virtual($module, '--ignore-install', $before, $after);
}
{ #- then to "remove" command
my ($before, $after) = parse_non_virtual($module, $conf->{$module}{remove});
my ($_previous_modules, $other_cmds) = partition_modprobes($before || '');
- $before = join('; ', @$other_cmds, map { "/sbin/modprobe -r $_" } split(' ', $o_modules || ''));
+ $before = join('; ', @$other_cmds, map { "/sbin/modprobe -r $_" } @modules);
$conf->{$module}{remove} = unparse_non_virtual($module, '-r --ignore-remove', $before, $after);
}
}