summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile4
-rw-r--r--dkms-modules-info/Makefile10
-rwxr-xr-xdkms-modules-info/merge_dkms_info.pl29
3 files changed, 42 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index e8bfa132..78eaa1b6 100644
--- a/Makefile
+++ b/Makefile
@@ -12,6 +12,7 @@ FILES = AUTHORS ChangeLog Makefile Makefile.config convert lst update-ldetect-ls
build:
make -C lst build
+ make -C dkms-modules-info build
check:
make -C lst check
@@ -23,6 +24,7 @@ clean:
install: build
install -d $(bindir) $(sbindir) $(dir)
make -C lst install
+ make -C dkms-modules-info install
install update-ldetect-lst $(sbindir)
install convert/merge2pcitable.pl $(bindir)
@@ -32,7 +34,7 @@ cleandist:
rm -rf $(PACKAGE)-$(VERSION) $(PACKAGE)-$(VERSION).tar.bz2
localcopy:
- svn export -q -rBASE . $(PACKAGE)-$(VERSION)
+ svn export -q . $(PACKAGE)-$(VERSION)
tar:
tar cvf $(PACKAGE)-$(VERSION).tar $(PACKAGE)-$(VERSION)
diff --git a/dkms-modules-info/Makefile b/dkms-modules-info/Makefile
new file mode 100644
index 00000000..b15eaa1e
--- /dev/null
+++ b/dkms-modules-info/Makefile
@@ -0,0 +1,10 @@
+include ../Makefile.config
+
+FILES=dkms-modules.alias dkms-modules.description
+
+build:
+ ./merge_dkms_info.pl
+
+install: $(FILES)
+ mkdir -p $(dir)
+ install -m 644 $(FILES) $(dir)
diff --git a/dkms-modules-info/merge_dkms_info.pl b/dkms-modules-info/merge_dkms_info.pl
new file mode 100755
index 00000000..efd10069
--- /dev/null
+++ b/dkms-modules-info/merge_dkms_info.pl
@@ -0,0 +1,29 @@
+#!/usr/bin/perl
+
+use MDK::Common;
+
+my $prefix = "dkms-modules";
+
+my %fields;
+my %filters = (
+ alias => sub {
+ my ($module, $values) = @_;
+ map { "alias $module $_\n" } sort(uniq(@$values));
+ },
+ description => sub {
+ my ($module, $values) = @_;
+ my $desc = find { $_} @$values;
+ if_($desc, "$module\t$desc\n");
+ },
+);
+
+foreach my $kver (grep { $_ ne ".svn" && -d $_ } all(".")) {
+ foreach my $file (all($kver)) {
+ my ($module, $type) = $file =~ /^(.+)\.(.+?)$/ or next;
+ push @{$fields{$type}{$module}}, chomp_(cat_($kver . '/' . $file));
+ }
+}
+
+foreach my $type (keys %filters) {
+ output("$prefix.$type", map { $filters{$type}->($_, $fields{$type}{$_}) } sort(keys(%{$fields{$type}})));
+}