LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 04-09-2007, 02:24 PM   #1
r00tb33r
Member
 
Registered: Feb 2007
Distribution: Vector
Posts: 318

Rep: Reputation: 31
Can I somehow use an old config to compile a new kernel? (with a few additions)


I have a nicely built kernel in my distro 2.6.18.5-i586, but I need to compile a 2.6.20 kernel with KVM support. I also want my kernel to be for AMD.
Can I somehow have the new kernel have the same configuration like the one that exists but with a few additions?
 
Old 04-09-2007, 03:09 PM   #2
weibullguy
ReliaFree Maintainer
 
Registered: Aug 2004
Location: Kalamazoo, Michigan
Distribution: Slackware-current, Cross Linux from Scratch, Gentoo
Posts: 2,701
Blog Entries: 1

Rep: Reputation: 219Reputation: 219Reputation: 219
Execute make mrproper in the new kernel source tree. Copy the .config file for the old kernel to the top of the source tree for the new kernel. When you execute make menuconfig, all the options from the old kernel will be selected. You can then add.subtract as you desire.

Last edited by weibullguy; 04-09-2007 at 03:31 PM.
 
Old 04-09-2007, 03:29 PM   #3
r00tb33r
Member
 
Registered: Feb 2007
Distribution: Vector
Posts: 318

Original Poster
Rep: Reputation: 31
A note to others:
DO NOT run "make mrproper" in your old kernel directory. That will erase your precious .config file.
 
Old 04-09-2007, 05:20 PM   #4
studioj
Member
 
Registered: Oct 2006
Posts: 460

Rep: Reputation: 31
many distributions give you a copy of the .config in the /boot directory for safe keeping
 
Old 04-09-2007, 06:02 PM   #5
r00tb33r
Member
 
Registered: Feb 2007
Distribution: Vector
Posts: 318

Original Poster
Rep: Reputation: 31
Quote:
Originally Posted by studioj
many distributions give you a copy of the .config in the /boot directory for safe keeping
True, but I did freak out for a few seconds.
...
Um... I'm getting a strange error here for "make install"
Code:
root:# make install
make: Warning: File `.vmlinux.cmd' has modification time 8e+03 s in the future
make[1]: Warning: File `arch/i386/boot/.vmlinux.bin.cmd' has modification time 8e+03 s in the future
sh /usr/src/linux-2.6.20.6/arch/i386/boot/install.sh 2.6.20.6 arch/i386/boot/bzImage System.map "/boot"
Warning: LBA32 addressing assumed
Fatal: open /dev/hda1: No such file or directory
make[1]: *** [install] Error 1
make: *** [install] Error 2
I don't have such partition, and never did. Why is it trying to write there?
All my partitions are on hdb, my linux partition is hdb2 (there was a windows hdb1 partition which was later removed)
How do I change the install path?
 
Old 04-09-2007, 09:42 PM   #6
jlinkels
Senior Member
 
Registered: Oct 2003
Location: Bonaire
Distribution: Debian Lenny/Squeeze/Wheezy/Sid
Posts: 4,053

Rep: Reputation: 484Reputation: 484Reputation: 484Reputation: 484Reputation: 484
uhm... isn't the right command here:

'make oldconfig' ?
 
Old 04-09-2007, 10:20 PM   #7
studioj
Member
 
Registered: Oct 2006
Posts: 460

Rep: Reputation: 31
i think just install by hand
** danger danger warning warning **
*** check paths and junk and use the version dfferent from anything else **
don't overwrite anything
cp arch/i386/boot/bzImage /boot/bzImage-KERNEL_VERSION
cp System.map /boot/System.map-KERNEL_VERSION
then modify boot loader and DONT take out reference to the old kernel so you can boot the old one should the new one fail
 
Old 04-09-2007, 10:29 PM   #8
weibullguy
ReliaFree Maintainer
 
Registered: Aug 2004
Location: Kalamazoo, Michigan
Distribution: Slackware-current, Cross Linux from Scratch, Gentoo
Posts: 2,701
Blog Entries: 1

Rep: Reputation: 219Reputation: 219Reputation: 219
'make oldconfig' first looks at .config to set configuration options. If it can't find an option in .config, then it looks in arch/<architecture>/defconfig. If it can't find the option there, then it will prompt. There's a good chance you'd still need to 'make config' or 'make menuconfig' or 'make xconfig' or etc. to change options.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
pull compile config out of running kernel zatar042 Linux - Kernel 1 07-08-2006 11:30 PM
how could i compile a kernel using the old config speel Slackware 11 07-04-2005 10:59 PM
Kernel compile isn't reading my .config file...? R00ts Debian 4 03-21-2005 07:46 PM
Need a SIMPLE CONFIG file for Kernel compile bongski55 Linux - Newbie 1 09-02-2003 08:54 AM
kernel compile with spec. config Sammy2ooo Linux - Newbie 3 07-03-2003 01:39 PM


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

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration