LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 11-09-2005, 03:47 PM   #1
shanenin
Member
 
Registered: Aug 2003
Location: Rochester, MN, U.S.A
Distribution: Gentoo
Posts: 987

Rep: Reputation: 30
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
 
Old 11-10-2005, 09:00 AM   #2
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,969

Rep: Reputation: 1034Reputation: 1034Reputation: 1034Reputation: 1034Reputation: 1034Reputation: 1034Reputation: 1034Reputation: 1034
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
compile kernel module without 'make' whysyn Linux - Software 2 01-29-2006 12:56 AM
install after or before gcc,binutils,make,module-init when migrating kernel 2.6 eatmars Linux - Software 1 10-02-2005 12:52 PM
editing the kernel config file slzckboy Linux - General 4 09-24-2005 01:48 PM
Building kernel module from multiple source file in 2.6 kernel yogeshwar_s Programming 1 12-20-2004 09:31 AM
make problem in the simplest kernel module shogun1234 Linux - Software 1 11-01-2004 09:50 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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

Contact Us - Advertising Info - Rules - Privacy - Donations - Contributing Member - LQ Sitemap - "Weather apps tell you it'll rain. Wyndo tells you when to go."
Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions