summaryrefslogtreecommitdiffstats
path: root/kernel/gen_modules_conf.pl.pl
diff options
context:
space:
mode:
authorMystery Man <unknown@mandriva.org>2003-08-20 07:37:27 +0000
committerMystery Man <unknown@mandriva.org>2003-08-20 07:37:27 +0000
commit7f2ac73888b8ef372ea597049981b27e7d810ac2 (patch)
tree354132889b63bbe5f446cb82869b3c3367135a80 /kernel/gen_modules_conf.pl.pl
parent327bd24f8e4291bd1882de1990dd7339f781a9cb (diff)
downloaddrakx-7f2ac73888b8ef372ea597049981b27e7d810ac2.tar
drakx-7f2ac73888b8ef372ea597049981b27e7d810ac2.tar.gz
drakx-7f2ac73888b8ef372ea597049981b27e7d810ac2.tar.bz2
drakx-7f2ac73888b8ef372ea597049981b27e7d810ac2.tar.xz
drakx-7f2ac73888b8ef372ea597049981b27e7d810ac2.zip
This commit was manufactured by cvs2svn to create branch 'MDKC_1_0'.topic/MDKC_1_0
Diffstat (limited to 'kernel/gen_modules_conf.pl.pl')
-rwxr-xr-xkernel/gen_modules_conf.pl.pl40
1 files changed, 40 insertions, 0 deletions
diff --git a/kernel/gen_modules_conf.pl.pl b/kernel/gen_modules_conf.pl.pl
new file mode 100755
index 000000000..e842eafa0
--- /dev/null
+++ b/kernel/gen_modules_conf.pl.pl
@@ -0,0 +1,40 @@
+#!/usr/bin/perl
+
+use list_modules;
+
+my %kinds = (
+ scsi => 'disk/scsi|hardware_raid',
+ network => 'network/main|usb',
+);
+
+my %kinds2all_modules = map {
+ $_ => [ list_modules::category2modules($kinds{$_}) ];
+} keys %kinds;
+
+$kinds2all_modules{usb} = [ qw(usb-uhci usb-ohci ehci-hcd) ];
+
+use Data::Dumper;
+print Data::Dumper->Dump([\%kinds2all_modules], ['$kinds2all_modules']);
+
+print <<'EOF';
+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 }
+EOF
+