summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2008-10-25 01:21:57 -0200
committerMauro Carvalho Chehab <mchehab@redhat.com>2008-10-25 01:21:57 -0200
commit3c1b08410ee59c3b4f2ce840babb09c5a3beebd2 (patch)
treed5e2f5e02fc0b0dfb61a104cd8089c33798cc5a3
parent122f8ca9fc2a1fb872708d4135f09d68585e7f0c (diff)
downloadmediapointer-dvb-s2-3c1b08410ee59c3b4f2ce840babb09c5a3beebd2.tar.gz
mediapointer-dvb-s2-3c1b08410ee59c3b4f2ce840babb09c5a3beebd2.tar.bz2
Improve make install to work properly with a distro that use non-standard dir for V4L/DVB modules
From: Mauro Carvalho Chehab <mchehab@redhat.com> One distro stores kernel/drivers/media files on non-standard dirs. I can't see any logical rule for, once having the kernel original dir position, determine were the kernel driver were placed on that distro. For example, they put xc5000.ko driver inside <foo>/media/au0828, while the expected place would be something like <foo>/media/common/tuners. So, this patch do some tricks, when "make rminstall" or "make install" is called: 1) detect if it is such distro; 2) if so, it will run something like: find <foo>/media -name <module.ko> -exec rm '{}' \; where <module.ko> is the official V4L/DVB name for the compiled modules, and <foo> is the distro non-standard dir. This should remove the new V4L/DVB .ko modules that are located at the non-standard dir or inside one of its sub-directories. NOTICE: If there are other V4L/DVB drivers there that (1) aren't inside V4L/DVB tree; (2) weren't selected to compile; then those drivers will likely stop working. This patch doesn't affect the other distros. Priority: normal Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
-rwxr-xr-xv4l/scripts/make_makefile.pl30
1 files changed, 29 insertions, 1 deletions
diff --git a/v4l/scripts/make_makefile.pl b/v4l/scripts/make_makefile.pl
index 82821b43b..ac1b6cac0 100755
--- a/v4l/scripts/make_makefile.pl
+++ b/v4l/scripts/make_makefile.pl
@@ -157,6 +157,33 @@ sub removeobsolete()
}
}
+#
+# Special hack for Ubuntu with their backport mess
+#
+sub removeubuntu()
+{
+ my $dest = "/lib/modules/\$(KERNELRELEASE)/ubuntu/media";
+ my $filelist;
+
+ while ( my ($dir, $files) = each(%instdir) ) {
+ $filelist .= join(' ', keys %$files);
+ }
+ while ( my ($dir, $files) = each(%obsolete) ) {
+ $filelist .= join(' ', keys %$files);
+ }
+ $filelist =~ s/\s+$//;
+
+ print OUT "\t\@if [ -d $dest ]; then ";
+ print OUT "printf \"\\nHmm... distro kernel with a non-standard place for module backports detected.\\n";
+ print OUT "Please always prefer to use vanilla upstream kernel with V4L/DVB\\n";
+ print OUT "I'll try to remove old/obsolete LUM files from $dest:\\n\"; ";
+ print OUT "files='", $filelist, "'; ";
+
+ print OUT "for i in \$\$files;do find \"$dest\" \-name \"\$\$i\" \-exec echo \'{}\' \';\' ;";
+ print OUT " find \"$dest\" \-name \"\$\$i\" \-exec rm \'{}\' \';\' ;";
+ print OUT " done;";
+ print OUT " fi\n";
+}
getobsolete();
@@ -169,6 +196,7 @@ print OUT "\t\@echo \"Stripping debug info from files\"\n";
print OUT "\t\@strip --strip-debug \$(inst-m)\n\n";
removeobsolete();
+removeubuntu();
print OUT "\t\@echo \"Installing kernel modules under \$(DESTDIR)\$(KDIR26)/:\"\n";
@@ -191,8 +219,8 @@ print OUT "\t/sbin/depmod -a \$(KERNELRELEASE) \$(if \$(DESTDIR),-b \$(DESTDIR))
print OUT "media-rminstall::\n";
removeobsolete();
+removeubuntu();
-print OUT "\t\@echo -e \"\\nRemoving old \$(DEST) files\\n\"\n";
while ( my ($dir, $files) = each(%instdir) ) {
print OUT "\t\@echo -e \"\\nRemoving old \$(KDIR26)/$dir files:\"\n";
print OUT "\t\@files='", join(' ', keys %$files), "'; ";