summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
authorTill Kamppeter <tkamppeter@mandriva.com>2006-01-20 16:47:31 +0000
committerTill Kamppeter <tkamppeter@mandriva.com>2006-01-20 16:47:31 +0000
commit87b9292ac3034a8d1c0142da390857d179830f0f (patch)
treee750dd3a54374157bf43fc733ae903770d4eaf1c /perl-install
parentca81a8740f059ac75fae08a8ac185db19270dffe (diff)
downloaddrakx-backup-do-not-use-87b9292ac3034a8d1c0142da390857d179830f0f.tar
drakx-backup-do-not-use-87b9292ac3034a8d1c0142da390857d179830f0f.tar.gz
drakx-backup-do-not-use-87b9292ac3034a8d1c0142da390857d179830f0f.tar.bz2
drakx-backup-do-not-use-87b9292ac3034a8d1c0142da390857d179830f0f.tar.xz
drakx-backup-do-not-use-87b9292ac3034a8d1c0142da390857d179830f0f.zip
- Moved loading of kernel modules before the port checking step, the
device file is usually generated when the module is loaded - Support for loading kernel modules only in case of a certain connection type (SCSI, USB, Parport). - Let kernel module only be added to /etc/modules and /etc/modprobe.preload if loading of the module with "modprobe" succeeded. - Do not die when loading of a kernel module does not succeed. - s/Hewlett Packard/Hewlett-Packard/ when generating ScannerDB.
Diffstat (limited to 'perl-install')
-rwxr-xr-xperl-install/scanner.pm4
-rwxr-xr-xperl-install/standalone/scannerdrake31
2 files changed, 28 insertions, 7 deletions
diff --git a/perl-install/scanner.pm b/perl-install/scanner.pm
index 8660aefd3..bdbcd2193 100755
--- a/perl-install/scanner.pm
+++ b/perl-install/scanner.pm
@@ -489,6 +489,9 @@ sub readScannerDB {
SERVER => sub { $card->{server} = $val },
DRIVER => sub { $card->{driver} = $val },
KERNEL => sub { push(@{$card->{kernel}}, $val) },
+ SCSIKERNEL => sub { push(@{$card->{scsikernel}}, $val) },
+ USBKERNEL => sub { push(@{$card->{usbkernel}}, $val) },
+ PARPORTKERNEL => sub { push(@{$card->{parportkernel}}, $val) },
UNSUPPORTED => sub { $card->{flags}{unsupported} = 1 },
MANUAL => sub { $card->{flags}{manual} = 1 },
MANUALREQUIRED => sub { $card->{flags}{manual} = 2 },
@@ -540,6 +543,7 @@ sub updateScannerDBfromSane {
"Fujitsu Computer Products of America" => "Fujitsu",
"HP" => sub { $_[0] =~ s/HP\s/Hewlett-Packard|/; $_[0] =~ s/HP4200/Hewlett-Packard|ScanJet 4200C/; $_[0] },
"Hewlett-Packard" => sub { $_[0] =~ s/HP 3200 C/Hewlett-Packard|ScanJet 3200C/ or $_[0] = "Hewlett-Packard|$_[0]"; $_[0] },
+ "Hewlett Packard" => "Hewlett-Packard",
"Kodak" => "Kodak Co.",
"Mustek" => "Mustek Systems Inc.",
"NEC" => "NEC Systems",
diff --git a/perl-install/standalone/scannerdrake b/perl-install/standalone/scannerdrake
index 2731505d0..895e9165c 100755
--- a/perl-install/standalone/scannerdrake
+++ b/perl-install/standalone/scannerdrake
@@ -304,6 +304,30 @@ sub tryConfScanner {
$in->ask_warn('Scannerdrake', N("The %s must be configured by printerdrake.\nYou can launch printerdrake from the %s Control Center in Hardware section.", removeverticalbar($model), $shortdistroname));
return 0;
}
+ my @modules = ();
+ if (defined($scanner::scannerDB->{$model}{kernel})) {
+ push(@modules, @{$scanner::scannerDB->{$model}{kernel}});
+ } elsif ((defined($scanner::scannerDB->{$model}{scsikernel})) &&
+ ($scanner::scannerDB->{$model}{driver} =~ /SCSI/i)) {
+ push(@modules, @{$scanner::scannerDB->{$model}{scsikernel}});
+ } elsif ((defined($scanner::scannerDB->{$model}{usbkernel})) &&
+ ($scanner::scannerDB->{$model}{driver} =~ /USB/i)) {
+ push(@modules, @{$scanner::scannerDB->{$model}{usbkernel}});
+ } elsif ((defined($scanner::scannerDB->{$model}{parportkernel})) &&
+ ($scanner::scannerDB->{$model}{driver} =~ /Parport/i)) {
+ push(@modules, @{$scanner::scannerDB->{$model}{parportkernel}});
+ }
+ if ($#modules >= 0) {
+ my $wait = $in->wait_message(N("Scannerdrake"),
+ N("Setting up kernel modules..."));
+ foreach my $m (@modules) {
+ eval { modules::load($m) };
+ if (!$@) {
+ modules::append_to_modules_loaded_at_startup_for_all_kernels
+ ($m);
+ }
+ }
+ }
if ($scanner::scannerDB->{$model}{ask} =~ /DEVICE/ || !$port) {
$port ||= N("Auto-detect available ports");
$in->ask_from('Scannerdrake',
@@ -377,13 +401,6 @@ sub tryConfScanner {
$firmware = installfirmware($model, $server);
return 0 if $firmware eq "///";
}
- if (defined($scanner::scannerDB->{$model}{kernel})) {
- my @modules = @{$scanner::scannerDB->{$model}{kernel}};
- my $wait = $in->wait_message(N("Scannerdrake"),
- N("Setting up kernel modules..."));
- modules::load(@modules);
- modules::append_to_modules_loaded_at_startup_for_all_kernels(@modules);
- }
scanner::confScanner($model, $port, $vendor, $product, $firmware);
if ($scanner::scannerDB->{$model}{flags}{manual} == 2) {
# MANUALREQUIRED in ScannerDB