Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place! |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
11-05-2009, 01:35 PM
|
#1
|
LQ Newbie
Registered: Nov 2009
Posts: 2
Rep:
|
Problem with make file
hi..i have been using the following make file to get .ko files in red hat linux. which i later used to insmod..
obj-m := mydriver.o
KERNDIR ?= /lib/modules/$(shell uname -r)/build
PWD := $(shell pwd)
default:
$(MAKE) -C $(KERNDIR) M=`pwd` modules
clean:
rm -f *.ko *.mod.c *.o
but i installed ubuntu 6.06 recently and my make is no longer sucessful since ubuntu doesnt have /lib/modules/$(shell uname -r)/build path..
what do i do?any help is much appreciated.
PS: This is my first post..
|
|
|
11-05-2009, 02:41 PM
|
#2
|
LQ Guru
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 27,467
|
Quote:
Originally Posted by libinpk
hi..i have been using the following make file to get .ko files in red hat linux. which i later used to insmod..
obj-m := mydriver.o
KERNDIR ?= /lib/modules/$(shell uname -r)/build
PWD := $(shell pwd)
default:
$(MAKE) -C $(KERNDIR) M=`pwd` modules
clean:
rm -f *.ko *.mod.c *.o
but i installed ubuntu 6.06 recently and my make is no longer sucessful since ubuntu doesnt have /lib/modules/$(shell uname -r)/build path..
what do i do?any help is much appreciated.
PS: This is my first post..
|
Well, first off, Ubuntu 6.06 is VERY old, so if you recently installed it, I'd suggest installing the current version. After that, you don't say what version of RedHat you're coming from, but if you don't have the /lib/modules path, you probably don't have the kernel source installed. You could TRY to install it for 6.06, but I'd suggest loading the current version, and choosing it at build time for installation.
|
|
|
11-05-2009, 02:58 PM
|
#3
|
Member
Registered: Nov 2009
Location: Kolkata, India
Distribution: Fedora 11
Posts: 136
Rep:
|
check if you have /lib/modules/[kernel name]/build by browsing your filesystem.
Sometimes it is linked to /usr/src/kernels/[kernel name], so check for that too.
[kernel name] can be found by typing
$uname -r
its actually your kernel source tree.
If you cant find the source tree in default location, it may not have come with your distro. So first install the kernel source tree, then to can use its path in the Make file.
If you have a little bit of time (and resource) you may choose to compile a whole new kernel and use it.
Then you will have the source tree for sure.
|
|
|
11-06-2009, 10:57 AM
|
#4
|
LQ Newbie
Registered: Nov 2009
Posts: 2
Original Poster
Rep:
|
thanks for your reply.. but it didnt solve my problem. i found that my /usr/src directory is empty. so what do i do? install it..?okay,but how do i do it?
|
|
|
11-06-2009, 12:49 PM
|
#5
|
Member
Registered: Nov 2009
Location: Kolkata, India
Distribution: Fedora 11
Posts: 136
Rep:
|
I guess can you can get the kernel source tree from the distribution's official website. It will also contain the details how to install it.
Regarding installation of a new kernel its a time taking process which may not always be successful.
Let me know then , after you have considered the first option.
|
|
|
All times are GMT -5. The time now is 07:18 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|