Bug 152130

Summary: kernel needs /lib/modules/`uname -r`/build subdirectory
Product: Red Hat Enterprise Linux 4 Reporter: David Kewley <david_kewley>
Component: kernelAssignee: Dave Jones <davej>
Status: CLOSED DUPLICATE QA Contact: Brian Brock <bbrock>
Severity: medium Docs Contact:
Priority: medium    
Version: 4.0CC: jbaron, pfrields, riel
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2005-03-26 01:33:24 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description David Kewley 2005-03-25 04:24:44 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (compatible; Konqueror/3.1; Linux)

Description of problem:
For every `uname -r`, there should exist a /lib/modules/`uname -r`/build 
directory pointing to the kernel files necessary for building modules.  This 
seems to work well in Fedora Core 3.  RHEL 4, on the other hand, has a new 
package kernel-devel that installs source in /usr/src/kernels/<kernel name>, 
and makes a symlink to that source directory from /lib/modules/`uname 
-r`/build. 
 
This obscures things when you're building a modules for UP and SMP kernels.  
Best I can tell, I'm supposed to do this: 
 
For UP kernel: 
1) cd /usr/src/kernels/<UP kernel name> 
2) cp /boot/config-<UP kernel name> ./.config 
3) make oldconfig 
4) make 
5) cd <my module dir> 
6) make SRC=/usr/src/kernels/<UP kernel name> 
7) cp <my module>.ko /lib/modules/<UP kernel name>/updates 
 
Then for SMP kernel: 
1) cd /usr/src/kernels/<SMP kernel name> 
2) cp /boot/config-<SMP kernel name> ./.config 
3) make oldconfig 
4) make 
5) cd <my module dir> 
6) make SRC=/usr/src/kernels/<SMP kernel name> 
7) cp <my module>.ko /lib/modules/<SMP kernel name>/updates 
 
Shouldn't I instead be able to do this instead?: 
 
For UP kernel: 
1) cd <my module dir> 
2) make SRC=/lib/modules/<UP kernel name>/build 
3) cp <my module>.ko /lib/modules/<UP kernel name>/updates 
 
Then for SMP kernel: 
1) cd <my module dir> 
2) make SRC=/lib/modules/<SMP kernel name>/build 
3) cp <my module>.ko /lib/modules/<SMP kernel name>/updates 
 
Fedora Core 3 allows me to do it the latter, faster, easier way.  Why don't we 
use FC3's scheme instead of the one currently in RHEL4? 
 
I'm treading on new ground here, so please correct any misstatements I've 
made. 
 

Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1. ls -ald /lib/modules/`uname -r`/build 
2. rpm -ql kernel-devel | grep -v /usr/src 
3. Notice that we have a build symlink for UP kernels but not for SMP 
4. Notice that there is no kernel-devel-smp or some such. 
5. Notice that we have to 'make' the kernel for UP and SMP separately, rather 
than taking advantage of pre-built trees for building external modules. 
   

Actual Results:  We notice that kernel-devel is the package that provides the 
/lib/modules/`uname -r`/build symlinks, but it only provides symlinks for UP 
kernels, not for SMP kernels.  We notice that it takes too many steps to build 
external modules. 

Expected Results:  kernel should have a full external module build tree under /lib/modules/`uname 
-r`/build, rather than a symlink.  This would enable us to build external 
modules more easily. 
 

Additional info:

Comment 1 David Kewley 2005-03-26 01:33:24 UTC
Accidental verbatim duplicate of bug 152129.

*** This bug has been marked as a duplicate of 152129 ***