LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 08-10-2013, 08:44 PM   #1
SaintDanBert
Senior Member
 
Registered: Jan 2009
Location: "North Shore" Louisiana USA
Distribution: Mint-20.1 with Cinnamon
Posts: 1,772
Blog Entries: 3

Rep: Reputation: 108Reputation: 108
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.

Merci d'avance,
~~~ 0;-Dan
 
Old 08-10-2013, 09:46 PM   #2
GlennsPref
Senior Member
 
Registered: Apr 2004
Location: Brisbane, Australia
Distribution: Devuan
Posts: 3,657
Blog Entries: 33

Rep: Reputation: 283Reputation: 283Reputation: 283
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)

usually in
/usr/src/linux/

Hope this gives you a start.

Regards Glenn.

ps, I'm still learning.
 
Old 08-12-2013, 05:00 PM   #3
SaintDanBert
Senior Member
 
Registered: Jan 2009
Location: "North Shore" Louisiana USA
Distribution: Mint-20.1 with Cinnamon
Posts: 1,772

Original Poster
Blog Entries: 3

Rep: Reputation: 108Reputation: 108
I find the following:
Code:
prompt$ ls -lh /boot

...
-rw-r--r-- 1 root root 132K 2012-03-08 19:17 config-3.0.0-17-generic
-rw-r--r-- 1 root root 132K 2012-04-19 18:28 config-3.0.0-19-generic
-rw-r--r-- 1 root root 132K 2012-06-12 13:34 config-3.0.0-22-generic
-rw-r--r-- 1 root root 132K 2013-03-21 11:48 config-3.0.0-32-generic
...
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.


Merci D'avance,
~~~ 8d;-Dan
 
Old 08-12-2013, 06:51 PM   #4
GlennsPref
Senior Member
 
Registered: Apr 2004
Location: Brisbane, Australia
Distribution: Devuan
Posts: 3,657
Blog Entries: 33

Rep: Reputation: 283Reputation: 283Reputation: 283
check this out...

a review of the kernel rebuild guide
http://www.csee.umbc.edu/~kalpakis/c...nuxReviews.pdf
page 7. :-)

Last edited by GlennsPref; 08-12-2013 at 06:52 PM. Reason: Page 7 has some answers
 
1 members found this post helpful.
Old 08-12-2013, 08:14 PM   #5
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
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
 
2 members found this post helpful.
Old 08-15-2013, 09:32 AM   #6
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,673
Blog Entries: 4

Rep: Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945
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!")
 
1 members found this post helpful.
Old 08-16-2013, 01:49 PM   #7
SaintDanBert
Senior Member
 
Registered: Jan 2009
Location: "North Shore" Louisiana USA
Distribution: Mint-20.1 with Cinnamon
Posts: 1,772

Original Poster
Blog Entries: 3

Rep: Reputation: 108Reputation: 108
Quote:
Originally Posted by TobiSGD View Post
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.

Cordialement,
~~~ 8d;-Dan
 
Old 08-16-2013, 01:57 PM   #8
SaintDanBert
Senior Member
 
Registered: Jan 2009
Location: "North Shore" Louisiana USA
Distribution: Mint-20.1 with Cinnamon
Posts: 1,772

Original Poster
Blog Entries: 3

Rep: Reputation: 108Reputation: 108
Quote:
Originally Posted by sundialsvcs View Post
...
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.

Cordialement,
~~~ 8d;-Dan
 
Old 08-16-2013, 02:06 PM   #9
SaintDanBert
Senior Member
 
Registered: Jan 2009
Location: "North Shore" Louisiana USA
Distribution: Mint-20.1 with Cinnamon
Posts: 1,772

Original Poster
Blog Entries: 3

Rep: Reputation: 108Reputation: 108
Quote:
Originally Posted by GlennsPref View Post
check this out...

a review of the kernel rebuild guide
http://www.csee.umbc.edu/~kalpakis/c...nuxReviews.pdf
page 7. :-)
This is a great guide, however it speaks of the 2.4 and 2.6 family of kernel editions. I have no idea how well it applies to 3.x editions.

Cordialement,
~~~ 8d;-Dan
 
Old 08-16-2013, 02:32 PM   #10
273
LQ Addict
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,680

Rep: Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373
Quote:
Originally Posted by sundialsvcs View Post
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.
 
1 members found this post helpful.
Old 08-16-2013, 04:00 PM   #11
SaintDanBert
Senior Member
 
Registered: Jan 2009
Location: "North Shore" Louisiana USA
Distribution: Mint-20.1 with Cinnamon
Posts: 1,772

Original Poster
Blog Entries: 3

Rep: Reputation: 108Reputation: 108
Quote:
Originally Posted by 273 View Post
...
"/boot/config-`uname -r`"
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.
Code:
prompt$ ls -lh /boot/config-`uname -r`
-rw-r--r-- 1 root root 132K 2012-06-12 13:34 /boot/config-3.0.0-22-generic

prompt$ ls -lh /boot/config-$(uname -r)
-rw-r--r-- 1 root root 132K 2012-06-12 13:34 /boot/config-3.0.0-22-generic
It does exactly the same thing, is much more visible, and seldom gets lost in print.

Cheers,
~~~ 8d;-Dan
 
1 members found this post helpful.
Old 08-16-2013, 04:07 PM   #12
273
LQ Addict
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,680

Rep: Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373
Thanks SaintDanBert, I'm not keen on backticks myself as they're tricky so that could be a great help to me in future.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to change config settings and build Kernel with bitbake? leiphasw Linux - Software 1 01-20-2011 03:51 AM
can I retrieve config kernel settings after make mrproper? mac1234mac Linux - Kernel 3 05-13-2006 08:28 AM
getting default kernel config dunkyb Linux - Software 3 01-08-2005 07:09 PM
Default kernel config pioter Slackware 3 11-19-2003 07:49 PM
default kernel config bLaX Linux - Newbie 6 11-06-2002 08:10 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 11:22 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration