From 3c1b08410ee59c3b4f2ce840babb09c5a3beebd2 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Sat, 25 Oct 2008 01:21:57 -0200 Subject: Improve make install to work properly with a distro that use non-standard dir for V4L/DVB modules From: Mauro Carvalho Chehab 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 /media/au0828, while the expected place would be something like /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 /media -name -exec rm '{}' \; where is the official V4L/DVB name for the compiled modules, and 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 --- v4l/scripts/make_makefile.pl | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) (limited to 'v4l/scripts/make_makefile.pl') 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), "'; "; -- cgit v1.2.3 From f46b85426d01f8ce77fd9a4a036cc0345ae1c4be Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Sat, 25 Oct 2008 01:34:37 -0200 Subject: A small improvement at a comment added on the latest patch From: Mauro Carvalho Chehab Priority: normal Signed-off-by: Mauro Carvalho Chehab --- v4l/scripts/make_makefile.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'v4l/scripts/make_makefile.pl') diff --git a/v4l/scripts/make_makefile.pl b/v4l/scripts/make_makefile.pl index ac1b6cac0..ce6f00516 100755 --- a/v4l/scripts/make_makefile.pl +++ b/v4l/scripts/make_makefile.pl @@ -158,7 +158,7 @@ sub removeobsolete() } # -# Special hack for Ubuntu with their backport mess +# Special hack for Ubuntu with their non-standard dir # sub removeubuntu() { -- cgit v1.2.3