<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<title>Minor fix to DRBD install target...</title>
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:"Segoe UI";
        panose-1:2 11 5 2 4 2 4 2 2 3;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Tahoma","sans-serif";
        color:maroon;
        font-weight:normal;
        font-style:normal;
        text-decoration:none none;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
</head>

<body lang=EN-US link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";
color:maroon'>Whoops &#8211; spoke too soon on this being the same for DRBD-8 &#8211; that
actually has a different problem! Currently the code is:<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";
color:maroon'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";
color:maroon'>&nbsp;&nbsp;&nbsp; MODSUBDIR := $(PREFIX)kernel/drivers/block<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";
color:maroon'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";
color:maroon'>Which is completely bogus, since later on we do:<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";
color:maroon'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";
color:maroon'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
install -d $(PREFIX)/lib/modules/$(KERNELRELEASE)/$(MODSUBDIR)<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";
color:maroon'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";
color:maroon'>Patch for 0.8 follows.<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";
color:maroon'>/simgr<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";
color:maroon'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";
color:maroon'>Index: Makefile<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";
color:maroon'>===================================================================<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";
color:maroon'>--- Makefile&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (revision 2924)<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";
color:maroon'>+++ Makefile&nbsp;&nbsp;&nbsp; (working copy)<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";
color:maroon'>@@ -140,7 +140,7 @@<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";
color:maroon'>&nbsp;&nbsp;&nbsp;&nbsp; # for VERSION, PATCHLEVEL, SUBLEVEL,
EXTRAVERSION, KERNELRELEASE<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";
color:maroon'>&nbsp;&nbsp;&nbsp;&nbsp; include .drbd_kernelrelease<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";
color:maroon'>&nbsp;&nbsp;&nbsp;&nbsp; MODOBJ := drbd.ko<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";
color:maroon'>-&nbsp;&nbsp;&nbsp; MODSUBDIR := $(PREFIX)kernel/drivers/block<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";
color:maroon'>+&nbsp;&nbsp;&nbsp; MODSUBDIR := kernel/drivers/block<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";
color:maroon'>&nbsp;&nbsp;&nbsp;&nbsp; LINUX := $(wildcard
$(PREFIX)/lib/modules/$(KERNELRELEASE)/build)<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";
color:maroon'>&nbsp;<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";
color:maroon'>&nbsp;&nbsp;&nbsp;&nbsp; install:<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";
color:maroon'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";
color:maroon'><o:p>&nbsp;</o:p></span></p>

<div>

<div style='border:none;border-top:solid #91C0FF 1.0pt;padding:3.0pt 0in 0in 0in'>

<p class=MsoNormal style='margin-left:.5in'><b><span style='font-size:9.0pt;
font-family:"Segoe UI","sans-serif"'>From:</span></b><span style='font-size:
9.0pt;font-family:"Segoe UI","sans-serif"'> drbd-dev-bounces@linbit.com [mailto:drbd-dev-bounces@linbit.com]
<b>On Behalf Of </b>Graham, Simon<br>
<b>Sent:</b> Thursday, July 06, 2006 3:17 PM<br>
<b>To:</b> drbd-dev@linbit.com<br>
<b>Subject:</b> [Drbd-dev] Minor fix to DRBD install target...<o:p></o:p></span></p>

</div>

</div>

<p class=MsoNormal style='margin-left:.5in'><o:p>&nbsp;</o:p></p>

<p style='margin-left:.5in'><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>I&#8217;ve
noticed that when I</span> <span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>do
a</span> <span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>&#8216;make
install&#8217; to</span> <span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>build
drbd with PREFIX set to something other than</span> <span style='font-size:
10.0pt;font-family:"Tahoma","sans-serif"'>&#8216;/&#8217;, the drbd.ko file ends up in
lib/modules/&lt;kernel&gt;/block/drbd.ko whereas if I do a</span> <span
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>&#8216;make install&#8217; on
the target system with no PREFIX, the file ends up in
lib/modules/&lt;kernel&gt;/kernel/drivers/block/drbd.ko</span> <span
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>&#8211; this has been
annoying me because our standard system install is based on files generated</span>
<span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>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</span> <span
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>&#8211; weirdness then
ensues!</span><o:p></o:p></p>

