Bug 10544 - Install rule in linux-core Makefile seems wrong
Summary: Install rule in linux-core Makefile seems wrong
Status: RESOLVED FIXED
Alias: None
Product: DRI
Classification: Unclassified
Component: libdrm (show other bugs)
Version: XOrg git
Hardware: Other Linux (All)
: medium minor
Assignee: Default DRI bug account
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-04-06 09:02 UTC by Paul "TBBle" Hampson
Modified: 2007-04-06 14:21 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Paul "TBBle" Hampson 2007-04-06 09:02:26 UTC
The recently-added install target in the linux-core Makefile                                                                                                                                                        
in libdrm's master branch seems wrong.                                                                                                                                                                                              
                                                                                                                                                                                                                    
Currently, it tries to install to $(O)/drivers/char/drm, where                                                                                                                                                      
O is the directory containing the linux source or linux headers                                                                                                                                                     
neccessary for building modules.                                                                                                                                                                                    
                                                                                                                                                                                                                    
So this will put the .ko files into the linux source or headers,                                                                                                                                                    
neither of which should be being scanned by depmod.                                                                                                                                                                 
                                                                                                                                                                                                                    
With the below patch, the linux build system gets to pick where                                                                                                                                                     
it install the modules, and defaults to /lib/modules/kver/extra.                                                                                                                                                    
                                                                                                                                                                                                                    
This location is however scanned before                                                                                                                                                                             
/lib/modules/kver/kernel/drivers/char/drm by depmod, meaning                                                                                                                                                        
that the latter will be prefered. If the new ones to be installed                                                                                                                                                   
are to be preferred, passing INSTALL_MOD_DIR=updates for example                                                                                                                                                    
will install into /lib/modules/kver/updates, taking precedence                                                                                                                                                      
over built-with-the-kernel modules.                                                                                                                                                                                 
                                                                                                                                                                                                                    
And INSTALL_MOD_DIR=kernel/drivers/char/drm will overwrite the                                                                                                                                                      
versions installed with the kernel, which I think was the                                                                                                                                                           
intention of the existing code?                                                                                                                                                                                     
                                                                                                                                                                                                                   
diff --git a/linux-core/Makefile b/linux-core/Makefile
index effc206..bcab6cb 100644
--- a/linux-core/Makefile
+++ b/linux-core/Makefile
@@ -238,8 +238,7 @@ drmstat: drmstat.c
        $(CC) $(PRGCFLAGS) $< -o $@ $(DRMSTATLIBS)
 
 install:
-       echo "Installing DRM modules to "$(O)
-       install *.ko $(O)/driver/char/drm
+       make -C $(LINUXDIR) $(GETCONFIG) SUBDIRS=`pwd` DRMSRCDIR=`pwd` modules_install
        depmod -a
 
 else


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.