LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   2.6 Kernel compiling (https://www.linuxquestions.org/questions/slackware-14/2-6-kernel-compiling-394967/)

Anonymo 12-20-2005 02:20 PM

2.6 Kernel compiling
 
I was just able to installpkg the newest kernel from the slackware site and it works.

Is there a way to download the newest kernel from kernel.org and then, before compiling, have the the configuration be the same as the slackware kernel so that I can just compile it and everything be the same? I want the newest kernel, but don't want to wait until he updates it, but I don't want to manually choose the options and figure it out or else have the slackware options and then i could just change a few things.

How can I do this?

Keruskerfuerst 12-20-2005 02:23 PM

Find the kernelconfig file from the slackware kernel and try to use this file for the kernel from www.kernel.org.
But often the distributors do make changes to the source code.

Nylex 12-20-2005 02:23 PM

I believe you can use "make oldconfig" to do this. Have you looked at this thread? I found it to be a good guide when I compiled my first kernel :).

Anonymo 12-20-2005 02:28 PM

oh I need to do this

# cd /usr/include
# rm -rf asm* linux
# ln -s /usr/src/linux/include/linux
# ln -s /usr/src/linux/include/asm-i386
# ln -s asm-i386 asm
# ln -s /usr/src/linux/include/asm-generic

http://users.piuha.net/martti/comp/s...slackware.html

can i do this exact thing for 2.6 kernel or is it different

Anonymo 12-20-2005 02:30 PM

Code:

Then copy your existing .config to your new kernel source tree...
how is this done...?

Nylex 12-20-2005 02:35 PM

Quote:

Originally Posted by Anonymo
Code:

Then copy your existing .config to your new kernel source tree...
how is this done...?

Just copy the file named ".config" to /usr/src/linux. That's assuming that /usr/src/linux is a symlink to /usr/src/linux-2.6.x.x of course.

piete 12-21-2005 08:15 AM

Quote:

oh I need to do this

# cd /usr/include
# rm -rf asm* linux
# ln -s /usr/src/linux/include/linux
# ln -s /usr/src/linux/include/asm-i386
# ln -s asm-i386 asm
# ln -s /usr/src/linux/include/asm-generic
I don't think you need to do that for a kernel recompile. Infact, I would not recommend doing that at all!!

To copy your old config file and ressurect it in a new source directory:

Code:

~# cp /path/to/current-source/.config /path/to/new-source/.config
~# cd /path/to/new-source
~# make oldconfig

- Piete.

sweetnsourbkr 12-21-2005 09:22 AM

What does 'make oldconfig' do? Wouldn't it be better to go 'make menuconfig' review the newer options and then run make to compile?

Nylex 12-21-2005 09:37 AM

"make oldconfig" lets you use your old config, but you still have the option to add new options should you wish to. Come to think of it, I'm wondering why I didn't use it last time I compiled a kernel on Slack as "make menuconfig" meant having to configure from scratch.

sweetnsourbkr 12-21-2005 10:21 AM

Interesting. I should try 'make oldconfig' next time. I always use 'make menuconfig' and load a saved config file under a different filename.

Anonymo 12-21-2005 11:32 AM

Quote:

Originally Posted by piete
I don't think you need to do that for a kernel recompile. Infact, I would not recommend doing that at all!!


- Piete.

But the author recommends doing this in on his website

http://users.piuha.net/martti/comp/s...slackware.html

But this is for the 2.4 kernel. So it doesn't have to be done for the 2.6 kernel?

sweetnsourbkr 12-21-2005 11:36 AM

Not sure why he even does that. In slackbook.org, the process is pretty simple.

phil.d.g 12-21-2005 01:55 PM

Quote:

Originally Posted by Nylex
"make oldconfig" lets you use your old config, but you still have the option to add new options should you wish to. Come to think of it, I'm wondering why I didn't use it last time I compiled a kernel on Slack as "make menuconfig" meant having to configure from scratch.

make menuconfig doesn't start from scratch if you have copied your .config file to the root of the new source tree, it uses the values already set in the .config file and allows you to set/unset all of the options including the new ones

Nylex 12-21-2005 02:00 PM

Quote:

Originally Posted by phil.d.g
make menuconfig doesn't start from scratch if you have copied your .config file to the root of the new source tree, it uses the values already set in the .config file and allows you to set/unset all of the options including the new ones

Lol, thanks :). I wish I'd known that before!

richcoosa19 12-22-2005 06:53 AM

Ok, everyone here has touched on multiple parts of how to do this but not tied it all together. This is exactly what I am about to attempt in this post. If there is anything that I'm leaving out please add a reply appending to this. Here goes:

1) download your new kernel from kernel.org
2) untar to your /usr/src:
a) cd /usr/src
b) tar jxvf /path/to/your/kernel.tar.bz2
3) cd linux-2.6(your new kernel tree)
4) make mrproper (do some precompiling stuff)
5) copy over your original .config file from your old kernel and setup your make files to regenerate your new kernel from your old kernel's config:
a) cp /usr/src/linux/.config .
b) make oldconfig
6) make bzImage; make modules (compile your bzImage and modules - time consuming)
7) make modules_install (install your modules in your kernel tree)
8) cp arch/i386/boot/bzImage /boot/linux-(your new kernel version)
9) edit your /etc/lilo.conf to accommodate. your new kernel and change it to default by adding the Default = (whatever you labeled your new kernel).
a) you may want to add the option "timeout = 150" and "prompt = yes" to your lilo.conf to make sure you can boot your old kernel at lilo boot incase your new kernel fails
b) run "lilo" as root to reinstall lilo to your mbr
10) reboot and see if everything works!


All times are GMT -5. The time now is 12:41 PM.