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 5.6k times
47
U880D
- 597
- 7
- 17
Amandasaurus
- 30,211
- 62
- 184
- 246
-
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
45
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
- 82,107
- 71
- 302
- 444
Insyte
- 9,314
- 2
- 27
- 45
34
I believe /proc/config.gz contains the .config file the kernel was compiled with.
sysadmin1138
- 131,083
- 18
- 173
- 296
-
8That'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 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.conf` as suggested by [Jarl on superuser.com](http://superuser.com/questions/287371/obtain-kernel-config-from-currently-running-linux-system). – xaa Oct 29 '15 at 10:59
-
-
1@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 '19 at 18:45