All of lore.kernel.org
 help / color / mirror / Atom feed
* [Drbd-dev] Minor fix to DRBD install target...
@ 2006-07-06 19:16 Graham, Simon
  0 siblings, 0 replies; 5+ messages in thread
From: Graham, Simon @ 2006-07-06 19:16 UTC (permalink / raw)
  To: drbd-dev

[-- Attachment #1: Type: text/plain, Size: 1856 bytes --]

I've noticed that when I do a 'make install' to build drbd with PREFIX
set to something other than '/', the drbd.ko file ends up in
lib/modules/<kernel>/block/drbd.ko whereas if I do a 'make install' on
the target system with no PREFIX, the file ends up in
lib/modules/<kernel>/kernel/drivers/block/drbd.ko - this has been
annoying me because our standard system install is based on files
generated by the first whereas if I then make a change and go to update
an installed system it uses the second and I end up with two copies of
drbd.ko on the system - weirdness then ensues!

I think the problem is in drbd/drbd/Makefile in the install target -
when figuring out the location to put the module, it uses:

    MODSUBDIR := $(strip \
      $(if $(wildcard lib/modules/$(KERNELRELEASE)/kernel),\
           kernel/drivers/block,\
           block))
    LINUX := $(wildcard lib/modules/$(KERNELRELEASE)/build)

Since I build on a system running a different kernel, MODSUBDIR ends up
being just 'block' - I think both of these variable assignments should
have $(PREFIX) on the front (and it certainly seems to work better for
me when I do this). DRBD 0.7.20 patch follows - 0.8 is identical.

/simgr

===================================================================
--- Makefile	(revision 2917)
+++ Makefile	(working copy)
@@ -150,10 +150,10 @@
     MODOBJ-6 := drbd.ko
     MODOBJ   := $(MODOBJ-$(PATCHLEVEL))
     MODSUBDIR := $(strip \
-      $(if $(wildcard /lib/modules/$(KERNELRELEASE)/kernel),\
+      $(if $(wildcard $(PREFIX)/lib/modules/$(KERNELRELEASE)/kernel),\
            kernel/drivers/block,\
            block))
-    LINUX := $(wildcard /lib/modules/$(KERNELRELEASE)/build)
+    LINUX := $(wildcard $(PREFIX)/lib/modules/$(KERNELRELEASE)/build)
 
     install:
 	@if ! [ -e $(MODOBJ) ] ; then \

[-- Attachment #2: Type: text/html, Size: 7104 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: [Drbd-dev] Minor fix to DRBD install target...
@ 2006-07-06 20:42 Graham, Simon
  2006-07-07  9:33 ` Philipp Reisner
  0 siblings, 1 reply; 5+ messages in thread
From: Graham, Simon @ 2006-07-06 20:42 UTC (permalink / raw)
  To: drbd-dev

[-- Attachment #1: Type: text/plain, Size: 3023 bytes --]

Whoops - spoke too soon on this being the same for DRBD-8 - that
actually has a different problem! Currently the code is:

 

    MODSUBDIR := $(PREFIX)kernel/drivers/block

 

Which is completely bogus, since later on we do:

 

            install -d
$(PREFIX)/lib/modules/$(KERNELRELEASE)/$(MODSUBDIR)

 

Patch for 0.8 follows.

/simgr

 

Index: Makefile

===================================================================

--- Makefile       (revision 2924)

+++ Makefile    (working copy)

@@ -140,7 +140,7 @@

     # for VERSION, PATCHLEVEL, SUBLEVEL, EXTRAVERSION, KERNELRELEASE

     include .drbd_kernelrelease

     MODOBJ := drbd.ko

-    MODSUBDIR := $(PREFIX)kernel/drivers/block

+    MODSUBDIR := kernel/drivers/block

     LINUX := $(wildcard $(PREFIX)/lib/modules/$(KERNELRELEASE)/build)

 

     install:

 

 

From: drbd-dev-bounces@linbit.com [mailto:drbd-dev-bounces@linbit.com]
On Behalf Of Graham, Simon
Sent: Thursday, July 06, 2006 3:17 PM
To: drbd-dev@linbit.com
Subject: [Drbd-dev] Minor fix to DRBD install target...

 

I've noticed that when I do a 'make install' to build drbd with PREFIX
set to something other than '/', the drbd.ko file ends up in
lib/modules/<kernel>/block/drbd.ko whereas if I do a 'make install' on
the target system with no PREFIX, the file ends up in
lib/modules/<kernel>/kernel/drivers/block/drbd.ko - this has been
annoying me because our standard system install is based on files
generated by the first whereas if I then make a change and go to update
an installed system it uses the second and I end up with two copies of
drbd.ko on the system - weirdness then ensues!

I think the problem is in drbd/drbd/Makefile in the install target -
when figuring out the location to put the module, it uses:

    MODSUBDIR := $(strip \

      $(if $(wildcard lib/modules/$(KERNELRELEASE)/kernel),\

           kernel/drivers/block,\

           block))

    LINUX := $(wildcard lib/modules/$(KERNELRELEASE)/build)

Since I build on a system running a different kernel, MODSUBDIR ends up
being just 'block' - I think both of these variable assignments should
have $(PREFIX) on the front (and it certainly seems to work better for
me when I do this). DRBD 0.7.20 patch follows - 0.8 is identical.

/simgr

===================================================================

--- Makefile    (revision 2917)

+++ Makefile    (working copy)

@@ -150,10 +150,10 @@

     MODOBJ-6 := drbd.ko

     MODOBJ   := $(MODOBJ-$(PATCHLEVEL))

     MODSUBDIR := $(strip \

-      $(if $(wildcard /lib/modules/$(KERNELRELEASE)/kernel),\

+      $(if $(wildcard $(PREFIX)/lib/modules/$(KERNELRELEASE)/kernel),\

            kernel/drivers/block,\

            block))

-    LINUX := $(wildcard /lib/modules/$(KERNELRELEASE)/build)

+    LINUX := $(wildcard $(PREFIX)/lib/modules/$(KERNELRELEASE)/build)

 

     install:

        @if ! [ -e $(MODOBJ) ] ; then \


[-- Attachment #2: Type: text/html, Size: 13395 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Drbd-dev] Minor fix to DRBD install target...
  2006-07-06 20:42 [Drbd-dev] Minor fix to DRBD install target Graham, Simon
@ 2006-07-07  9:33 ` Philipp Reisner
  2006-07-10 15:30   ` Lars Ellenberg
  0 siblings, 1 reply; 5+ messages in thread
From: Philipp Reisner @ 2006-07-07  9:33 UTC (permalink / raw)
  To: drbd-dev

Lars is the Makefile guru here, I leave these patches for him ...
[ He is on Monday in the office again. ]
-Philipp
-- 
: Dipl-Ing Philipp Reisner                      Tel +43-1-8178292-50 :
: LINBIT Information Technologies GmbH          Fax +43-1-8178292-82 :
: Schönbrunnerstr 244, 1120 Vienna, Austria    http://www.linbit.com :

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Drbd-dev] Minor fix to DRBD install target...
  2006-07-07  9:33 ` Philipp Reisner
@ 2006-07-10 15:30   ` Lars Ellenberg
  0 siblings, 0 replies; 5+ messages in thread
From: Lars Ellenberg @ 2006-07-10 15:30 UTC (permalink / raw)
  To: drbd-dev

/ 2006-07-07 11:33:53 +0200
\ Philipp Reisner:
> Lars is the Makefile guru here, I leave these patches for him ...
> [ He is on Monday in the office again. ]

since we only target 2.6. with drbd 8, we can "hardcode" modsub dir.
no one seems to use lib/<ver>/block anymore anywhere.

-- 
: Lars Ellenberg                                  Tel +43-1-8178292-55 :
: LINBIT Information Technologies GmbH            Fax +43-1-8178292-82 :
: Schoenbrunner Str. 244, A-1120 Vienna/Europe   http://www.linbit.com :

^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: [Drbd-dev] Minor fix to DRBD install target...
@ 2006-07-10 15:40 Graham, Simon
  0 siblings, 0 replies; 5+ messages in thread
From: Graham, Simon @ 2006-07-10 15:40 UTC (permalink / raw)
  To: Lars Ellenberg, drbd-dev

Yes - sorry, my mistake on the DRBD-8 build MODSUBDIR definition...

Simon


-----Original Message-----
From: drbd-dev-bounces@linbit.com [mailto:drbd-dev-bounces@linbit.com]
On Behalf Of Lars Ellenberg
Sent: Monday, July 10, 2006 11:31 AM
To: drbd-dev@linbit.com
Subject: Re: [Drbd-dev] Minor fix to DRBD install target...

/ 2006-07-07 11:33:53 +0200
\ Philipp Reisner:
> Lars is the Makefile guru here, I leave these patches for him ...
> [ He is on Monday in the office again. ]

since we only target 2.6. with drbd 8, we can "hardcode" modsub dir.
no one seems to use lib/<ver>/block anymore anywhere.

-- 
: Lars Ellenberg                                  Tel +43-1-8178292-55 :
: LINBIT Information Technologies GmbH            Fax +43-1-8178292-82 :
: Schoenbrunner Str. 244, A-1120 Vienna/Europe   http://www.linbit.com :
_______________________________________________
drbd-dev mailing list
drbd-dev@lists.linbit.com
http://lists.linbit.com/mailman/listinfo/drbd-dev

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2006-07-10 15:40 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-07-06 20:42 [Drbd-dev] Minor fix to DRBD install target Graham, Simon
2006-07-07  9:33 ` Philipp Reisner
2006-07-10 15:30   ` Lars Ellenberg
  -- strict thread matches above, loose matches on Subject: below --
2006-07-10 15:40 Graham, Simon
2006-07-06 19:16 Graham, Simon

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.