Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Recomple kernel with new options w/o ruining everything
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
javacrypto
n00b
n00b


Joined: 22 Oct 2002
Posts: 16

PostPosted: Wed Aug 27, 2003 5:22 am    Post subject: Recomple kernel with new options w/o ruining everything Reply with quote

Hi

When I was installing Gentoo, I had some hardware problems, and while I was trying to troubleshoot them, I set the kernel CPU option to 486 instead of AMD K6-2. Well, I fixed the hardware problem, but now I am running a 486 kernel on a K6-2, which is probably slowing it down.

I want to recompile the kernel for the AMD, but I don't want to lose what I already have, because it runs, and I don't want to break it. The reason I am cautious is that last time I tried this, the "make clean" step deleted all my drivers and the sound stopped working, and then the compile failed and I never got it working again. That was a year or so ago, and right after that happened, I dumped Gentoo for some other distro. But now I'm back, and I want to do it right.

It looks like I should copy:

/usr/src/linux-2.4.20-gentoo-rc5

to:

/usr/src/linux-2.4.20-gentoo-rc5-AMDK6

Then I should change the /usr/src/linux symlink to point to the new directory. After that, I should be able to run genkernel --config and do some experimenting.

So, would that work?

Thanks.

Chris
Back to top
View user's profile Send private message
rommel
Veteran
Veteran


Joined: 19 Apr 2002
Posts: 1145
Location: Williamsburg Virginia

PostPosted: Wed Aug 27, 2003 5:46 am    Post subject: Reply with quote

well first off ... get over it... kernel compilation is something you should get real familiar with.

Code:
#cd /usr/src/linux #cp .config ../ #make mrproper #cp ../.config ../linux #make menuconfig


change your processor and then
Code:
#make dep && make clean bzImage modules modules_install


after the kernel has compiled
Code:
#mount /boot #mv /boot/bzImage /boot/bzImage.old #cp arch/i386/boot/bzImage /boot


emerge anything like alsa or nvidia-kernel now that needs to build against the kernel adn install to /lib/modules/2.x.x-whateveryourun
Back to top
View user's profile Send private message
UncleTom
Apprentice
Apprentice


Joined: 20 Aug 2003
Posts: 194
Location: Bern, Switzerland

PostPosted: Wed Aug 27, 2003 2:45 pm    Post subject: Reply with quote

You don't need to copy /usr/src/linux-2.4.20-gentoo-rc5, just do a
Code:

cd /usr/src/linux
make menuconfig
make dep && make clean bzImage modules modules_install

I haven't used genkernel, so I can't help you with that, sorry.

rommel suggested to copy your current .config file for safety and I agree with that. Personally, I keep a copy of the .config file together with the bzImage in /boot. I also give these files a name and a number, so I usually have something like bzImage-gentoo-2.4.20#1 together with a config-gentoo-2.4.20#1, then come ...#2, ...#3 and so on.

In your case, #1 would be your 486 kernel and #2 the new AMD kernel.

That way, I can always go back to a previous kernel if I do something really stupid and the kernel won't boot. grub makes this especially easy.
_________________
bug, n: A son of a glitch.
Back to top
View user's profile Send private message
javacrypto
n00b
n00b


Joined: 22 Oct 2002
Posts: 16

PostPosted: Thu Aug 28, 2003 5:56 am    Post subject: Reply with quote

I poked around long enough and found what I was looking for.

Apparently, the Makefile has a line called EXTRAVERSION. Right now, this line says:

Code:
gentoo-r5


I could change this to something like:

Code:
gentoo-r5-AMD


and compile as normally, and it should make a whole new tree in /lib/modules, so my current drivers don't get lost when the new kernal compiles.

I'll try this out.

Chris
Back to top
View user's profile Send private message
javacrypto
n00b
n00b


Joined: 22 Oct 2002
Posts: 16

PostPosted: Fri Aug 29, 2003 1:34 pm    Post subject: Reply with quote

I took a close look at the genkernel script and found that it places its compiled files into the folder where the /usr/src/linux link is located, and it would also put the modules in /lib/modules/KERNEL-VERSION.

To stop genkernel from messing with the current installation, I renamed the directory from:

/usr/src/linux-2.4.20-gentoo-r5

to:

/usr/src/linux-2.4.20-gentoo-r5-AMD

Then I fixed the /usr/src/linux link to point to the newly-renamed location. I also changed the line in the Makefile to read:

EXTRAVERSION="gentoo-r5-AMD"

Then I used genkernel as normal. Everything worked fine. The old modules were left alone in case something went horribly wrong. New modules were created. I changed the grub menu to point to the new kernel and rebooted, and it worked with no problems.

As a bonus, the NVidia drivers started working!

Thanks for the help.

Chris
Back to top
View user's profile Send private message
javacrypto
n00b
n00b


Joined: 22 Oct 2002
Posts: 16

PostPosted: Fri Aug 29, 2003 1:34 pm    Post subject: Reply with quote

I took a close look at the genkernel script and found that it places its compiled files into the folder where the /usr/src/linux link is located, and it would also put the modules in /lib/modules/KERNEL-VERSION.

To stop genkernel from messing with the current installation, I renamed the directory from:

/usr/src/linux-2.4.20-gentoo-r5

to:

/usr/src/linux-2.4.20-gentoo-r5-AMD

Then I fixed the /usr/src/linux link to point to the newly-renamed location. I also changed the line in the Makefile to read:

EXTRAVERSION="gentoo-r5-AMD"

Then I used genkernel as normal. Everything worked fine. The old modules were left alone in case something went horribly wrong. New modules were created. I changed the grub menu to point to the new kernel and rebooted, and it worked with no problems.

As a bonus, the NVidia drivers started working!

Thanks for the help.

Chris
Back to top
View user's profile Send private message
javacrypto
n00b
n00b


Joined: 22 Oct 2002
Posts: 16

PostPosted: Fri Aug 29, 2003 1:36 pm    Post subject: Reply with quote

I took a close look at the genkernel script and found that it places its compiled files into the folder where the /usr/src/linux link is located, and it would also put the modules in /lib/modules/KERNEL-VERSION.

To stop genkernel from messing with the current installation, I renamed the directory from:

/usr/src/linux-2.4.20-gentoo-r5

to:

/usr/src/linux-2.4.20-gentoo-r5-AMD

Then I fixed the /usr/src/linux link to point to the newly-renamed location. I also changed the line in the Makefile to read:

EXTRAVERSION="gentoo-r5-AMD"

Then I used genkernel as normal. Everything worked fine. The old modules were left alone in case something went horribly wrong. New modules were created. I changed the grub menu to point to the new kernel and rebooted, and it worked with no problems.

As a bonus, the NVidia drivers started working!

Thanks for the help.

Chris
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo 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