kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
From: ali@internetdog.org (Ali Bahar)
To: kernelnewbies@lists.kernelnewbies.org
Subject: kernel customization
Date: Sun, 12 Jun 2011 16:38:16 +0800	[thread overview]
Message-ID: <20110612083816.GA25300@internetdog.org> (raw)
In-Reply-To: <BANLkTim14FX6msNA2EqHWeNwNyDBWajD4A@mail.gmail.com>

On Sun, Jun 12, 2011 at 10:59:56AM +0530, Venkateswarlu P wrote:
> For kernel customization  ,  i.e  for
> 
> make menuconfig
> 
> what is the easy way to know only required  device drivers

I wish there were one! :-)

The laziest approach may be to build everything -- eg with a 
"make allmodconfig" -- and then boot into the new kernel. Then lsmod
will show you which drivers are actually in-use.
The down side of this is the long compilation time, the disk usage,
and the slower boot for this kernel. Also, the output of lsmod is not
as obvious as you may expect: it may not be easy to dereference the
loaded-modules' names to their CONFIG options.

Other than that, you'd need to know which devices you have in your
system, and how those translate into kernel CONFIG options.

... Come to think of it, the frequent case is a plain desktop, and
that is easier: if you have not added new devices to your
box, then just run lsmod within your running kernel (ie whatever your
distro has provided), and see which devices it shows.

Of course, lsmod doesn't show whatever has been _statically_ built 
into the kernel. You can run
  grep =y /boot/config*`uname -r`
to find the statics, but this won't be much different from running
"make menuconfig".

In summary,

1. If you don't have any new devices in your system, and you have a
running kernel provided by your distro:

 a. run 'lsmod' to see which modules are in use. 
 b. run "make oldconfig".
 c. start pruning out all the things you don't want. This will take
    time, depending on how lean you want it.

2. If you have new devices,
   do as in (1), but add the new device.

later,
ali

  reply	other threads:[~2011-06-12  8:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-12  5:29 kernel customization Venkateswarlu P
2011-06-12  8:38 ` Ali Bahar [this message]
2011-06-12 15:45 ` Greg KH
2011-06-13 11:41 ` Christopher Harvey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110612083816.GA25300@internetdog.org \
    --to=ali@internetdog.org \
    --cc=kernelnewbies@lists.kernelnewbies.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).