View previous topic :: View next topic |
Author |
Message |
shallpion Guru
Joined: 29 Sep 2008 Posts: 331
|
Posted: Sat Dec 05, 2009 10:13 am Post subject: how to generate .config file from a running kernel? |
|
|
A dump question.. assume I am running a machine but I don't have the .config file from which the kernel has been compiled. Is there any way I can generate that file from the running kernel? Thanks. |
|
Back to top |
|
|
sebv Tux's lil' helper
Joined: 14 Jan 2005 Posts: 78 Location: Savoie (France)
|
Posted: Sat Dec 05, 2009 10:24 am Post subject: |
|
|
If your kernel was compiled with
Code: | CONFIG_IKCONFIG=y
CONFIG_IKCONFIG_PROC=y |
you can get the config file of this kernel with
Code: | zcat /proc/config.gz |
Under Gentoo you also have http://www.gentoo.org/doc/fr/genkernel.xml, but it didn't made exactly the same kernel as the one is running. _________________ -La théorie, c'est quand on sait tout et que rien ne fonctionne. La pratique, c'est quand tout fonctionne et que personne ne sait pourquoi.
-Définissez-moi d'abord ce que vous entendez par Dieu et je vous dirai si j'y crois.
[Einstein] |
|
Back to top |
|
|
ronmon Veteran
Joined: 15 Apr 2002 Posts: 1043 Location: Key West, FL
|
Posted: Sat Dec 05, 2009 10:28 am Post subject: |
|
|
First, check for the file "/proc/config.gz". If that isn't there, look in any kernel source tree for the extract-ikconfig script.
/usr/src/linux/scripts/extract-ikconfig
That will pull the config from a bzImage. _________________ Ask Questions the Smart Way - by ESR |
|
Back to top |
|
|
shallpion Guru
Joined: 29 Sep 2008 Posts: 331
|
Posted: Sat Dec 05, 2009 11:37 am Post subject: |
|
|
That is very helpful. Thank you guys |
|
Back to top |
|
|
Cripplys n00b
Joined: 04 May 2011 Posts: 9
|
Posted: Sun Jan 20, 2013 12:20 am Post subject: |
|
|
Hi guys,
i tried extract-ikconfig on bzImage, but it didn't work. Script ended with this error : extract-ikconfig: Cannot find kernel config.
Could you please help me with this? I've lost previous kernel config by unmerging gentoo-sources - it was accident. |
|
Back to top |
|
|
VoidMage Watchman
Joined: 14 Oct 2006 Posts: 6196
|
Posted: Sun Jan 20, 2013 1:38 am Post subject: |
|
|
While I haven't used extract-ikconfig, I strongly suspect it works only on kernels built with CONFIG_IKCONFIG.
Also, unless I'm missing something, a simple unmerge shouldn't have removed the old config - not unless you've removed the old kernel directory too. |
|
Back to top |
|
|
Cripplys n00b
Joined: 04 May 2011 Posts: 9
|
Posted: Wed Jan 23, 2013 12:10 pm Post subject: |
|
|
Well, I run "emerge --depclean" and it deleted the directory too. So now I'm trying the find a solution that helps me get back config from bzImage. But as i said, extract-ikconfig doesn't work...I think there must be some solution, but i don't know it. |
|
Back to top |
|
|
|