<p style='margin-left:.5in'><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>I
think the</span> <span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>problem
is in drbd/drbd/Makefile in the install target</span> <span style='font-size:
10.0pt;font-family:"Tahoma","sans-serif"'>&#8211; when figuring out the location to
put the module, it uses:</span><o:p></o:p></p>

<p style='margin-left:.5in'><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>&nbsp;&nbsp;&nbsp;
MODSUBDIR := $(strip \</span><o:p></o:p></p>

<p style='margin-left:.5in'><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
$(if $(wildcard lib/modules/$(KERNELRELEASE)/kernel),\</span><o:p></o:p></p>

<p style='margin-left:.5in'><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
kernel/drivers/block,\</span><o:p></o:p></p>

<p style='margin-left:.5in'><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
block))</span><o:p></o:p></p>

<p style='margin-left:.5in'><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>&nbsp;&nbsp;&nbsp;
LINUX := $(wildcard lib/modules/$(KERNELRELEASE)/build)</span><o:p></o:p></p>

<p style='margin-left:.5in'><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>Since
I build on a system running a different kernel, MODSUBDIR ends up being just</span>
<span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>&#8216;block&#8217;</span>
<span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>&#8211; 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</span> <span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>&#8211;
0.8 is identical.</span><o:p></o:p></p>

<p style='margin-left:.5in'><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>/simgr</span><o:p></o:p></p>

<p style='margin-left:.5in'><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>===================================================================</span><o:p></o:p></p>

<p style='margin-left:.5in'><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>---
Makefile&nbsp;&nbsp;&nbsp; (revision 2917)</span><o:p></o:p></p>

<p style='margin-left:.5in'><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>+++
Makefile&nbsp;&nbsp;&nbsp; (working copy)</span><o:p></o:p></p>

<p style='margin-left:.5in'><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>@@
-150,10 +150,10 @@</span><o:p></o:p></p>

<p style='margin-left:.5in'><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>&nbsp;&nbsp;&nbsp;&nbsp;
MODOBJ-6 := drbd.ko</span><o:p></o:p></p>

<p style='margin-left:.5in'><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>&nbsp;&nbsp;&nbsp;&nbsp;
MODOBJ&nbsp;&nbsp; := $(MODOBJ-$(PATCHLEVEL))</span><o:p></o:p></p>

<p style='margin-left:.5in'><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>&nbsp;&nbsp;&nbsp;&nbsp;
MODSUBDIR := $(strip \</span><o:p></o:p></p>

<p style='margin-left:.5in'><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
$(if $(wildcard /lib/modules/$(KERNELRELEASE)/kernel),\</span><o:p></o:p></p>

<p style='margin-left:.5in'><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
$(if $(wildcard $(PREFIX)/lib/modules/$(KERNELRELEASE)/kernel),\</span><o:p></o:p></p>

<p style='margin-left:.5in'><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
kernel/drivers/block,\</span><o:p></o:p></p>

<p style='margin-left:.5in'><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
block))</span><o:p></o:p></p>

<p style='margin-left:.5in'><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>-&nbsp;&nbsp;&nbsp;
LINUX := $(wildcard /lib/modules/$(KERNELRELEASE)/build)</span><o:p></o:p></p>

<p style='margin-left:.5in'><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>+&nbsp;&nbsp;&nbsp;
LINUX := $(wildcard $(PREFIX)/lib/modules/$(KERNELRELEASE)/build)</span><o:p></o:p></p>

<p style='margin-left:.5in'><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>&nbsp;</span><o:p></o:p></p>

<p style='margin-left:.5in'><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>&nbsp;&nbsp;&nbsp;&nbsp;
install:</span><o:p></o:p></p>

<p style='margin-left:.5in'><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
@if ! [ -e $(MODOBJ) ] ; then \</span><o:p></o:p></p>

</div>

</body>

</html>