LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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


Reply
  Search this Thread
Old 02-23-2010, 06:39 AM   #1
ravishekhar.82
Member
 
Registered: Feb 2010
Posts: 30

Rep: Reputation: 15
Question Kernel Compilation


Hi,

I am using Fedora 11 and recently I compiled kernel 2.6.32.8. I was trying to make some change in the kernel and I have included #include<linux/mmzone.h. file . But when I tried to compile it gives "No such file or directory". I checked that this file is not in /usr/include/linux but it is there in /usr/src/linux-2.6.32.8/include/linux. I getting same error for some other header file too.
I have not idea what to do it to make. I do not want to give full path. Suggest what to do.
 
Old 02-23-2010, 06:44 AM   #2
shpenat
Member
 
Registered: Dec 2008
Distribution: LFS
Posts: 95

Rep: Reputation: 21
please indicate where did you included that file (which file you modified).

generally #include<file> will search for file in standard directories whereas #include"file" will start from current directory
 
Old 02-23-2010, 06:54 AM   #3
ravishekhar.82
Member
 
Registered: Feb 2010
Posts: 30

Original Poster
Rep: Reputation: 15
Question

I have created a new directory in "/usr/src/linux-2.6.32.8/lib/new". In this directory my header file is there which is using the header files
<asm/types.h>, <linux/init.h>, <linux/kmemtrace.h> etc ...

Last edited by ravishekhar.82; 02-23-2010 at 06:57 AM.
 
Old 02-23-2010, 10:50 AM   #4
shpenat
Member
 
Registered: Dec 2008
Distribution: LFS
Posts: 95

Rep: Reputation: 21
I still dont understand what you are trying to do. When you unpack kernel tarball you get linux-2.6.x.x directory with lots of stuff in it. Makefile then expects to find files in exactly same position as they were unpacked. So if you move some of the files or modified them the build process will ultimately fail. You need to modify makefile accordingly. That if work for Linux gurus which I am definitely not.

So please indicate what exactly you want to do and maybe someone will be able to help.
 
Old 02-24-2010, 01:47 AM   #5
ravishekhar.82
Member
 
Registered: Feb 2010
Posts: 30

Original Poster
Rep: Reputation: 15
Question

Okay let me put the question in this way.

When there is a header file say <linux/xyz.h> then how system finds the header file.

My problem is that this header file <linux/xyz.h> is not in original /usr/include/linux but it is present at /usr/src/linux-2.6.32.8/include/linux. I want header files to be taken from the new location too.

In which all files I have to make changes. Do I have to create certain rule for this.

Please suggest.
 
Old 02-24-2010, 04:00 AM   #6
shpenat
Member
 
Registered: Dec 2008
Distribution: LFS
Posts: 95

Rep: Reputation: 21
Which headers are included is influenced by parameters during compilation. Parameter -I followed by path specify, where gcc looks for header files before it searches standard path.

So check your makefile. If it contains -I./include parameter then it first searches "/usr/src/linux-2.6.32.8/include" and then "/usr/include"
But I am sure kernel developers are not stupid and included this parameter into compilation process, so the headers provided alongside with kernel are used.
 
1 members found this post helpful.
Old 02-24-2010, 04:15 AM   #7
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,074

Rep: Reputation: 387Reputation: 387Reputation: 387Reputation: 387
Since the linux kernel is based on Makefiles, that's what you should be looking at. As someone else said above. I can't say much more without knowing what are you exactly doing and what exact changes did you do to the kernel source tree.

However, instead of modifying the well probed and studied kernel tree structure, I'd rather suggest you to copy the full tree to a given alternate location, and work on that separate tree, instead of doing overly complicated things or nesting trees like I think you are doing. That will also allow you to easily make a diff later if you want to make a patch.
 
1 members found this post helpful.
  


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
NO /usr/src/kernel directory & Kernel Compilation PankajDS Linux - Kernel 5 01-24-2008 02:48 AM
understanding kernel .config file (for kernel compilation) sudhirkumar Linux - General 2 09-07-2007 07:55 PM
kernel compilation : to remove a kernel which files should be deleted b0nd Linux - Newbie 2 08-17-2005 12:35 PM
Kernel compilation problems, distorted video and kernel panic shamrock_uk Linux - Laptop and Netbook 5 08-12-2005 11:53 PM
does kernel-source installs with the compilation cum installtion of a new kernel? luqman Linux - General 18 03-04-2005 08:33 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:57 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration