The patch number 9373 was added via Mauro Carvalho Chehab <[EMAIL PROTECTED]>
to http://linuxtv.org/hg/v4l-dvb master development tree.

Kernel patches in this development tree may be modified to be backward
compatible with older kernels. Compatibility modifications will be
removed before inclusion into the mainstream Kernel

If anyone has any objections, please let us know by sending a message to:
        [EMAIL PROTECTED]

------

From: Mauro Carvalho Chehab  <[EMAIL PROTECTED]>
Improve make install to work properly with a distro that use non-standard dir 
for V4L/DVB modules


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 <[EMAIL PROTECTED]>


---

 v4l/scripts/make_makefile.pl |   32 ++++++++++++++++++++++++++++++--
 1 file changed, 30 insertions(+), 2 deletions(-)

diff -r d948a33de8ed -r 59a4356c78d0 v4l/scripts/make_makefile.pl
--- a/v4l/scripts/make_makefile.pl      Fri Oct 24 18:08:28 2008 +0000
+++ b/v4l/scripts/make_makefile.pl      Sat Oct 25 01:21:57 2008 -0200
@@ -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 "[EMAIL PROTECTED] [ -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 "[EMAIL PROTECTED] --strip-debug \$(in
 print OUT "[EMAIL PROTECTED] --strip-debug \$(inst-m)\n\n";
 
 removeobsolete();
+removeubuntu();
 
 print OUT "[EMAIL PROTECTED] \"Installing kernel modules under 
\$(DESTDIR)\$(KDIR26)/:\"\n";
 
@@ -191,8 +219,8 @@ print OUT "media-rminstall::\n";
 print OUT "media-rminstall::\n";
 
 removeobsolete();
-
-print OUT "[EMAIL PROTECTED] -e \"\\nRemoving old \$(DEST) files\\n\"\n";
+removeubuntu();
+
 while ( my ($dir, $files) = each(%instdir) ) {
        print OUT "[EMAIL PROTECTED] -e \"\\nRemoving old \$(KDIR26)/$dir 
files:\"\n";
        print OUT "[EMAIL PROTECTED]'", join(' ', keys %$files), "'; ";


---

Patch is available at: 
http://linuxtv.org/hg/v4l-dvb/rev/59a4356c78d059444b2015bdba85a3803101edf4

_______________________________________________
linuxtv-commits mailing list
linuxtv-commits@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to