LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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,030

Rep: Reputation: 385Reputation: 385Reputation: 385Reputation: 385
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: Central Florida 20 minutes from Disney World
Distribution: SlackwareŽ
Posts: 13,927
Blog Entries: 45

Rep: Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159
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



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

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 03:45 PM.

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