LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices

Reply
 
Search this Thread
Old 03-19-2012, 12:54 AM   #1
atulmt
LQ Newbie
 
Registered: Aug 2011
Posts: 6

Rep: Reputation: Disabled
How to filter the linux kernel code based on config file. removing unnecessary code


Hi,
Is there any way i can filter the linux kernel code from the standard linux distribution (or from any kernel code) based upon the .config file. so that i can see the source code, which is actually getting compiled for me. All the unnecessary code and undefined macro should be removed but the directory structure should be preserved.

Thanks,
Atul
 
Old 03-19-2012, 03:55 AM   #2
ukiuki
Senior Member
 
Registered: May 2010
Location: Planet Earth
Distribution: Debian
Posts: 1,028

Rep: Reputation: 365Reputation: 365Reputation: 365Reputation: 365
You can edit the config through the menu tools like menuconfig or xconfig or any other that does the job to tweak the kernel to only really have what your machine need. You also need to know well what hardware the machine have, for that:
Code:
# lspci -v
will give all the info about it.
To edit the kernel takes time and one can't rush it, it isn't a trivial task, attention to every detail is necessary. If you don't know what one thing does research it, read about it. The advantages to compile the kernel is to gain performance, security, and other things, for old machines it does make a huge difference.

Regards
 
Old 03-19-2012, 04:12 AM   #3
atulmt
LQ Newbie
 
Registered: Aug 2011
Posts: 6

Original Poster
Rep: Reputation: Disabled
I think my purpose is not clear to you. every thing is ready (.config etc) i can run the code too. i want to study the linux kernel code, but don't want the code in kernel directory which is not intended for my board. for example i don't want NUMA related code, so is there any script or software available which can create a copy of kernel directory with all the NUMA related code removed in the final code so that the listing is bit easier to grasp likewise i am working on MIPS processor so don't want the other dir in the arch directory, just for the study purpose.
 
Old 03-20-2012, 11:38 AM   #4
onebuck
Moderator
 
Registered: Jan 2005
Location: Midwest USA, Central Illinois
Distribution: SlackwareŽ
Posts: 11,204
Blog Entries: 3

Rep: Reputation: 1433Reputation: 1433Reputation: 1433Reputation: 1433Reputation: 1433Reputation: 1433Reputation: 1433Reputation: 1433Reputation: 1433Reputation: 1433
Moderator response

Moved: This thread is more suitable in <Linux-Kernel> and has been moved accordingly to help your thread/question get the exposure it deserves.
 
Old 06-29-2013, 11:14 PM   #5
smile_time
LQ Newbie
 
Registered: Jun 2013
Posts: 1

Rep: Reputation: Disabled
I am stuck with same problem. Did you figure out something yet?
 
  


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
Kernel Filter Failed error while compiling packet capturing code on FC2 Prakhardeep Programming 3 08-10-2011 04:55 AM
[SOLVED] "missing kernel .config file" error while compiling linux source code for android preetb123 Linux - Mobile 3 03-19-2011 07:46 AM
Is there any benefit to rewrite OSS-based code to ALSA-based code? RogueWarrior65 Linux - Software 1 08-13-2010 02:11 AM
bash-code to rename files based on config file Yalla-One Programming 20 04-14-2010 01:39 PM
can't locate parsing code for .config file coolwind Linux - General 1 12-08-2002 08:24 AM


All times are GMT -5. The time now is 07:37 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration