summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tvignaud@mandriva.org>2003-02-25 14:22:28 +0000
committerThierry Vignaud <tvignaud@mandriva.org>2003-02-25 14:22:28 +0000
commitfed236f9939dfad4643a835ee93c95bcfc38f9e7 (patch)
tree10bc2186c7c3069f54e0554e97a6f4fde6ff4413
parent30e563c4e6b40b2a148b7ee444df21438b065e10 (diff)
downloaddrakx-backup-do-not-use-fed236f9939dfad4643a835ee93c95bcfc38f9e7.tar
drakx-backup-do-not-use-fed236f9939dfad4643a835ee93c95bcfc38f9e7.tar.gz
drakx-backup-do-not-use-fed236f9939dfad4643a835ee93c95bcfc38f9e7.tar.bz2
drakx-backup-do-not-use-fed236f9939dfad4643a835ee93c95bcfc38f9e7.tar.xz
drakx-backup-do-not-use-fed236f9939dfad4643a835ee93c95bcfc38f9e7.zip
handle floppes, zip drives, dvd-rom, cdrom and burners at startup time
-rw-r--r--perl-install/harddrake/data.pm10
-rwxr-xr-xperl-install/standalone/service_harddrake25
2 files changed, 18 insertions, 17 deletions
diff --git a/perl-install/harddrake/data.pm b/perl-install/harddrake/data.pm
index b3ff53efc..f29c59f24 100644
--- a/perl-install/harddrake/data.pm
+++ b/perl-install/harddrake/data.pm
@@ -31,12 +31,12 @@ sub set_removable_configurator {
our @tree =
(
- [ "FLOPPY", , N("Floppy"), "floppy.png", "", \&detect_devices::floppies, 0 ],
- [ "ZIP", , N("Zip"), "floppy.png", "", \&detect_devices::zips, 0 ],
+ [ "FLOPPY", , N("Floppy"), "floppy.png", "", \&detect_devices::floppies, 1 ],
+ [ "ZIP", , N("Zip"), "floppy.png", "", \&detect_devices::zips, 1 ],
[ "HARDDISK", , N("Disk"), "harddisk.png", "$sbindir/diskdrake", \&detect_devices::hds, 1 ],
- [ "CDROM", , N("CDROM"), "cd.png", "", sub { grep { !(detect_devices::isBurner($_) || detect_devices::isDvdDrive($_)) } &detect_devices::cdroms }, 0 ],
- [ "BURNER", , N("CD/DVD burners"), "cd.png", "", \&detect_devices::burners, 0 ],
- [ "DVDROM", , N("DVD-ROM"), "cd.png", "", sub { grep { ! detect_devices::isBurner($_) } detect_devices::dvdroms() }, 0 ],
+ [ "CDROM", , N("CDROM"), "cd.png", "", sub { grep { !(detect_devices::isBurner($_) || detect_devices::isDvdDrive($_)) } &detect_devices::cdroms }, 1 ],
+ [ "BURNER", , N("CD/DVD burners"), "cd.png", "", \&detect_devices::burners, 1 ],
+ [ "DVDROM", , N("DVD-ROM"), "cd.png", "", sub { grep { ! detect_devices::isBurner($_) } detect_devices::dvdroms() }, 1 ],
[ "TAPE", , N("Tape"), "tape.png", "", \&detect_devices::tapes, 0 ],
[ "VIDEO", , N("Videocard"), "video.png", "$sbindir/XFdrake", sub { grep { $_->{driver} =~ /^(Card|Server):/ || $_->{media_type} =~ /DISPLAY_VGA/ } @devices }, 1 ],
[ "TV", , N("Tvcard"), "tv.png", "/usr/bin/XawTV", sub { grep { $_->{media_type} =~ /MULTIMEDIA_VIDEO/ && $_->{bus} eq 'PCI' || $_->{driver} eq 'usbvision' } @devices }, 0 ],
diff --git a/perl-install/standalone/service_harddrake b/perl-install/standalone/service_harddrake
index d6afe8041..d213a8e96 100755
--- a/perl-install/standalone/service_harddrake
+++ b/perl-install/standalone/service_harddrake
@@ -33,9 +33,9 @@ foreach (@harddrake::data::tree) {
ref($detector) eq 'CODE' or next;
my %ID = map {
- my $i = $_;
- my $id = defined $i->{device} ? $i->{device} : join(':', map { $i->{$_} } qw(vendor id subvendor subid));
- $id => $i;
+ my $i = $_;
+ my $id = defined $i->{device} ? $i->{device} : join(':', map { $i->{$_} } qw(vendor id subvendor subid));
+ $id => $i;
} &$detector;
$config{$Ident} = \%ID;
next if is_empty_hash_ref $previous_config; # don't fsck on first run
@@ -45,32 +45,33 @@ foreach (@harddrake::data::tree) {
my $msg;
my @was_removed = difference2([ keys %$oldconfig ], [ keys %ID ]);
if (@was_removed) {
- $msg .= N("Some devices in the \"%s\" hardware class were removed:\n", $item) .
- "- " . harddrake::data::custom_id($oldconfig->{$_}, $item) . " was removed\n" foreach @was_removed . "\n";
+ $msg .= N("Some devices in the \"%s\" hardware class were removed:\n", $item) .
+ "- " . harddrake::data::custom_id($oldconfig->{$_}, $item) . " was removed\n" foreach @was_removed . "\n";
}
my @added = difference2([ keys %ID ], [ keys %$oldconfig ]);
$msg .= N("Some devices were added:\n", $item) if @added;
$msg .= "- " . harddrake::data::custom_id($ID{$_}, $item) . " was added\n" foreach @added;
@added || @was_removed or next;
+ harddrake::data::set_removable_configurator($Ident, first(values %$oldconfig, values %ID), \$configurator);
next unless -x $configurator;
my ($pid, $no);
$SIG{ALRM} = sub { $no = 1; kill 15, $pid };
unless ($pid = fork()) {
- exec("/usr/share/harddrake/confirm 'Hardware changes in $Ident class ($timeout seconds to answer)' '" . $msg . "Do you want to run the appropriate config tool ?'");
+ exec("/usr/share/harddrake/confirm 'Hardware changes in $Ident class ($timeout seconds to answer)' '" . $msg . "Do you want to run the appropriate config tool ?'");
}
alarm($timeout);
wait();
my $res = $?;
alarm(0);
if ($no) {
- require interactive;
- undef $wait;
+ require interactive;
+ undef $wait;
$in ||= interactive->vnew;
- $wait = $in->wait_message(N("Please wait"), N("Hardware probing in progress"));
+ $wait = $in->wait_message(N("Please wait"), N("Hardware probing in progress"));
} elsif ($res) {
- if (fork()) {
- wait();
- } else { exec("$configurator 2>/dev/null") or die "$configurator missing\n" }
+ if (fork()) {
+ wait();
+ } else { exec("$configurator 2>/dev/null") or die "$configurator missing\n" }
}
}