LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Can I somehow use an old config to compile a new kernel? (with a few additions) (https://www.linuxquestions.org/questions/linux-software-2/can-i-somehow-use-an-old-config-to-compile-a-new-kernel-with-a-few-additions-544600/)

r00tb33r 04-09-2007 02:24 PM

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?

weibullguy 04-09-2007 03:09 PM

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.

r00tb33r 04-09-2007 03:29 PM

A note to others:
DO NOT run "make mrproper" in your old kernel directory. That will erase your precious .config file.

studioj 04-09-2007 05:20 PM

many distributions give you a copy of the .config in the /boot directory for safe keeping

r00tb33r 04-09-2007 06:02 PM

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?

jlinkels 04-09-2007 09:42 PM

uhm... isn't the right command here:

'make oldconfig' ?

studioj 04-09-2007 10:20 PM

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

weibullguy 04-09-2007 10:29 PM

'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.


All times are GMT -5. The time now is 03:23 AM.