Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Linux - Kernel This forum is for all discussion relating to the Linux kernel.


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

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

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.

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

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

Old 03-19-2012, 04:12 AM   #3
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
Registered: Jan 2005
Location: Midwest USA, Central Illinois
Distribution: SlackwareŽ
Posts: 12,525
Blog Entries: 23

Rep: Reputation: 1922Reputation: 1922Reputation: 1922Reputation: 1922Reputation: 1922Reputation: 1922Reputation: 1922Reputation: 1922Reputation: 1922Reputation: 1922Reputation: 1922
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
LQ Newbie
Registered: Jun 2013
Posts: 1

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


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 05:04 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration