48

How do I check what options are compiled into a Linux kernel without looking at /boot/config-* and if I don't have access to the /boot/config-* file that's left over?

1

2 Answers 2

47

Unless your kernel was built with CONFIG_IKCONFIG_PROC, which would make the config available in /proc as sysadmin1138 mentioned above, you're pretty much out of luck. Debian and RH based kernel packages do, however, generally install a config-$version file in /boot. So unless it's a custom kernel, it should be available there.

34

I believe /proc/config.gz contains the .config file the kernel was compiled with.

5
  • 8
    That's only available if CONFIG_IKCONFIG_PROC was set when the kernel was built. Doesn't seem to be there by default on RHEL or Ubuntu.
    – Insyte
    Aug 6, 2009 at 17:19
  • 5
    As of writing, this is enabled by default on Arch :)
    – Navin
    Apr 25, 2013 at 0:33
  • 7
    to read (or grep) the current settings from config.gz you can unzip it with $cat /proc/config.gz | gunzip > mykernel.conf as suggested by Jarl on superuser.com.
    – xaa
    Oct 29, 2015 at 10:59
  • It is the case on Arch Linux as CONFIG_IKCONFIG_PROC=y.
    – Terry Wang
    Jan 4, 2018 at 5:11
  • 3
    @xaa Or you can use the single command alternatives zcat or zless, the latter of which is more convenient as it is a pager which allows you to scroll and search as well.
    – comfreak
    Aug 28, 2019 at 18:45

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .