summaryrefslogtreecommitdiffstats
path: root/perl-install/modules.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2001-09-09 00:00:49 +0000
committerPascal Rigaux <pixel@mandriva.com>2001-09-09 00:00:49 +0000
commit5ef51bed47a5f64eae41bee88ce2dbed807e68e8 (patch)
treec6eb72a7b530306cf0f4123b8a8e21a4ba0bf20f /perl-install/modules.pm
parent19f8355306d375d7b3b8d074be6b0359455b0376 (diff)
downloaddrakx-backup-do-not-use-5ef51bed47a5f64eae41bee88ce2dbed807e68e8.tar
drakx-backup-do-not-use-5ef51bed47a5f64eae41bee88ce2dbed807e68e8.tar.gz
drakx-backup-do-not-use-5ef51bed47a5f64eae41bee88ce2dbed807e68e8.tar.bz2
drakx-backup-do-not-use-5ef51bed47a5f64eae41bee88ce2dbed807e68e8.tar.xz
drakx-backup-do-not-use-5ef51bed47a5f64eae41bee88ce2dbed807e68e8.zip
(write_conf): switch to "probeall scsi_hostadapter ..."
Diffstat (limited to 'perl-install/modules.pm')
-rw-r--r--perl-install/modules.pm24
1 files changed, 14 insertions, 10 deletions
diff --git a/perl-install/modules.pm b/perl-install/modules.pm
index b81d29f82..f5f80d7cd 100644
--- a/perl-install/modules.pm
+++ b/perl-install/modules.pm
@@ -483,7 +483,7 @@ sub add_alias {
my ($alias, $name) = @_;
$name =~ /ignore/ and return;
/\Q$alias/ && $conf{$_}{alias} && $conf{$_}{alias} eq $name and return $_ foreach keys %conf;
- $alias .= $scsi++ || '' if $alias eq 'scsi_hostadapter';
+ $alias .= ++$scsi if $alias eq 'scsi_hostadapter';
log::l("adding alias $alias to $name");
$conf{$alias}{alias} ||= $name;
if ($name =~ /^snd-card-/) {
@@ -638,7 +638,7 @@ sub read_conf($;$) {
foreach (cat_($file)) {
do {
$c{$2}{$1} = $3;
- $$scsi = max($$scsi, $1 || 0) if /^\s*alias\s+scsi_hostadapter(\d*)/ && $scsi; #- space added to make perl2fcalls happy!
+ $$scsi = max($$scsi, $1 || 0) if /^\s*alias\s+scsi_hostadapter(\d*)/ && $scsi;
} if /^\s*(\S+)\s+(\S+)\s+(.*?)\s*$/;
}
#- cheating here: not handling aliases of aliases
@@ -666,17 +666,21 @@ sub write_conf {
my $file = "$prefix/etc/modules.conf";
rename "$prefix/etc/conf.modules", $file; #- make the switch to new name if needed
- my @scsi_hostadapters = $scsi ? map { "scsi_hostadapter$_" } ('', 1..$scsi-1) : ();
- $conf{'scsi-hosts'}{probeall} = join(' ', @scsi_hostadapters) if @scsi_hostadapters;
+ my @scsi_hostadapters = $scsi ? map { "scsi_hostadapter$_" } (1 .. $scsi) : ();
+ $conf{scsi_hostadapter}{probeall} = join(' ', @scsi_hostadapters) if @scsi_hostadapters;
- #- remove the post-install supermount stuff. We now do it in /etc/modules
#- Substitute new aliases in modules.conf (if config has changed)
- substInFile { $_ = '' if /^post-install supermount/ } $file;
substInFile {
- my ($type,$alias,$module) = split /\s+/, $_;
- if ($type ne "loaded" &&
- $conf{$alias}{alias} &&
- $conf{$alias}{alias} !~ /$module/) {
+ my ($type,$alias,$module) = split /\s+/, chomp_($_), 3;
+ if ($type eq 'post-install' && $alias eq 'supermount') {
+ #- remove the post-install supermount stuff.
+ $_ = '';
+ } elsif ($type eq 'alias' && $alias eq 'scsi_hostadapter') {
+ #- remove old alias scsi_hostadapter which is replaced by probeall
+ $_ = '';
+ } elsif ($type ne "loaded" &&
+ $conf{$alias}{$type} &&
+ $conf{$alias}{$type} ne $module) {
$_ = "$type $alias $conf{$alias}{alias} \n";
}
} $file;