LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   editing a kernel module make file (https://www.linuxquestions.org/questions/linux-software-2/editing-a-kernel-module-make-file-381556/)

shanenin 11-09-2005 03:47 PM

editing a kernel module make file
 
I am need to edit a Makefile that is used to install the fusion kernel module. The Makefile checks the output of uname -r to determine the module build directory. Here is the original code
Code:

KERNEL_MODLIB    = /lib/modules/$(shell uname -r)
KERNEL_SOURCE    = $(KERNEL_MODLIB)/build
KERNEL_PATCHLEVEL = $(shell uname -r | cut -d . -f 2)

since I am building this system on a chrooted system, I could not use the output of uname -r, so I did this. The module seemed to build correctly.
Code:

KERNEL_MODLIB    = /lib/modules/$(shell ls /lib/modules)
KERNEL_SOURCE    = $(KERNEL_MODLIB)/build
KERNEL_PATCHLEVEL = 6

the problem is coming when I run make install. It errors out with the depmod command. by default depmod checks uname -r, but since my chrroted system has a differnt module directroy then uname -r returns it erros out.

question:

How can I specify depmod to use a specific module diretory then the directoy specified by uname -r.

if you care to look, this is the code used in the Makefile
Code:

(if test $(KERNEL_PATCHLEVEL) = 4; then cp $(SUB)/fusion.o $(KERNEL_MODLIB); else cp $(SUB)/fusion.ko $(KERNEL_MODLIB); fi) && depmod -ae

keefaz 11-10-2005 09:00 AM

Man depmod says :
Code:

...
OPTIONS
      -b basedir --basedir basedir
                If your modules are not currently in the (normal) directory /lib/modules/version, but in  a
                staging  area,  you  can  specify a basedir which is prepended to the directory name.  This
                basedir is stripped from the resulting modules.dep file, so it is ready to  be  moved  into
                the normal location.



All times are GMT -5. The time now is 06:05 PM.