From 61b5307bfdd85a3c95b1c2813f2bcfa043856a6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwenol=C3=A9=20Beauchesne?= Date: Fri, 30 Nov 2001 09:13:30 +0000 Subject: Suckiness fixes from mainline (gc): - Do parse /proc/modules in reverse order - Fix "convert old scsi_hostadapter's to new probeall" scheme --- perl-install/modules.pm | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/perl-install/modules.pm b/perl-install/modules.pm index 9a64a1046..67da69e6f 100644 --- a/perl-install/modules.pm +++ b/perl-install/modules.pm @@ -621,7 +621,7 @@ sub load_raw { } sub read_already_loaded() { - foreach (cat_("/proc/modules")) { + foreach (reverse cat_("/proc/modules")) { my ($name) = split; $conf{$name}{loaded} = 1; when_load($name, $drivers{$name}{type}); @@ -661,9 +661,11 @@ sub read_conf { } } #- convert old scsi_hostadapter's to new probeall - while (my ($alias, $type) = each %c) { - $alias =~ /^scsi_hostadapter/ && $type->{alias} or next; - push @{$c{scsi_hostadapter}{probeall} ||= []}, delete $type->{alias}; + my @old_scsi_hostadapters = + map { $_->[0] } sort { $a->[1] <=> $b->[1] } + map { if_(/^scsi_hostadapter(\d*)/ && $c{$_}{alias}, [ $_, $1 || 0 ]) } keys %c; + foreach my $alias (@old_scsi_hostadapters) { + push @{$c{scsi_hostadapter}{probeall} ||= []}, delete $c{$alias}{alias}; } \%c; -- cgit v1.2.1