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?
Asked
Active
Viewed 6.0k times
48
U880D
- 1,169
Amandasaurus
- 32,281
- 69
- 194
- 263
-
1Similar on SU: http://superuser.com/questions/287371/obtain-kernel-config-from-currently-running-linux-system – Ciro Santilli OurBigBook.com Apr 29 '15 at 21:40
2 Answers
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.
Kyle Brandt
- 84,369
Insyte
- 9,474
34
I believe /proc/config.gz contains the .config file the kernel was compiled with.
sysadmin1138
- 134,165
-
8That's only available if
CONFIG_IKCONFIG_PROCwas set when the kernel was built. Doesn't seem to be there by default on RHEL or Ubuntu. – Insyte Aug 06 '09 at 17:19 -
5
-
7to read (or grep) the current settings from config.gz you can unzip it with
$cat /proc/config.gz | gunzip > mykernel.confas suggested by Jarl on superuser.com. – xaa Oct 29 '15 at 10:59 -
-
3@xaa Or you can use the single command alternatives
zcatorzless, the latter of which is more convenient as it is a pager which allows you to scroll and search as well. – comfreak Aug 28 '19 at 18:45