diff options
Diffstat (limited to 'perl-install/harddrake/data.pm')
| -rw-r--r-- | perl-install/harddrake/data.pm | 79 | 
1 files changed, 42 insertions, 37 deletions
| diff --git a/perl-install/harddrake/data.pm b/perl-install/harddrake/data.pm index 537cb177d..8d4d4de21 100644 --- a/perl-install/harddrake/data.pm +++ b/perl-install/harddrake/data.pm @@ -11,11 +11,20 @@ our ($version, $sbindir, $bindir) = ("10", "/usr/sbin", "/usr/bin");  my @devices = (detect_devices::probeall(), detect_devices::getSCSI()); +foreach my $dev (@devices) { +    # normalize device IDs for devices that came from mouse.pm: +    next if !defined $dev->{Synaptics}; +    foreach my $field (qw(vendor id subvendor subid)) { +        next if !defined $dev->{$field}; +        $dev->{$field} = hex($dev->{$field}); +    } +} +  # 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|RAID|SCSI)|SYSTEM_OTHER|tape|UPS/ +    grep { $_->{media_type} !~ /BRIDGE|class\|Mouse|DISPLAY|Hub|MEMORY_RAM|MULTIMEDIA_(VIDEO|AUDIO|OTHER)|NETWORK|Printer|SERIAL_(USB|SMBUS)|STORAGE_(IDE|OTHER|RAID|SCSI)|SYSTEM_(OTHER|SDHCI)|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/ +	       && $_->{driver} !~ /^ISDN|Mouse:USB|Removable:zip|class\|Mouse|sata|www.linmodems.org|kbd|mouse|sysrq|usbhid/  	       && $_->{type} ne 'network'  	       && $_->{description} !~ /Alcatel|ADSL Modem/;  	   } @devices; @@ -36,7 +45,6 @@ sub f {  # FIXME: add translated items  sub is_removable { member($_[0], qw(FLOPPY ZIP DVDROM CDROM BURNER)) } -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 { @@ -44,16 +52,6 @@ sub set_removable_configurator {      is_removable($class) ? "/usr/sbin/diskdrake --removable=$device->{device}" : undef;   } -sub set_media_auto_configurator { -    my ($device) = @_; -    is_auto_configurable_media($device) ? "/usr/sbin/drakupdate_fstab --auto --add $device->{device}" : (); -} - -sub set_media_remover { -    my ($device) = @_; -    is_auto_configurable_media($device) ? "/usr/sbin/drakupdate_fstab --del $device->{device}" : (); -} -  my $modules_conf = modules::any_conf->read;  # Format is (HW class ID, l18n class name, icon, config tool , is_to_be_detected_on_boot) @@ -64,7 +62,8 @@ our @tree =        string => N("SATA controllers"),        icon => "ide_hd.png",        configurator => "", -      detector => sub { f(detect_devices::probe_category('disk/sata')) }, +      detector => sub { f(grep { $_->{driver} !~ /^pata/ } detect_devices::probe_category('disk/sata')), +                          f(grep { $_->{description} =~ /AHCI/ } @devices) },        checked_on_boot => 1,       }, @@ -84,7 +83,8 @@ our @tree =        icon => "ide_hd.png",        configurator => "",        detector => sub { f(detect_devices::probe_category('disk/ide')), -                          f(grep { $_->{media_type} =~ /STORAGE_(IDE|OTHER)/ } @devices) }, +                          f(grep { $_->{driver} =~ /^pata/ && $_->{media_type} =~ /IDE|STORAGE_SATA/ } @devices), +                              f(grep { $_->{media_type} =~ /STORAGE_(IDE|OTHER)/ } @devices) },        checked_on_boot => 1,       }, @@ -102,7 +102,7 @@ our @tree =        string => N("Firewire controllers"),        icon => "usb.png",        configurator => "", -      detector => sub { f(grep { $_->{driver} =~ /ohci1394/ } @devices) }, +      detector => sub { f(grep { $_->{driver} =~ /firewire_ohci|ohci1394/ } @devices) },        checked_on_boot => 1,       }, @@ -156,7 +156,7 @@ our @tree =        string => N("Bridges and system controllers"),        icon => "memory.png",        configurator => "", -      detector => sub { f(grep { $_->{media_type} =~ /BRIDGE|MEMORY_RAM|SYSTEM_OTHER|MEMORY_OTHER|SYSTEM_PIC/ +      detector => sub { f(grep { $_->{media_type} =~ /BRIDGE|MEMORY_RAM|SYSTEM_(OTHER|SDHCI)|MEMORY_OTHER|SYSTEM_PIC|COMMUNICATION_OTHER/                                   || $_->{description} =~ /Parallel Port Adapter/;  			 } @devices) },        checked_on_boot => 0, @@ -195,7 +195,7 @@ our @tree =        icon => "harddisk.png",        configurator => "$sbindir/diskdrake",        detector => sub { f(detect_devices::hds()) }, -      checked_on_boot => 1, +      checked_on_boot => 0,        automatic => 1,       }, @@ -204,7 +204,7 @@ our @tree =        string => N("USB Mass Storage Devices"),        icon => "usb.png",        configurator => "", -      detector => sub { f(grep { member($_->{driver}, qw(usb_storage ub)) } @devices) }, +      detector => sub { f(grep { member($_->{driver}, qw(usb_storage ub Removable:memory_card)) } @devices) },        checked_on_boot => 0,       }, @@ -302,7 +302,8 @@ our @tree =        detector => sub {             require list_modules;            my @modules = list_modules::category2modules('multimedia/sound'); -          f(grep { $_->{media_type} =~ /MULTIMEDIA_AUDIO/  || member($_->{driver}, @modules) } @devices); +          f(grep { $_->{media_type} =~ /MULTIMEDIA_AUDIO|PROCESSOR_CO/ || member($_->{driver}, @modules) +                || $_->{description} =~ /^\|?HDA |PC Speaker/ } @devices);        },        checked_on_boot => 1,       }, @@ -315,7 +316,8 @@ our @tree =        detector => sub {             require list_modules;            my @modules = (list_modules::category2modules('multimedia/webcam'), 'Removable:camera'); -          f(grep { $_->{media_type} =~ /MULTIMEDIA_VIDEO|Video\|Video Control/ && $_->{bus} ne 'PCI' || member($_->{driver}, @modules) } @devices); +          f(grep { $_->{media_type} =~ /MULTIMEDIA_VIDEO|Video\|Video Control|Imaging|Camera/ && $_->{bus} ne 'PCI' +                     || member($_->{driver}, @modules) || $_->{driver} =~ /^gpsca/ } @devices);        },        # managed by hotplug:        checked_on_boot => 0, @@ -383,7 +385,7 @@ our @tree =        string => N("Bluetooth devices"),        icon => "hw_network.png",        configurator => "", -      detector => sub { f(detect_devices::probe_category('bus/bluetooth')) }, +      detector => sub { f(detect_devices::probe_category('bus/bluetooth')), f(grep { $_->{description} =~ /Bluetooth Dongle/ } @devices) },        checked_on_boot => 1,       }, @@ -398,7 +400,8 @@ our @tree =            f(grep {                $_->{media_type} && $_->{media_type} =~ /^NETWORK/                  || $_->{type} && $_->{type} eq 'network' -                  ||  member($_->{driver}, @net_modules); +                  || member($_->{driver}, @net_modules) +                    || $_->{description} =~ /WLAN/;            } @devices);        },        checked_on_boot => 1, @@ -409,7 +412,7 @@ our @tree =        string => N("Modem"),        icon => "modem.png",        configurator => "$sbindir/drakconnect", -      detector => sub { f(detect_devices::getModem($modules_conf)) }, +      detector => sub { f(detect_devices::getModem($modules_conf)), f(grep { $_->{description} =~ /SoftModem/ } @devices) },        # we do not check these b/c this need user interaction (auth, ...):        checked_on_boot => 0,       }, @@ -431,7 +434,7 @@ our @tree =        string => N("Memory"),        icon => "hw-memory.png",        configurator => "", -      detector => sub { grep { member($_->{name}, 'Cache', 'Memory Module') } detect_devices::dmidecode() }, +      detector => sub { grep { member($_->{name}, 'Cache', 'Memory Module') || $_->{name} eq 'Memory Device' && $_->{Size} ne 'No Module Installed'  } detect_devices::dmidecode() },        checked_on_boot => 0,       }, @@ -440,7 +443,7 @@ our @tree =        string => N("Printer"),        icon => "hw_printer.png",        configurator => "$sbindir/printerdrake", -      detector => sub { require printer::detect; printer::detect::local_detect() }, +      detector => sub {},        # we do not check these b/c this need user interaction (auth, ...):        checked_on_boot => 0,       }, @@ -474,9 +477,10 @@ our @tree =        icon => "hw-keyboard.png",        configurator => "$sbindir/keyboarddrake",        detector => sub { -          f(grep { $_->{description} =~ /Keyboard/i || $_->{media_type} =~ /Subclass\|Keyboard/i } @devices), -            # USB devices are filtered out since we already catch them through probeall(): -          grep { $_->{bus} ne 'usb' && $_->{driver} eq 'kbd' && $_->{description} !~ /PC Speaker/ } detect_devices::getInputDevices(); +          f(grep { $_->{description} =~ /Keyboard/i || $_->{media_type} =~ /Keyboard/i || +                     # USB devices are filtered out since we already catch them through probeall(): +                     $_->{bus} ne 'usb' && $_->{driver} =~ /^event|kbd|^usbhid/ && $_->{description} !~ /PC Speaker/; +                 } @devices);        },        checked_on_boot => 0,       }, @@ -496,9 +500,10 @@ our @tree =        icon => "hw_mouse.png",        configurator => "$sbindir/mousedrake",        detector => sub { -          f(grep { $_->{driver} =~ /^Mouse:|^Tablet:/ || $_->{media_type} =~ /class\|Mouse/ } @devices), -            # USB devices are filtered out since we already catch them through probeall(): -            grep { $_->{bus} ne 'usb' && $_->{Handlers}{mouse} } detect_devices::getInputDevices(); +          f(grep { $_->{driver} =~ /^Mouse:|^Tablet:|^mouse/ || $_->{media_type} =~ /class\|Mouse/ || +                     # USB devices are filtered out since we already catch them through probeall(): +                     $_->{bus} ne 'usb' && $_->{Handlers}{mouse}; +                 } @devices);        },        checked_on_boot => 1,        automatic => 1, @@ -527,7 +532,7 @@ our @tree =        icon => "scanner.png",        configurator => "$sbindir/scannerdrake",        detector => sub {  -         require scanner; f(map { $_->{drakx_device} } f(scanner::detect())); +         require scanner; f(map { $_->{val}{drakx_device} } f(scanner::detect()));        },        checked_on_boot => 0,       }, @@ -553,7 +558,9 @@ sub pciusb_id {                 pci_device => 'usb_pci_device',                 vendor => 'usb_vendor',                 ); -    join(':', map { $dev->{$alt{$_}} || $dev->{$_} } qw(bus pci_bus pci_device vendor id subvendor subid description)); +    my @fields = ('bus', if_($dev->{bus} =~ /pci/, qw(pci_bus pci_device)), qw(vendor id subvendor subid), +                  if_($dev->{bus} !~ /usb/i, 'description')); +    join(':', map { uc($dev->{$alt{$_}} || $dev->{$_}) } @fields);  } @@ -565,9 +572,7 @@ sub custom_id {           N("cpu # ") . $device->{processor} . ": " . $device->{'model name'} :           $device->{"Socket Designation"} ?           "$device->{name} (" . $device->{"Socket Designation"} . ")" : -         $device->{name} ? $device->{name} : -           (defined($device->{description}) ? $device->{description} : -              (defined($device->{Vendor}) ? $device->{Vendor} : $str))); +         $device->{name} || $device->{description} || $device->{Vendor} || $str);  }  1; | 
