I'm pretty sure that all Red Hat and Debian based distributions follow the convention of shipping the kernel configuration in /boot/config-*
, but what of other distributions? Or, if this convention is extremely common, which distributions don't follow it?
2 Answers
Debian and derivatives (Ubuntu, Linux Mint, …)
The configuration for the kernel /boot/vmlinuz-VERSION
is stored in /boot/config-VERSION
. The two files ship in the same package, linux-VERSION
or kernel-VERSION
.
Arch Linux, Gentoo (if enabled)
The configuration for the running kernel is stored in the kernel binary and can be retrieved with zcat /proc/config.gz
.
This file exists when the CONFIG_IKCONFIG
option is set when compiling the kernel - and so can be true (or not) regardless of distribution, though the default kernel configuration for the two named does enable it.
Incidentally, arch linux's default configuration does not name the kernel (or its initramfs image) by version even in /boot
- the files there are named only for their corresponding packages. For example, a typical arch linux boot kernel is named /boot/vmlinuz-linux
where linux is the package one installs for the default kernel.
The linux kernel source comes with an installation mechanism, make install
. This installs files into /boot (vmlinuz-version, System.map-version, and config-version).
The option to make the running kernel's config available via /proc/config.gz
is part of the kernel too, so if this config option has been enabled the file will exist in the /proc
filesystem. Almost all distributions have this enabled these days, even Android kernels, and as such, this is the most standard location.
Neither of these locations is dependent on the distribution though. Many distributions take advantage of the 'default' location when packaging, as it's probably convenient to prepare packages this way, but even within a single distribution it's possible that non-standard kernel packages might place the files elsewhere, or name them differently, although this is unlikely.
ls: cannot access /boot/config*: No such file or directory
. But, then again, an archer's/boot
is a very personal thing. On the other hand,ls /proc/config.gz
is entirely successful.