[systemd-devel] [PATCH] ease installation on non-running kernels

Dave Reisner d at falconindy.com
Tue Jun 17 12:53:15 PDT 2014


On Tue, Jun 17, 2014 at 12:28:27PM -0700, Greg KH wrote:
> On Tue, Jun 17, 2014 at 02:52:43PM -0400, Dave Reisner wrote:
> > This lets KERNELDIR apply to the install target as well so that you can
> > do something such as the following will Just Work™:
> > 
> >   make KERNELDIR=/lib/modules/3.15.0-foo install
> > ---
> >  Makefile | 14 +++++++-------
> >  1 file changed, 7 insertions(+), 7 deletions(-)
> > 
> > diff --git a/Makefile b/Makefile
> > index c593b51..fe4dd58 100644
> > --- a/Makefile
> > +++ b/Makefile
> > @@ -17,7 +17,7 @@ kdbus$(EXT)-y := \
> >  
> >  obj-m += kdbus$(EXT).o
> >  
> > -KERNELDIR 		?= /lib/modules/$(shell uname -r)/build
> > +KERNELDIR 		?= /lib/modules/$(shell uname -r)
> >  PWD			:= $(shell pwd)
> >  
> >  all: module test
> > @@ -26,7 +26,7 @@ test::
> >  	$(MAKE) -C test KBUILD_MODNAME=kdbus$(EXT)
> >  
> >  module:
> > -	$(MAKE) -C $(KERNELDIR) M=$(PWD)
> > +	$(MAKE) -C $(KERNELDIR)/build M=$(PWD)
> 
> Nope, you just broke the build on my machine when I wanted to build
> against the kernel source tree in /home/gregkh/linux/ that does not have
> a build/ subdirectory in it.

Fair enough. I figured this would be the response I get [0].

> What is wrong with putting the build/ trailing subdir in your build
> command line?  What is currently broken today with the build system?

As the commit message implies, make install doesn't work for non-running
kernels -- it will always install to the current kernel. So, after a
kernel upgrade, I have to make the subdirectories myself, copy over the
module, and run depmod before I can build an initramfs for the new
kernel (and subsequently reboot).

> And long-term, this will not be an issue at all as the code will be
> merged into the kernel tree.

Sure, but unless I'm missing something, the status quo makes things a
bit tedious for rebuilds. Most other out of tree modules I've come in
contact with make this a trivial operation.

Cheers,
Dave

[0] http://xkcd.com/1172/


More information about the systemd-devel mailing list