diff options
author | Olivier Blin <oblin@mandriva.com> | 2008-01-02 18:35:18 +0000 |
---|---|---|
committer | Olivier Blin <oblin@mandriva.com> | 2008-01-02 18:35:18 +0000 |
commit | 06918ccb39aed05ce9b1a375b2b0d11d86cf26aa (patch) | |
tree | 8a7090a0a1ad050d78ac90c9bb39b3188e4ac99c | |
parent | b55506c8fc80035af7244edcc98c52ef8ddcc2c8 (diff) | |
download | drakx-06918ccb39aed05ce9b1a375b2b0d11d86cf26aa.tar drakx-06918ccb39aed05ce9b1a375b2b0d11d86cf26aa.tar.gz drakx-06918ccb39aed05ce9b1a375b2b0d11d86cf26aa.tar.bz2 drakx-06918ccb39aed05ce9b1a375b2b0d11d86cf26aa.tar.xz drakx-06918ccb39aed05ce9b1a375b2b0d11d86cf26aa.zip |
harddrake: check that media are not USB keys before auto-configuring them (#34568)
-rw-r--r-- | perl-install/NEWS | 1 | ||||
-rw-r--r-- | perl-install/harddrake/data.pm | 11 | ||||
-rwxr-xr-x | perl-install/standalone/service_harddrake | 6 |
3 files changed, 10 insertions, 8 deletions
diff --git a/perl-install/NEWS b/perl-install/NEWS index 7cfefeddb..94970fd4b 100644 --- a/perl-install/NEWS +++ b/perl-install/NEWS @@ -17,6 +17,7 @@ displayed with parallell init o allow to set zero values in module options (#26515) o make "Run config tool" available again (#34794) + o check that media are not USB keys before auto-configuring them (#34568) Version 10.4.239 - 5 October 2007, by Thierry Vignaud diff --git a/perl-install/harddrake/data.pm b/perl-install/harddrake/data.pm index 0e4c3a069..d4e8d2ee2 100644 --- a/perl-install/harddrake/data.pm +++ b/perl-install/harddrake/data.pm @@ -36,7 +36,8 @@ sub f { # FIXME: add translated items sub is_removable { member($_[0], qw(FLOPPY ZIP DVDROM CDROM BURNER)) } -sub is_auto_configurable_media { is_removable($_[0]) || member($_[0], qw(HARDDISK)) } +sub is_auto_configurable_class { is_removable($_[0]) || member($_[0], qw(HARDDISK)) } +sub is_auto_configurable_media { !detect_devices::isKeyUsb($_[0]) } sub set_removable_configurator { my ($class, $device) = @_; @@ -44,13 +45,13 @@ sub set_removable_configurator { } sub set_media_auto_configurator { - my ($class, $device) = @_; - return "/usr/sbin/drakupdate_fstab --no-flag --auto --add $device->{device}" if is_auto_configurable_media($class); + my ($device) = @_; + return "/usr/sbin/drakupdate_fstab --no-flag --auto --add $device->{device}" if is_auto_configurable_media($device); } sub set_media_remover { - my ($class, $device) = @_; - return "/usr/sbin/drakupdate_fstab --no-flag --del $device->{device}" if is_auto_configurable_media($class); + my ($device) = @_; + return "/usr/sbin/drakupdate_fstab --no-flag --del $device->{device}" if is_auto_configurable_media($device); } my $modules_conf = modules::any_conf->read; diff --git a/perl-install/standalone/service_harddrake b/perl-install/standalone/service_harddrake index 1df867999..d8346cb0f 100755 --- a/perl-install/standalone/service_harddrake +++ b/perl-install/standalone/service_harddrake @@ -140,12 +140,12 @@ foreach my $hw_class (@harddrake::data::tree) { next if $Ident eq 'MOUSE' && $curr_kernel ne $previous_kernel_config{KERNEL} && $cfg{"DETECT_$Ident"} ne 'force'; my @configurator_pool; - if (harddrake::data::is_auto_configurable_media($Ident)) { + if (harddrake::data::is_auto_configurable_class($Ident)) { foreach my $device (@ID{@added}) { - push @configurator_pool, harddrake::data::set_media_auto_configurator($Ident, $device); + push @configurator_pool, harddrake::data::set_media_auto_configurator($device); } foreach my $device (@$oldconfig{@was_removed}) { - push @configurator_pool, harddrake::data::set_media_remover($Ident, $device); + push @configurator_pool, harddrake::data::set_media_remover($device); } } else { @configurator_pool = $configurator; |