[Drbd-dev] Minor fix to DRBD install target...

Graham, Simon Simon.Graham at stratus.com
Thu Jul 6 21:16:35 CEST 2006

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),\
    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.


--- Makefile	(revision 2917)
+++ Makefile	(working copy)
@@ -150,10 +150,10 @@
     MODOBJ-6 := drbd.ko
     MODSUBDIR := $(strip \
-      $(if $(wildcard /lib/modules/$(KERNELRELEASE)/kernel),\
+      $(if $(wildcard $(PREFIX)/lib/modules/$(KERNELRELEASE)/kernel),\
-    LINUX := $(wildcard /lib/modules/$(KERNELRELEASE)/build)
+    LINUX := $(wildcard $(PREFIX)/lib/modules/$(KERNELRELEASE)/build)
 	@if ! [ -e $(MODOBJ) ] ; then \
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.linbit.com/pipermail/drbd-dev/attachments/20060706/4740ebeb/attachment.htm

More information about the drbd-dev mailing list