LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Mandriva
User Name
Password
Mandriva This Forum is for the discussion of Mandriva (Mandrake) Linux.

Notices


Reply
  Search this Thread
Old 03-29-2004, 10:17 AM   #1
marouli
LQ Newbie
 
Registered: Oct 2003
Location: Patra,Greece
Distribution: Mandrake Linux 9.2
Posts: 14

Rep: Reputation: 0
where is the kernel source


Hi,
I use Mandrake 9.2.
I need to change in a makefile the root of the source of the kernel,
but i do not seem to find where that is.Isn't it in a standard place in
every distribution?
 
Old 03-29-2004, 10:47 AM   #2
fancypiper
LQ Guru
 
Registered: Feb 2003
Location: Sparta, NC USA
Distribution: Ubuntu 10.04
Posts: 5,141

Rep: Reputation: 60
If you have it installed, it is located in the directory /usr/src/linux-<your kernel version here>

# Compiling/installing kernel modules
You will need to have installed:
1. The developmental packages (compiler)
2. The kernel-source code that matches your running kernel
3. The module source or install code

Check out your system and look under the hood and see if you installed the stuff you need to do the job. Open an x terminal and type in this sequence of commands to see what kernel we are running and see if you have the kernel source installed:
Code:
[fancy@tinwhistle fancy]$ su -
Password:
[root@tinwhistle root]# uname -r
2.4.20-28.7
I am running kernel version 2.4.20-28.7. Do I have the proper source code?
Code:
[root@tinwhistle root]# cd /usr/src
[root@tinwhistle src]# ls -alc
total 3
drwxr-xr-x    4 root     root          136 Jun 12 14:53 .
drwxr-xr-x   16 root     root          424 Jun  4 12:04 ..
lrwxrwxrwx    1 root     root           14 Jun  4 12:11 linux-2.4 -> linux-2.4.20-28.7
drwxr-xr-x   16 root     root          584 Jun  4 12:11 linux-2.4.20-28.7
drwxr-xr-x    7 root     root          168 Jun  4 12:08 redhat
[root@tinwhistle src]#
I do have the same kernel version source code installed in the directory /usr/src/linux-2.4.20-28.7 and there is a symbolic link named linux-2.4 pointing to it.

If you don't see something similiar to this (but in color), you will need to install the kernel source.

NOTE: I noticed that Red Hat didn't make the symbolic link /usr/src/linux that all of the INSTALL files that I have read mentioned that I need. I may as well make one now to save editing the files in the source code every time I need to compile anything concerning the kernel. So, I'll make that link just now:
Code:
[root@tinwhistle src]# ln -s linux-2.4.20-28.7 linux         
[root@tinwhistle src]# ls -alc
total 3
drwxr-xr-x    4 root     root          160 Jun 12 15:46 .
drwxr-xr-x   16 root     root          424 Jun  4 12:04 ..
lrwxrwxrwx    1 root     root           14 Jun 12 15:46 linux -> linux-2.4.20-28.7
lrwxrwxrwx    1 root     root           14 Jun  4 12:11 linux-2.4 -> linux-2.4.20-28.7
drwxr-xr-x   16 root     root          584 Jun  4 12:11 linux-2.4.20-28.7
drwxr-xr-x    7 root     root          168 Jun  4 12:08 redhat
[root@tinwhistle src]#
Ah, there it is, so that's done.

Next, did I install the compiler?
Code:
[root@tinwhistle src]# gcc -v          
Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/2.96/specs
gcc version 2.96 20000731 (Red Hat Linux 7.3 2.96-113)
[root@tinwhistle src]#
Yes, I have a compiler installed.

If you don't have those two things installed, you have to install them first off your install CD.

If they are installed, download the source and happy compiling. Make sure you carefully read the README and INSTALL files after extracting and before compiling/installing.

# Guides to software management
LNAG - How do I install a program I downloaded from the Internet?
Rute Guide's software explanation
You might want to check out CheckInstall to manage source code installations/uninstallation
 
Old 03-29-2004, 11:03 AM   #3
marouli
LQ Newbie
 
Registered: Oct 2003
Location: Patra,Greece
Distribution: Mandrake Linux 9.2
Posts: 14

Original Poster
Rep: Reputation: 0
reply

Thank you very much for the reply!
I have the compiler but I do not have the source as it seems.
In /usr/src I have a directory called RPM.With subdirectories
Build,RPMS,Sources,Specs,Srpms.
I will try to install the source now.
Thanks again.
 
Old 03-29-2004, 11:23 AM   #4
fancypiper
LQ Guru
 
Registered: Feb 2003
Location: Sparta, NC USA
Distribution: Ubuntu 10.04
Posts: 5,141

Rep: Reputation: 60
I think you can install it with urpmi kernel-source or by using the Mandrake Control Center in the software section.
 
Old 03-29-2004, 12:23 PM   #5
marouli
LQ Newbie
 
Registered: Oct 2003
Location: Patra,Greece
Distribution: Mandrake Linux 9.2
Posts: 14

Original Poster
Rep: Reputation: 0
worked

It worked just fine!!
Thank you very much
 
  


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
Debain kernel source or Linux kernel source? kushalkoolwal Debian 4 11-28-2005 01:56 PM
how to integrate driver source into kernel source tree zhchang Linux - Software 5 11-23-2005 12:34 AM
apt-get kernel-source is installing the wrong kernel source. JordanH Ubuntu 10 07-08-2005 05:42 PM
difference between "pure" kernel source, and .deb packaged kernel source microsoft/linux Debian 1 06-19-2005 10:28 PM
where is linux source build directory/kernel source tree? webazoid Linux - Software 2 07-01-2004 08:37 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Mandriva

All times are GMT -5. The time now is 01:50 AM.

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
Open Source Consulting | Domain Registration