summaryrefslogtreecommitdiffstats
path: root/rescue/bin/drvinst
diff options
context:
space:
mode:
authorFrancesc Pinyol Margalef <francesc.pinyol.m@gmail.com>2013-12-21 13:37:33 +0100
committerFrancesc Pinyol Margalef <francesc.pinyol.m@gmail.com>2013-12-21 13:37:33 +0100
commit095c6b25885ce3d22eedba8cdb98f1fd7e8708a5 (patch)
tree5bfc768996b3ddec185abeb02b602b48b14d10db /rescue/bin/drvinst
parentdf60191bdbddfa7c8e5bd11a2578aae6740963c0 (diff)
parentf76dc0931e47338aa9c7db257d28e5015d8a2f47 (diff)
downloaddrakx-095c6b25885ce3d22eedba8cdb98f1fd7e8708a5.tar
drakx-095c6b25885ce3d22eedba8cdb98f1fd7e8708a5.tar.gz
drakx-095c6b25885ce3d22eedba8cdb98f1fd7e8708a5.tar.bz2
drakx-095c6b25885ce3d22eedba8cdb98f1fd7e8708a5.tar.xz
drakx-095c6b25885ce3d22eedba8cdb98f1fd7e8708a5.zip
Merge branch 'master' of git://git.mageia.org/software/drakx
Diffstat (limited to 'rescue/bin/drvinst')
-rwxr-xr-xrescue/bin/drvinst38
1 files changed, 38 insertions, 0 deletions
diff --git a/rescue/bin/drvinst b/rescue/bin/drvinst
new file mode 100755
index 000000000..4868b42e0
--- /dev/null
+++ b/rescue/bin/drvinst
@@ -0,0 +1,38 @@
+#!/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 {
+ my ($driver, $descr) = @_;
+ print STDERR qq(Installing driver $driver (for "$descr")\n);
+ system("/sbin/modprobe", $driver) and print "\tfailed\n";
+}
+
+#- start
+foreach my $card (detect_devices::pci_probe()) {
+ # ignoring "unknown", "Card:foobar" and the like as well as video cards:
+ $card->{driver} eq 'unknown' || $card->{driver} =~ /:/ and next;
+ $card->{media_type} eq "DISPLAY_VGA" and next;
+
+ # load drivers for selected categories or for everything if no args:
+ if (!@ARGV || find { $card->{media_type} =~ /$_/i } @types) {
+ install_module($card->{driver}, $card->{description});
+ }
+}