how do I learn the default kernel config settings within a given distro?
Linux - KernelThis forum is for all discussion relating to the Linux kernel.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
how do I learn the default kernel config settings within a given distro?
You fetch an ISO for your favorite distro.
You dance and install that distro to your workstation.
The distro ships with a running kernel.
The kernel has some kernel-config settings in place.
For any given distro, how do I discover the default kernel-config settings used for the as-built distro kernel?
I expect each distro might be unique in where they choose to store this sort of detail. I'm partial to Linux Mint which is derived from Ubuntu which is derived from Debian.
Hi, with most distributions of GNU/Linux you can find the current config file in /boot
It is a plain text file listing the modules and a parameter (y/n/m) to load the module when the kernel loads
/boot/config
my system liks this to /boot/config-3.8.13.4-desktop-1.mga3
Have a look, you could use a program like kdiff3 to see the differences between any other .config files from other kernels, or even to check what has changed on your own system after configuring the kernel source, you don't have to install the newly configured kernel to see the new .config file.
a config file is generated when you configure the kernel source (now-a-days we just install kernel-devel)
When I look into the latest edition of the file I see:
Code:
prompt$ less /boot/config-3.0.0-32-generic
...
#
# General setup
#
CONFIG_EXPERIMENTAL=y
CONFIG_INIT_ENV_ARG_LIMIT=32
CONFIG_INIT_PASS_ALL_PARAMS=y
CONFIG_CROSS_COMPILE=""
CONFIG_LOCALVERSION=""
# CONFIG_LOCALVERSION_AUTO is not set
CONFIG_HAVE_KERNEL_GZIP=y
CONFIG_HAVE_KERNEL_BZIP2=y
CONFIG_HAVE_KERNEL_LZMA=y
CONFIG_HAVE_KERNEL_XZ=y
CONFIG_HAVE_KERNEL_LZO=y
CONFIG_KERNEL_GZIP=y
# CONFIG_KERNEL_BZIP2 is not set
# CONFIG_KERNEL_LZMA is not set
# CONFIG_KERNEL_XZ is not set
# CONFIG_KERNEL_LZO is not set
CONFIG_DEFAULT_HOSTNAME="(none)"
CONFIG_VERSION_SIGNATURE="Ubuntu 3.0.0-32.51-generic 3.0.69"
CONFIG_SWAP=y
CONFIG_SYSVIPC=y
CONFIG_SYSVIPC_SYSCTL=y
CONFIG_POSIX_MQUEUE=y
CONFIG_POSIX_MQUEUE_SYSCTL=y
CONFIG_BSD_PROCESS_ACCT=y
CONFIG_BSD_PROCESS_ACCT_V3=y
...
Looks like kernel config details to me. Viola!!
Follow-up:
Now that I have the settings within the kernel that is running on my workstation -- I'm using the disto, as-built, kernel -- is there a way:
copy and rename this file
edit the file for alternate settings
use the modified file to config an alternate kernet
I've built kernels from sources in the distant past and for Linux in the late 90s. I know I need to do homework about the HOWTO, but I want to sort the configuration details first. I really don't want to tinker with everything only a precious few settings.
If you can't find the config file in a distro, most kernels are configured to have a compressed list of the kernel options inbuilt. You can see that list with
When a Linux kernel is built from source, a hidden file called .config (note the leading ".") will be found in the source-directory. This is what make menuconfig (for example ...) actually sets up.
Various distros, then, will capture the particular .config that they used to build their systems, and provide it to you somewhere under some (non-hidden) name. Distros are not, as far as I know, consistent on this.
Any "configuration files" that you may find in /boot are not going to be related to this, I think. They will be something to do with the boot-loader sequence, and yes, they might well be an important something.
Incidentally, if you are ever doing any sort of "kernel twiddling," it is very important that you are aware of the existence of that hidden file, and that you take steps to make safe, restorable, individual copies of it "somewhere else." Keep every version of it, distinctly, so that you can (among other things ...) diff them to detect and enumerate changes. (So that, "What the did I do?!" now has a definite answer, as does, "OMG, just get me back to where I was!")
If you can't find the config file in a distro, most kernels are configured to have a compressed list of the kernel options inbuilt. You can see that list with
Code:
zcat /proc/config.gz
I was not able to find anything similar to this compressed file on my Linux Mint-12 workstation. This is not a problem because the config details are found in /boot. Clearly, kernel building has a distro-specific process. Otherwise, every distro would include the compressed config details as well as information on disk.
...
Incidentally, if you are ever doing any sort of "kernel twiddling," it is very important that you are aware of the existence of that hidden file, and that you take steps to make safe, restorable, individual copies of it "somewhere else." Keep every version of it, distinctly, so that you can (among other things ...) diff them to detect and enumerate changes. (So that, "What the did I do?!" now has a definite answer, as does, "OMG, just get me back to where I was!")
I'm confused but not surprised by the lack of consistency among the various distro's. Given the emphasis on the ability to inspect the details of linux software, every distro-shipped bootable kernel should supply its configuration details in an obvious place -- for end-user inspection.
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,680
Rep:
Quote:
Originally Posted by sundialsvcs
When a Linux kernel is built from source, a hidden file called .config (note the leading ".") will be found in the source-directory. This is what make menuconfig (for example ...) actually sets up.
Various distros, then, will capture the particular .config that they used to build their systems, and provide it to you somewhere under some (non-hidden) name. Distros are not, as far as I know, consistent on this.
Any "configuration files" that you may find in /boot are not going to be related to this, I think.
The guide I use for compiling my own kernels here seems to take it that "/boot/config-`uname -r`" is the running kernel's config. I've used the guide and can confirm it as, at least, a usable base config to start from. Obviously distro's other then Debian may be different.
Using back-quotes or back-ticks executes the enclosed string as a command and replaces the string and ticks with the output from that command. In all sorts of places, these back-tick characters vanish in print.
There is an alternate syntax within the bash shell.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.