$kinds2all_modules = { 'usb' => [ 'usb-uhci', 'usb-ohci', 'ehci-hcd' ], 'network' => [ '3c501', '3c503', '3c505', '3c507', '3c509', '3c515', '82596', 'abyss', 'ac3200', 'acenic', 'aironet4500_card', 'at1700', 'atp', 'com20020-pci', 'cs89x0', 'de600', 'de620', 'r8169', 'defxx', 'orinoco_plx', 'depca', 'dmfe', 'e100', 'e1000', 'e2100', 'eepro', 'eepro100', 'eexpress', 'epic100', 'eth16i', 'ewrk3', 'hamachi', 'hp', 'hp-plus', 'hp100', 'ibmtr', 'lance', 'natsemi', 'ne', 'ne2k-pci', 'ni5010', 'ni52', 'ni65', 'nvnet', 'olympic', 'pcnet32', 'plip', 'rcpci', 'sb1000', 'sis900', 'sk98lin', 'smc-ultra', 'smc9194', 'starfire', 'tlan', 'tmspci', 'tulip', 'via-rhine', 'tg3', 'bcm5700', 'bcm5820', 'bcm4400', 'crc32', 'wd', 'winbond-840', 'yellowfin', 'ns83820', 'iph5526', '3c59x', '8139too', 'sundance', 'dl2k', 'pegasus', 'kaweth', 'usbnet', 'catc', 'CDCEther' ], 'scsi' => [ '3w-xxxx', 'AM53C974', 'NCR53c406a', 'a100u2w', 'advansys', 'aha1740', 'atp870u', 'dc395x_trm', 'dtc', 'fdomain', 'g_NCR5380', 'in2000', 'initio', 'pas16', 'pci2220i', 'psi240i', 'qla1280', 'qla2x00', 'qlogicfas', 'qlogicfc', 'seagate', 'sym53c416', 'u14-34f', 'ultrastor', 'eata', 'eata_pio', 'eata_dma', '53c7,8xx', 'aic7xxx', 'pci2000', 'qlogicisp', 'sym53c8xx', 'mptscsih', 'mptbase', 'DAC960', 'dpt_i2o', 'megaraid', 'aacraid', 'ataraid', 'cciss', 'cpqarray', 'gdth', 'i2o_block', 'qla2200', 'qla2300', 'cpqfc', 'ips', 'ppa', 'imm' ] }; my @l = map { /^(\S+)\s*:/ ? $1 : () } `lspcidrake`; my %kinds2modules = map { $_ => [ intersection(\@l, $kinds2all_modules->{$_}) ]; } keys %$kinds2all_modules; if (my @scsi = @{$kinds2modules{scsi}}) { print "probeall scsi_hostadapter ", join(" ", @scsi), "\n"; } if (my @usb = @{$kinds2modules{usb}}) { print "probeall usb-interface ", join(" ", @usb), "\n"; } my $eth = 0; foreach (@{$kinds2modules{network}}) { print "alias eth$eth $_\n"; $eth++; } sub intersection { my (%l, @m); @l{@{shift @_}} = (); foreach (@_) { @m = grep { exists $l{$_} } @$_; %l = (); @l{@m} = () } keys %l }