Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
How can I get the running kernel's .config
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
serrix
n00b
n00b


Joined: 23 Nov 2007
Posts: 23

PostPosted: Wed Nov 28, 2007 3:09 am    Post subject: How can I get the running kernel's .config Reply with quote

Hi there,
I oh so cleverly cleaned my /usr/src/linux/ dir, so I dont have my last built config.
I also don't have .config support enabled in the old kernel - how can i recompile my new kernel with the old config?

Thanks in advance,
Cheers,
Serrix
Back to top
View user's profile Send private message
d2_racing
Bodhisattva
Bodhisattva


Joined: 25 Apr 2005
Posts: 13047
Location: Ste-Foy,Canada

PostPosted: Wed Nov 28, 2007 3:41 am    Post subject: Reply with quote

I think that you cannot...sorry :(
Back to top
View user's profile Send private message
CooSee
Veteran
Veteran


Joined: 20 Nov 2004
Posts: 1507
Location: Earth

PostPosted: Wed Nov 28, 2007 3:46 am    Post subject: Re: How can I get the running kernel's .config Reply with quote

serrix wrote:
Hi there,
I oh so cleverly cleaned my /usr/src/linux/ dir, so I dont have my last built config.
I also don't have .config support enabled in the old kernel - how can i recompile my new kernel with the old config?

Thanks in advance,
Cheers,
Serrix


hallo,

mount /dev/YOUR_BOOT_DEVICE /boot

and you see something like this ' config-2.6.22-gentoo-r10 ' 8O

just copy the ' config-2.6.22-gentoo-r10 ' to /usr/src/linux/.config


CooSee ' Ya
_________________
" Die Realität ist eine Illusion, die durch Mangel an ehrlicher Kommunikation entsteht "
---
" Der Mensch ist von Natur aus neugierig, was am Ende übrig bleibt ist die Gier "
Back to top
View user's profile Send private message
d2_racing
Bodhisattva
Bodhisattva


Joined: 25 Apr 2005
Posts: 13047
Location: Ste-Foy,Canada

PostPosted: Wed Nov 28, 2007 3:48 am    Post subject: Reply with quote

Since he use make menuconfig, maybe he doesn't copy is .config in /boot.

This .config doesn't appear by magic in /boot for my concern when you compile your kernel.
Back to top
View user's profile Send private message
serrix
n00b
n00b


Joined: 23 Nov 2007
Posts: 23

PostPosted: Wed Nov 28, 2007 3:57 am    Post subject: Reply with quote

Your right, all i have in /boot/ is the kernel (bzImage) itself...
Any other ideas? Thanks for the ones already given too.
Back to top
View user's profile Send private message
serrix
n00b
n00b


Joined: 23 Nov 2007
Posts: 23

PostPosted: Wed Nov 28, 2007 4:08 am    Post subject: Reply with quote

hmmm, it SEEMS to have worked, just by loading the old kernel and doing a make oldconfig from /usr/src/linux.

Thanks for your help, i'll let you know if i'm wrong and it didn't work but so far it looks good :)
Back to top
View user's profile Send private message
serrix
n00b
n00b


Joined: 23 Nov 2007
Posts: 23

PostPosted: Wed Nov 28, 2007 4:11 am    Post subject: Reply with quote

Yep, i was wrong :(
Back to top
View user's profile Send private message
serrix
n00b
n00b


Joined: 23 Nov 2007
Posts: 23

PostPosted: Wed Nov 28, 2007 5:53 am    Post subject: Reply with quote

Thanks for your help, i've re-done my kernel manually.
Cheers,
Serrix
Back to top
View user's profile Send private message
d2_racing
Bodhisattva
Bodhisattva


Joined: 25 Apr 2005
Posts: 13047
Location: Ste-Foy,Canada

PostPosted: Wed Nov 28, 2007 11:53 am    Post subject: Reply with quote

And after doing it, you make a copy in /boot, like config-2.6.22-gentoo-r8.config

With that, you will have a copy of your .config.
Back to top
View user's profile Send private message
neiljw
Apprentice
Apprentice


Joined: 12 Nov 2007
Posts: 166
Location: Telford, UK

PostPosted: Wed Nov 28, 2007 4:38 pm    Post subject: Reply with quote

d2_racing wrote:
Since he use make menuconfig, maybe he doesn't copy is .config in /boot.

This .config doesn't appear by magic in /boot for my concern when you compile your kernel.


It does if you use make install. :P

I find the best command to update the kernel is:
Code:
make && make modules_install install

_________________
Be lucky,

Neil
Back to top
View user's profile Send private message
d2_racing
Bodhisattva
Bodhisattva


Joined: 25 Apr 2005
Posts: 13047
Location: Ste-Foy,Canada

PostPosted: Wed Nov 28, 2007 5:22 pm    Post subject: Reply with quote

the command :

Code:

make && make modules_install install


Will create a generique bzImage I think...So for my concern, I prefer to use kernel-2.6.22-gentoo-r8 as the name for my bzImage for exemple.

Maybe I'm wrong...
Back to top
View user's profile Send private message
neiljw
Apprentice
Apprentice


Joined: 12 Nov 2007
Posts: 166
Location: Telford, UK

PostPosted: Wed Nov 28, 2007 5:25 pm    Post subject: Reply with quote

d2_racing wrote:
the command :

Code:

make && make modules_install install


Will create a generique bzImage I think...So for my concern, I prefer to use kernel-2.6.22-gentoo-r8 as the name for my bzImage for exemple.

Maybe I'm wrong...


You are wrong.

Just in case you still have doubts, here's my /boot:
Code:
file:///boot/dos
file:///boot/grub
file:///boot/lost+found
file:///boot/config
file:///boot/config-2.6.22-gentoo-r5
file:///boot/config-2.6.22-gentoo-r6
file:///boot/config-2.6.22-gentoo-r6.old
file:///boot/config-2.6.22-gentoo-r7
file:///boot/config-2.6.22-gentoo-r7.old
file:///boot/config-2.6.22-gentoo-r8
file:///boot/config-2.6.22-gentoo-r8.old
file:///boot/config-2.6.23-gentoo
file:///boot/config-2.6.23-gentoo-r1
file:///boot/config-2.6.23-gentoo-r1.old
file:///boot/config-2.6.23-gentoo-r2
file:///boot/config-2.6.23-gentoo-r3
file:///boot/config-2.6.24-rc3-zen3
file:///boot/config.old
file:///boot/fbsplash-emergence
file:///boot/fbsplash-livecd
file:///boot/System.map
file:///boot/System.map-2.6.22-gentoo-r5
file:///boot/System.map-2.6.22-gentoo-r6
file:///boot/System.map-2.6.22-gentoo-r6.old
file:///boot/System.map-2.6.22-gentoo-r7
file:///boot/System.map-2.6.22-gentoo-r7.old
file:///boot/System.map-2.6.22-gentoo-r8
file:///boot/System.map-2.6.22-gentoo-r8.old
file:///boot/System.map-2.6.23-gentoo
file:///boot/System.map-2.6.23-gentoo-r1
file:///boot/System.map-2.6.23-gentoo-r1.old
file:///boot/System.map-2.6.23-gentoo-r2
file:///boot/System.map-2.6.23-gentoo-r3
file:///boot/System.map-2.6.24-rc3-zen3
file:///boot/System.map.old
file:///boot/vmlinuz
file:///boot/vmlinuz-2.6.22-gentoo-r5
file:///boot/vmlinuz-2.6.22-gentoo-r6
file:///boot/vmlinuz-2.6.22-gentoo-r6.old
file:///boot/vmlinuz-2.6.22-gentoo-r7
file:///boot/vmlinuz-2.6.22-gentoo-r7.old
file:///boot/vmlinuz-2.6.22-gentoo-r8
file:///boot/vmlinuz-2.6.22-gentoo-r8.old
file:///boot/vmlinuz-2.6.23-gentoo
file:///boot/vmlinuz-2.6.23-gentoo-r1
file:///boot/vmlinuz-2.6.23-gentoo-r1.old
file:///boot/vmlinuz-2.6.23-gentoo-r2
file:///boot/vmlinuz-2.6.23-gentoo-r3
file:///boot/vmlinuz-2.6.24-rc3-zen3
file:///boot/vmlinuz.old


The "vmlinuz" and "vmlinuz.old" are symlinks to the current and previous kernels.
_________________
Be lucky,

Neil
Back to top
View user's profile Send private message
your_WooDness
Tux's lil' helper
Tux's lil' helper


Joined: 25 Oct 2007
Posts: 77

PostPosted: Wed Nov 28, 2007 5:34 pm    Post subject: Reply with quote

Hi,

you can also use the file /proc/config.gz. This should be your running kernel's config. gunzip it, alter the access rights if needed and copy it to /usr/src/linux/
Back to top
View user's profile Send private message
CooSee
Veteran
Veteran


Joined: 20 Nov 2004
Posts: 1507
Location: Earth

PostPosted: Wed Nov 28, 2007 9:24 pm    Post subject: Reply with quote

hallo,

i always do :

make && make modules_install && cp arch/i386/boot/bzImage /boot/vmlinuz-2.6.22-gentoo-r10-2 && cp .config /boot/config-2.6.22-gentoo-r10-2

when compile the kernel

CooSee ' Ya
_________________
" Die Realität ist eine Illusion, die durch Mangel an ehrlicher Kommunikation entsteht "
---
" Der Mensch ist von Natur aus neugierig, was am Ende übrig bleibt ist die Gier "
Back to top
View user's profile Send private message
neiljw
Apprentice
Apprentice


Joined: 12 Nov 2007
Posts: 166
Location: Telford, UK

PostPosted: Wed Nov 28, 2007 11:12 pm    Post subject: Reply with quote

CooSee wrote:
hallo,

i always do :

make && make modules_install && cp arch/i386/boot/bzImage /boot/vmlinuz-2.6.22-gentoo-r10-2 && cp .config /boot/config-2.6.22-gentoo-r10-2

when compile the kernel

CooSee ' Ya


Why when you have to change that for every different kernel AND edit /boot/grub/grub.conf.? Also, your old kernel gets overwritten if you are simply modifying the existing kernel - which can be a real pain if it fails to boot. Give me make install anyday. It handles the lot for you.
_________________
Be lucky,

Neil
Back to top
View user's profile Send private message
CooSee
Veteran
Veteran


Joined: 20 Nov 2004
Posts: 1507
Location: Earth

PostPosted: Wed Nov 28, 2007 11:21 pm    Post subject: Reply with quote

neiljw wrote:
CooSee wrote:
hallo,

i always do :

make && make modules_install && cp arch/i386/boot/bzImage /boot/vmlinuz-2.6.22-gentoo-r10-2 && cp .config /boot/config-2.6.22-gentoo-r10-2

when compile the kernel

CooSee ' Ya


Why when you have to change that for every different kernel AND edit /boot/grub/grub.conf.? Also, your old kernel gets overwritten if you are simply modifying the existing kernel - which can be a real pain if it fails to boot. Give me make install anyday. It handles the lot for you.


hallo,

i forgot to write, that i always took different names for the kernel that i compile ( in the Makefile too ), like ' 2.6.22-gentoo-r10 ' ,

' 2.6.22-gentoo-r10-1 ' and so on...

thats because i try different Kernel, like ' zen-sources ' and many others

sorry for my bad english :roll:


CooSee ' Ya
_________________
" Die Realität ist eine Illusion, die durch Mangel an ehrlicher Kommunikation entsteht "
---
" Der Mensch ist von Natur aus neugierig, was am Ende übrig bleibt ist die Gier "
Back to top
View user's profile Send private message
neiljw
Apprentice
Apprentice


Joined: 12 Nov 2007
Posts: 166
Location: Telford, UK

PostPosted: Wed Nov 28, 2007 11:59 pm    Post subject: Reply with quote

CooSee wrote:
i forgot to write, that i always took different names for the kernel that i compile ( in the Makefile too ), like ' 2.6.22-gentoo-r10 ' ,

' 2.6.22-gentoo-r10-1 ' and so on...


Precisely the reason to let "make install" do it and save yourself a lot of typing and possible typos.

Quote:
thats because i try different Kernel, like ' zen-sources ' and many others


Take another look at my /boot listing above. Apart from frequent updates to gentoo-sources, you will see zen-sources in there too. (Ouch, I didn't want to remember zen-sources - they broke my computer. :()

Quote:
sorry for my bad english :roll:


There is plenty of worse English around and some of it from native English speakers. ;)
_________________
Be lucky,

Neil
Back to top
View user's profile Send private message
d2_racing
Bodhisattva
Bodhisattva


Joined: 25 Apr 2005
Posts: 13047
Location: Ste-Foy,Canada

PostPosted: Thu Nov 29, 2007 1:57 am    Post subject: Reply with quote

Yeah Neiljw, you are right.

When I compile my box I use this :

Code:

cp arch/i386/boot/bzImage /boot/kernel-2.6.xx-gentoo-rx && cp .config /boot/config-2.6.xx-gentoo-rx-.config && cp System.map /boot

Add an entry in /boot/grub/grub.conf to test something and after that I make some clean up.
Back to top
View user's profile Send private message
Anarcho
Advocate
Advocate


Joined: 06 Jun 2004
Posts: 2970
Location: Germany

PostPosted: Fri Nov 30, 2007 1:33 pm    Post subject: Reply with quote

Code:
zcat /proc/config.gz > /usr/src/linux/.config

_________________
...it's only Rock'n'Roll, but I like it!
Back to top
View user's profile Send private message
Mantaar
Apprentice
Apprentice


Joined: 17 May 2007
Posts: 219

PostPosted: Fri Nov 30, 2007 1:49 pm    Post subject: Reply with quote

Anarcho wrote:
Code:
zcat /proc/config.gz > /usr/src/linux/.config

That will only work if you have kernel-config file support compiled into the kernel itself. The option is

Code:

  │ Symbol: IKCONFIG [=y]                                                                     
  │ Prompt: Kernel .config support                                                           
  │   Defined at init/Kconfig:237                                                             
  │   Location:                                                                               
  │     -> General setup                                                                     


You should generally say 'yes' here as it does not cost too much and it will probably save you a hell of a lot of time in case you loose your original .config
_________________
Error compiling committee.c: too many arguments to function.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum