Find the answer to your Linux question:
Results 1 to 6 of 6
The announcement of several new make scripts in the 2.6.32 release notes[/url] is very exciting. 1.8. Easy local kernel configuration Most people uses the kernel shipped by distros - and ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Dec 2006
    Posts
    14

    [SOLVED] make localmodconfig doesn't work for me


    The announcement of several new make scripts in the 2.6.32 release notes[/url] is very exciting.

    1.8. Easy local kernel configuration

    Most people uses the kernel shipped by distros - and that's good. But some people like to compile their own kernels from kernel.org, or maybe they like following the Linux development and want to try it. Configuring your own kernel, however, has become a very difficult and tedious task - there're too many options, and some times userspace software will stop working if you don't enable some key option. You can use a standard distro .config file, but it takes too many time to compile all the options it enables.

    To make easier the process of configuration, a new build target has been added: make localmodconfig. It runs "lsmod" to find all the modules loaded on the current running system. It will read all the Makefiles to map which CONFIG enables a module. It will read the Kconfig files to find the dependencies and selects that may be needed to support a CONFIG. Finally, it reads the .config file and removes any module "=m" that is not needed to enable the currently loaded modules. With this tool, you can strip a distro .config of all the unuseful drivers that are not needed in our machine, and it will take much less time to build the kernel. There's an additional "make localyesconfig" target, in case you don't want to use modules and/or initrds.
    localmodconfig - Update current config disabling modules not loaded
    localyesconfig - Update current config converting local mods to core

    So if I run them in that order, first the 'make localmodconfig' should only enable modules that I have currently loaded then the 'make localyesconfig' should switch them from modules to compiled into the kernel when I build it -- this is isn't the case for me.

    Code:
    $ extract linux-2.6.35.tar.bz2 && cd linux-2.6.35
    $ make mrproper
    $ zcat /proc/config.gz > .config
    $ make localmodconfig
    $ make menuconfig
    After running the the "make localmodconfig" script, have TONS of options that don't apply to my system flagged as modules when I inspect it via a "make menuconfig." For example:

    Code:
    Device Drivers>Graphics support>Direct Rendering Manager
    <M> ATI Radeon[*] Enable modesetting on radeon by default
    <M> Intel 830M, 845G, 852M, 855GM, 865G
    <M> i915 driver
    My system does not have ATI anything on board, nor does it have that those Intel chips.

    Here is another representation that there are many extra module options:

    My distro's kernel config I'm using as a starting point:
    Code:
    $ cat .config | grep =m | wc -l
    2434

    The kernel config after I run the make localmodconfig:
    Code:
    cat .config-make | grep =m | wc -l
    341
    According to /proc/modules I only have 76 modules currently loaded:
    Code:
    $ cat /proc/modules | wc -l
    76
    What am I doing wrong?

  2. #2
    Linux Engineer Segfault's Avatar
    Join Date
    Jun 2008
    Location
    Acadiana
    Posts
    878
    $ zcat /proc/config.gz > .config

    Why you do that?

  3. #3
    Linux Engineer Segfault's Avatar
    Join Date
    Jun 2008
    Location
    Acadiana
    Posts
    878
    I tried with plain make localmodconfig and it didn't work in my Gentoo box. Then I did make allnoconfig first and localmodconfig worked ... but I have my doubts. Have no time to check the resulting .config right now.

  4. $spacer_open
    $spacer_close
  5. #4
    Just Joined!
    Join Date
    Dec 2006
    Posts
    14
    Quote Originally Posted by Segfault View Post
    $ zcat /proc/config.gz > .config

    Why you do that?
    It copies over the current .config I can use as a starting point.

    Quote Originally Posted by Segfault View Post
    I tried with plain make localmodconfig and it didn't work in my Gentoo box. Then I did make allnoconfig first and localmodconfig worked ... but I have my doubts. Have no time to check the resulting .config right now.
    Hmm... won't this process remove ALL the options as well as modules? I just tested it and indeed it does.

  6. #5
    Linux Engineer Segfault's Avatar
    Join Date
    Jun 2008
    Location
    Acadiana
    Posts
    878
    OK, after having a closer look at this whole thing I'd have to say it is no use for custom kernel users. The only Linux I'm running is Gentoo which has no distro kernel ...

  7. #6
    Just Joined!
    Join Date
    Dec 2006
    Posts
    14
    Solved. For some reason, calling the streamline_config.pl script from the Makefile fails to give the advertised behavior. Running it yourself however, does!

    Code:
    # chmod +x ./scripts/kconfig/streamline_config.pl && ./scripts/kconfig/streamline_config.pl > config_strip
    # mv config_strip .config
    # make oldconfig

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •