From 530a16ec071db0e24e6e949e265a96848864967c Mon Sep 17 00:00:00 2001 From: Antoine Ginies Date: Wed, 19 Jan 2011 10:44:49 +0000 Subject: add mes5-2.6.33 branch --- rescue/drvinst | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100755 rescue/drvinst (limited to 'rescue/drvinst') diff --git a/rescue/drvinst b/rescue/drvinst new file mode 100755 index 000000000..cc7fb4fa2 --- /dev/null +++ b/rescue/drvinst @@ -0,0 +1,47 @@ +#!/usr/bin/perl +# +# Guillaume Cottenceau +# +# Copyright 2000-2005 Mandriva +# +# This software may be freely redistributed under the terms of the GNU +# public license. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# + +use lib qw(/usr/lib/libDrakX); +use common; +use detect_devices; + +$ARGV[0] =~ /^--?h/ and die "usage: drivers_install [drivertype1 [drivertype2 ...]]\n"; +my @types = @ARGV; + +sub install_module_raw { + my ($driver, $o_descr) = @_; + print STDERR "Installing driver $driver", $o_descr ? " (for \"$o_descr\")" : '', "\n"; + system("/sbin/modprobe", $driver) and print "\tfailed\n"; +} + +my $already_usb; +sub install_module { + my ($driver, $descr) = @_; + install_module_raw($driver, $descr); + if (!$already_usb && $driver =~ /usb/) { + $already_usb = 1; + install_module_raw('usbkbd'); + install_module_raw('keybdev'); + } +} + +#- start +foreach my $card (detect_devices::pci_probe()) { + $card->{driver} eq 'unknown' || $card->{driver} =~ /:/ and next; + $card->{media_type} eq "DISPLAY_VGA" and next; + + if (!@ARGV || find { $card->{media_type} =~ /$_/i } @types) { + install_module($card->{driver}, $card->{description}); + } +} -- cgit v1.2.1