From 237ff88644c53046c933f6aaf18de8bc5515cb0d Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Mon, 4 Oct 2004 07:20:50 +0000 Subject: do not failled when hw db is corrupted --- perl-install/standalone/service_harddrake | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'perl-install/standalone/service_harddrake') diff --git a/perl-install/standalone/service_harddrake b/perl-install/standalone/service_harddrake index bb5b86c75..08114a63c 100755 --- a/perl-install/standalone/service_harddrake +++ b/perl-install/standalone/service_harddrake @@ -65,7 +65,15 @@ if (find { $_->{driver} =~ /Card:NVIDIA/ } detect_devices::probeall()) { my $is_globetrotter = -f '/usr/sbin/mdkmove'; # first run ? if not read old hw config -my $previous_config = -f $last_boot_config && -s $last_boot_config ? Storable::retrieve($last_boot_config) : {}; +my $previous_config; + +if (-f $last_boot_config && -s $last_boot_config) { + eval { $previous_config = Storable::retrieve($last_boot_config) }; + log::explanations("resetting previous harware file ($@)") if $@; +} + +$previous_config ||= {}; + $previous_config = $$previous_config if ref($previous_config) !~ /HASH/; my (%config, $wait); my $in; @@ -105,7 +113,13 @@ foreach my $hw_class (@harddrake::data::tree) { modules::load_and_configure($modules_conf, 'ohci1394') if $Ident eq 'FIREWIRE_CONTROLLER' && any { $_->{driver} eq 'ohci1394' } @added; @added || @was_removed or next; + + if (harddrake::data::is_removable($Ident)) { + modules::load_category('floppy') if $Ident eq 'FLOPPY'; + } + next if $Ident eq 'MOUSE' && $curr_kernel ne $prev_kernel; + my @configurator_pool; if (harddrake::data::is_removable($Ident)) { foreach my $device (@ID{@added}) { -- cgit v1.2.1