diff options
Diffstat (limited to 'perl-install/harddrake/data.pm')
| -rw-r--r-- | perl-install/harddrake/data.pm | 114 |
1 files changed, 83 insertions, 31 deletions
diff --git a/perl-install/harddrake/data.pm b/perl-install/harddrake/data.pm index ca1b30b40..f183f0d1e 100644 --- a/perl-install/harddrake/data.pm +++ b/perl-install/harddrake/data.pm @@ -10,9 +10,12 @@ our ($version, $sbindir, $bindir) = ("10", "/usr/sbin", "/usr/bin"); my @devices = detect_devices::probeall(); + +# 10.2: REMOVE ALL BLACKLISTING FROM unknown() since f() has already filter out matched devices + # Update me each time you handle one more devices class (aka configurator) sub unknown() { - grep { $_->{media_type} !~ /BRIDGE|class\|Mouse|DISPLAY|Hub|MEMORY_RAM|MULTIMEDIA_(VIDEO|AUDIO|OTHER)|NETWORK|Printer|SERIAL_(USB|SMBUS)|STORAGE_(IDE|OTHER|SCSI)|tape/ + grep { $_->{media_type} !~ /BRIDGE|class\|Mouse|DISPLAY|Hub|MEMORY_RAM|MULTIMEDIA_(VIDEO|AUDIO|OTHER)|NETWORK|Printer|SERIAL_(USB|SMBUS)|STORAGE_(IDE|OTHER|SCSI)|SYSTEM_OTHER|tape|UPS/ && !member($_->{driver}, qw(cpia_usb cyber2000fb forcedeth ibmcam megaraid mod_quickcam nvnet ohci1394 ov511 ov518_decomp scanner ultracam usbvideo usbvision)) && $_->{driver} !~ /^ISDN|Mouse:USB|Removable:zip|class\|Mouse|sata|www.linmodems.org/ && $_->{type} ne 'network' @@ -38,6 +41,11 @@ sub is_removable { $_[0] =~ /FLOPPY|ZIP|DVDROM|CDROM|BURNER/ } sub set_removable_configurator { my ($class, $device) = @_; + return "/usr/sbin/diskdrake --removable=$device->{device}" if is_removable($class); + } + +sub set_removable_auto_configurator { + my ($class, $device) = @_; return "/usr/sbin/drakupdate_fstab --no-flag --auto --add $device->{device}" if is_removable($class); } @@ -46,6 +54,7 @@ sub set_removable_remover { return "/usr/sbin/drakupdate_fstab --no-flag --del $device->{device}" if is_removable($class); } +my $modules_conf = modules::any_conf->read; # Format is (HW class ID, l18n class name, icon, config tool , is_to_be_detected_on_boot) our @tree = @@ -76,7 +85,7 @@ our @tree = icon => "harddisk.png", configurator => "$sbindir/diskdrake", detector => sub { f(detect_devices::hds()) }, - checked_on_boot => 1, + checked_on_boot => 0, }, { @@ -134,7 +143,7 @@ our @tree = icon => "tv.png", configurator => "/usr/bin/XawTV", detector => sub { f(grep { $_->{media_type} =~ /MULTIMEDIA_VIDEO/ && $_->{bus} eq 'PCI' || $_->{driver} eq 'usbvision' } @devices) }, - checked_on_boot => 0, + checked_on_boot => 1, }, { @@ -166,6 +175,7 @@ our @tree = || member($_->{driver}, qw(cpia_usb cyber2000fb ibmcam mod_quickcam ov511 ov518_decomp pwc ultracam usbvideo)) } @devices) }, + # managed by hotplug: checked_on_boot => 0, }, @@ -175,6 +185,7 @@ our @tree = icon => "cpu.png", configurator => "", detector => sub { detect_devices::getCPUs() }, + # maybe should we install schedutils? checked_on_boot => 0, }, @@ -183,7 +194,8 @@ our @tree = string => N("ISDN adapters"), icon => "modem.png", configurator => "$sbindir/drakconnect", - detector => sub { require network::isdn; my $isdn = network::isdn::detect_backend(); if_(@$isdn, f(@$isdn)) }, + detector => sub { require network::isdn; my $isdn = network::isdn::detect_backend($modules_conf); if_(@$isdn, f(@$isdn)) }, + # we do not check these b/c this need user interaction (auth, ...): checked_on_boot => 0, }, @@ -193,12 +205,14 @@ our @tree = icon => "hw_network.png", configurator => "$sbindir/drakconnect", detector => sub { - #- generic NIC detection for USB seems broken (class, subclass, - #- protocol reported are not accurate) so we match network adapters against - #- known drivers :-( require list_modules; - my @net_modules = list_modules::category2modules('network/gigabit|main|pcmcia|usb|wireless'); - f(grep { member($_->{driver}, @net_modules) } @devices); + require network::ethernet; + my @net_modules = list_modules::category2modules(network::ethernet::get_eth_categories()); + f(grep { + $_->{media_type} && $_->{media_type} =~ /^NETWORK/ + || $_->{type} && $_->{type} eq 'network' + || member($_->{driver}, @net_modules); + } @devices); }, checked_on_boot => 1, }, @@ -208,7 +222,8 @@ our @tree = string => N("Modem"), icon => "modem.png", configurator => "$sbindir/drakconnect", - detector => sub { detect_devices::getModem() }, + detector => sub { detect_devices::getModem($modules_conf) }, + # we do not check these b/c this need user interaction (auth, ...): checked_on_boot => 0, }, @@ -222,6 +237,7 @@ our @tree = my $a = network::adsl::adsl_detect(); $a ? f(grep { $_ } values %$a) : (); }, + # we do not check these b/c this need user interaction (auth, ...): checked_on_boot => 0, }, @@ -231,7 +247,7 @@ our @tree = icon => "memory.png", configurator => "", detector => sub { f(modules::probe_category('various/agpgart')) }, - checked_on_boot => 0, + checked_on_boot => 1, }, { @@ -239,7 +255,7 @@ our @tree = string => N("Bridges and system controllers"), icon => "memory.png", configurator => "", - detector => sub { f(grep { $_->{media_type} =~ /BRIDGE|MEMORY_RAM/ } @devices) }, + detector => sub { f(grep { $_->{media_type} =~ /BRIDGE|MEMORY_RAM|SYSTEM_OTHER/ } @devices) }, checked_on_boot => 0, }, @@ -249,24 +265,11 @@ our @tree = icon => "hw_printer.png", configurator => "$sbindir/printerdrake", detector => sub { require printer::detect; printer::detect::local_detect() }, + # we do not check these b/c this need user interaction (auth, ...): checked_on_boot => 0, }, { - class => "MOUSE", - string => N("Mouse"), - icon => "hw_mouse.png", - configurator => "$sbindir/mousedrake", - detector => sub { - require mouse; - require modules; - modules::mergein_conf(); - &mouse::detect(); - }, - checked_on_boot => 1, - }, - - { class => "JOYSTICK", string => N("Joystick"), icon => "joystick.png", @@ -282,7 +285,7 @@ our @tree = icon => "ide_hd.png", configurator => "", detector => sub { f(grep { $_->{media_type} =~ /STORAGE_(IDE|OTHER)/ || $_->{driver} eq '3w-xxxx' } @devices) }, - checked_on_boot => 0, + checked_on_boot => 1, }, { @@ -291,7 +294,7 @@ our @tree = icon => "ide_hd.png", configurator => "", detector => sub { f(grep { $_->{driver} =~ /^sata/ } @devices) }, - checked_on_boot => 0, + checked_on_boot => 1, }, { @@ -304,12 +307,25 @@ our @tree = }, { + class => "PCMCIA_CONTROLLER", + string => N("PCMCIA controllers"), + icon => "scsi.png", + configurator => "", + detector => sub { + require list_modules; + my @modules = list_modules::category2modules('bus/pcmcia'); + f(grep { member($_->{driver}, @modules) } @devices); + }, + checked_on_boot => 1, + }, + + { class => "SCSI_CONTROLLER", string => N("SCSI controllers"), icon => "scsi.png", configurator => "", detector => sub { f(grep { $_->{media_type} =~ /STORAGE_SCSI/ || $_->{driver} eq 'megaraid' } @devices) }, - checked_on_boot => 0, + checked_on_boot => 1, }, { @@ -318,7 +334,7 @@ our @tree = icon => "usb.png", configurator => "", detector => sub { f(grep { $_->{media_type} eq 'SERIAL_USB' } @devices) }, - checked_on_boot => 0, + checked_on_boot => 1, }, { @@ -340,6 +356,42 @@ our @tree = }, { + class => "UPS", + string => N("UPS"), + icon => "ups.png", + configurator => "$sbindir/drakups", + detector => sub { f(detect_devices::getUPS()) }, + checked_on_boot => 0, + }, + + { + class => "KEYBOARD", + string => N("Keyboard"), + icon => "usb.png", + configurator => "$sbindir/keyboardrake", + detector => sub { + f(grep { $_->{description} =~ /Keyboard/i } @devices), + # USB devices are filtered out since we already catch them through probeall(): + grep { $_->{bus} ne 'usb' && $_->{driver} eq 'kbd' } detect_devices::getInputDevices(); + }, + checked_on_boot => 0, + }, + + { + class => "MOUSE", + string => N("Mouse"), + icon => "hw_mouse.png", + configurator => "$sbindir/mousedrake", + detector => sub { + f(grep { $_->{driver} =~ /^Mouse:|^Tablet:/ } @devices), + # USB devices are filtered out since we already catch them through probeall(): + grep { $_->{bus} ne 'usb' && $_->{driver} =~ /mouse/ } detect_devices::getInputDevices(); + }, + checked_on_boot => 1, + automatic => 1, + }, + + { class => "SCANNER", string => N("Scanner"), icon => "scanner.png", @@ -348,7 +400,7 @@ our @tree = require scanner; f(scanner::detect()) }, checked_on_boot => 0, }, - + { class => "UNKNOWN", string => N("Unknown/Others"), |
