summaryrefslogtreecommitdiffstats
path: root/rescue/tree/sbin/modprobe
blob: 704ee6b0f2abc9426804958f3f84e973a6139a60 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/usr/bin/perl

use lib qw(/usr/lib/libDrakX);
use list_modules;
use modules;

# based on install::commands
sub modprobe {
    !@_ || $_[0] =~ /^-?-h/ and die "usage: modprobe <module> [<options...>]\n";
    my $name;
    # kernel calls us with modprobe -q -- <module>, so ignore options
    do { $name = shift } while substr($name, 0, 1) eq "-";
    list_modules::load_default_moddeps();
    modules::load_with_options([ $name ], { $name => join(' ', @_) });
}

$::isInstall = 1;
modprobe(@ARGV);