[Drbd-dev] Minor fix to DRBD install target...
Graham, Simon
Simon.Graham at stratus.com
Thu Jul 6 22:42:13 CEST 2006
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 at linbit.com [mailto:drbd-dev-bounces at linbit.com]
On Behalf Of Graham, Simon
Sent: Thursday, July 06, 2006 3:17 PM
To: drbd-dev at 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 \
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.linbit.com/pipermail/drbd-dev/attachments/20060706/f460e723/attachment.html
More information about the drbd-dev
mailing list