<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7226.0">
<TITLE>Minor fix to DRBD install target...</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/rtf format -->
<P DIR=LTR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Tahoma">I</FONT></SPAN><SPAN LANG="en-us"><FONT SIZE=2 FACE="Tahoma">’</FONT></SPAN><SPAN LANG="en-us"><FONT SIZE=2 FACE="Tahoma">ve noticed that when I</FONT></SPAN><SPAN LANG="en-us"> <FONT SIZE=2 FACE="Tahoma">do a</FONT></SPAN><SPAN LANG="en-us"> <FONT SIZE=2 FACE="Tahoma">‘</FONT></SPAN><SPAN LANG="en-us"><FONT SIZE=2 FACE="Tahoma">make install</FONT></SPAN><SPAN LANG="en-us"><FONT SIZE=2 FACE="Tahoma">’</FONT></SPAN><SPAN LANG="en-us"><FONT SIZE=2 FACE="Tahoma"> to</FONT></SPAN><SPAN LANG="en-us"> <FONT SIZE=2 FACE="Tahoma">build drbd with PREFIX set to something other than</FONT></SPAN><SPAN LANG="en-us"> <FONT SIZE=2 FACE="Tahoma">‘</FONT></SPAN><SPAN LANG="en-us"><FONT SIZE=2 FACE="Tahoma">/</FONT></SPAN><SPAN LANG="en-us"><FONT SIZE=2 FACE="Tahoma">’</FONT></SPAN><SPAN LANG="en-us"><FONT SIZE=2 FACE="Tahoma">, the drbd.ko file ends up in lib/modules/<kernel>/block/</FONT></SPAN><SPAN LANG="en-us"><FONT SIZE=2 FACE="Tahoma">drbd.ko whereas if I do a</FONT></SPAN><SPAN LANG="en-us"> <FONT SIZE=2 FACE="Tahoma">‘</FONT></SPAN><SPAN LANG="en-us"><FONT SIZE=2 FACE="Tahoma">make install</FONT></SPAN><SPAN LANG="en-us"><FONT SIZE=2 FACE="Tahoma">’</FONT></SPAN><SPAN LANG="en-us"><FONT SIZE=2 FACE="Tahoma"> on the target system with no PREFIX, the file ends up in lib/modules/<kernel>/kernel/drivers/</FONT></SPAN><SPAN LANG="en-us"><FONT SIZE=2 FACE="Tahoma">block/drbd.ko</FONT></SPAN><SPAN LANG="en-us"> <FONT SIZE=2 FACE="Tahoma">–</FONT></SPAN><SPAN LANG="en-us"><FONT SIZE=2 FACE="Tahoma"> this has been annoying me because our standard system install is based on files generated</FONT></SPAN><SPAN LANG="en-us"> <FONT SIZE=2 FACE="Tahoma">by the</FONT></SPAN><SPAN LANG="en-us"><FONT SIZE=2 FACE="Tahoma"> 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 drb</FONT></SPAN><SPAN LANG="en-us"><FONT SIZE=2 FACE="Tahoma">d.ko on the system</FONT></SPAN><SPAN LANG="en-us"> <FONT SIZE=2 FACE="Tahoma">–</FONT></SPAN><SPAN LANG="en-us"><FONT SIZE=2 FACE="Tahoma"> weirdness then ensues!</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Tahoma">I think the</FONT></SPAN><SPAN LANG="en-us"> <FONT SIZE=2 FACE="Tahoma">problem</FONT></SPAN><SPAN LANG="en-us"><FONT SIZE=2 FACE="Tahoma"> is in drbd/drbd/Makefile in the install target</FONT></SPAN><SPAN LANG="en-us"> <FONT SIZE=2 FACE="Tahoma">–</FONT></SPAN><SPAN LANG="en-us"><FONT SIZE=2 FACE="Tahoma"> when figuring out the location to put the module, it uses</FONT></SPAN><SPAN LANG="en-us"><FONT SIZE=2 FACE="Tahoma">:</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Tahoma"> MODSUBDIR := $(strip \</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Tahoma"> $(if $(wildcard lib/modules/$(KERNELRELEASE)/kernel),\</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Tahoma"> kernel/drivers/block,\</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Tahoma"> block))</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Tahoma"> LINUX := $(wildcard lib/modules/$(KERNELRELEASE)/build)</FONT></SPAN><SPAN LANG="en-us"></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Tahoma">Since I build on a system running a different kernel, MODSUBDIR ends up being just</FONT></SPAN><SPAN LANG="en-us"> <FONT SIZE=2 FACE="Tahoma">‘</FONT></SPAN><SPAN LANG="en-us"><FONT SIZE=2 FACE="Tahoma">block</FONT></SPAN><SPAN LANG="en-us"><FONT SIZE=2 FACE="Tahoma">’</FONT></SPAN><SPAN LANG="en-us"><FONT SIZE=2 FACE="Tahoma"></FONT></SPAN><SPAN LANG="en-us"> <FONT SIZE=2 FACE="Tahoma">–</FONT></SPAN><SPAN LANG="en-us"><FONT SIZE=2 FACE="Tahoma"> 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)</FONT></SPAN><SPAN LANG="en-us"><FONT SIZE=2 FACE="Tahoma">. DRBD 0.7.20 patch follows</FONT></SPAN><SPAN LANG="en-us"> <FONT SIZE=2 FACE="Tahoma">–</FONT></SPAN><SPAN LANG="en-us"><FONT SIZE=2 FACE="Tahoma"> 0.8 is identical.</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Tahoma">/simgr</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Tahoma">===================================================================</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Tahoma">--- Makefile (revision 2917)</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Tahoma">+++ Makefile (working copy)</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Tahoma">@@ -150,10 +150,10 @@</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Tahoma"> MODOBJ-6 := drbd.ko</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Tahoma"> MODOBJ := $(MODOBJ-$(PATCHLEVEL))</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Tahoma"> MODSUBDIR := $(strip \</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Tahoma">- $(if $(wildcard /lib/modules/$(KERNELRELEASE)/kernel),\</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Tahoma">+ $(if $(wildcard $(PREFIX)/lib/modules/$(KERNELRELEASE)/kernel),\</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Tahoma"> kernel/drivers/block,\</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Tahoma"> block))</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Tahoma">- LINUX := $(wildcard /lib/modules/$(KERNELRELEASE)/build)</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Tahoma">+ LINUX := $(wildcard $(PREFIX)/lib/modules/$(KERNELRELEASE)/build)</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Tahoma"> </FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Tahoma"> install:</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Tahoma"> @if ! [ -e $(MODOBJ) ] ; then \</FONT></SPAN><SPAN LANG="en-us"></SPAN></P>
</BODY>
</HTML>