[linux-dvb] [PATCH] v4l-dvb: add $DESTDIR support

Trent Piepho xyzzy at speakeasy.org
Thu Mar 8 23:57:18 CET 2007

On Thu, 8 Mar 2007, Ludwig Nussel wrote:
> Trent Piepho wrote:
> > > Following patch adds $DESTDIR support so one can install the kernel
> > > modules into a directory other than / as non-root user. That's
> > > useful when building an rpm or compiling for a different machine.

> > > -print OUT "\t/sbin/depmod -a \${KERNELRELEASE}\n\n";
> > > +print OUT "\tif [ -w / ]; then /sbin/depmod -a \${KERNELRELEASE}; fi\n\n";
> >
> > This doesn't seem correct.  Shouldn't it be:
> > print OUT "\t/sbin/depmod -a \$(KERNELRELEASE) \$(if \$(DESTDIR),-b \$(DESTDIR))\n\n";
> One needs to run depmod when the modules get installed to their final location.
> $DESTDIR is incomplete so it doesn't make sense to run depmod here already.

When compiling an RPM package DESTDIR may not be the final location, but
that is not the only reason one might want to use DESTDIR.  One could
repair a mounted root fs after booting from a rescue CD or be trying to
create a bootable MythTV image.

If I can write to /, then the modules go to DESTDIR but depmod is run on /.
That doesn't seem consistent.  And if I can't write to / (say it's read
only) but can write to the module install directory, then depmod isn't run,
even if I plan to boot a system with those modules.

Also, the kernel's "modules_install" target will run depmod on with "-b
$(INSTALL_MOD_PATH)" if the modules are being installed to a directory other
than the root.  I think it makes sense to be consistent with the kernel's

More information about the linux-dvb mailing list