[systemd-devel] [PATCH] ease installation on non-running kernels
Dave Reisner
d at falconindy.com
Tue Jun 17 13:55:08 PDT 2014
On Tue, Jun 17, 2014 at 10:43:39PM +0200, Simon Peeters wrote:
> 2014-06-17 22:16 GMT+02:00 Greg KH <greg at kroah.com>:
> > On Tue, Jun 17, 2014 at 03:53:15PM -0400, Dave Reisner wrote:
> >> 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].
> >
> > Um, that should be the workflow of _any_ kernel developer, we all build
> > against local kernel directories, not one that is installed in /lib/.
> > Some of us don't ever boot kernels installed in /lib :)
> >
>
> Hej all,
>
> I have (locally) a patch that acomplishesh almost the same, but in a
> way that does not break gregs setup.
>
> What I did was:
> - Add a KERNELVER variable defaulting to $(shell uname -r)
> - replace all occurences of $(shell uname -r) with $(KERNELVER)
>
> maybe this is a viable solution?
I just wrote the same patch, except I used KVER instead of KERNELVER to
make it more visually distinct from KERNELDIR.
> It allows people to use the default paths (/lib/modules/*/build) but
> for a different kernel version, while still allowing users to set
> KERNELDIR to whatever they want.
There's an opportunity to do weird things if you were to set KERNELDIR
instead of KVER for the install target. I don't think this is anything
to worry about, though.
> I hope this is usefull
Works for me...
>
>
> Simon Peeters
>
> PS: if you want me to sent this as a decent patch, let me know and I
> do it once I am on my dev machine.
More information about the systemd-devel
mailing list