Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Installing two kernels
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
el muchacho
Tux's lil' helper
Tux's lil' helper


Joined: 26 Mar 2015
Posts: 77

PostPosted: Mon Jul 27, 2015 10:22 am    Post subject: Installing two kernels Reply with quote

Hi,

I have postponed the move to the 4.0 (hardened)kernel until now that it is in the stable tree but I'd need to make the move soon.

Is there a bit of guidance on how to install it in parallel so I can boot on both and have a fallback to the 3.6 ?

I've compiled kernels from scratches on blank installs but never done upgrades - and many tutorials I can see, are about compiling a kernel but don't mention how to keep the old one available too.

Also, how to i reuse my .config in the new kernel make menuconfig ? I remember there's a special "make" option which intelligently reuses previous options and then asks for any new features of the new kernel.

Thanks
H
Back to top
View user's profile Send private message
xaviermiller
Administrator
Administrator


Joined: 23 Jul 2004
Posts: 7972
Location: ~Brussels - Belgique

PostPosted: Mon Jul 27, 2015 10:34 am    Post subject: Reply with quote

Hi!

You can have as many kernel versions as you want ; just add as many entries in your boot loader (grub can do it for example).

To reuse a .config, copy it and do "make oldconfig". Then check manually that evertything is OK (make menuconfig). Sometimes, there are big breaks.
_________________
Kind regards,
Xavier Miller
Back to top
View user's profile Send private message
spikyatlinux
n00b
n00b


Joined: 18 Sep 2010
Posts: 29

PostPosted: Mon Jul 27, 2015 11:20 am    Post subject: Re: Installing two kernels Reply with quote

el muchacho wrote:
Hi,

I have postponed the move to the 4.0 (hardened)kernel until now that it is in the stable tree but I'd need to make the move soon.

Is there a bit of guidance on how to install it in parallel so I can boot on both and have a fallback to the 3.6 ?

I've compiled kernels from scratches on blank installs but never done upgrades - and many tutorials I can see, are about compiling a kernel but don't mention how to keep the old one available too.

Also, how to i reuse my .config in the new kernel make menuconfig ? I remember there's a special "make" option which intelligently reuses previous options and then asks for any new features of the new kernel.

Thanks
H


That´s easy,

if "emerge --depclean" shouldn´t remove kernels, you can do the following.

Create file /etc/portage/sets.conf
Code:
[kernels]

class = portage.sets.dbapi.OwnerSet
world-candidate = False
files = /usr/src


and file /var/lib/portage/world_sets
Code:
@kernels


If you want to remove kernel you have to add version to emerge command like so
Code:
emerge -aC sys-kernel/gentoo-sources-4.0.5



After building and installing your kernel run
Code:
grub-mkconfig -o /boot/grub/grub.cfg


Grub2 should autodetect your kernels in /boot so you can choose on boot which kernel you want to boot ;-)

Regards


Last edited by spikyatlinux on Mon Jul 27, 2015 11:36 am; edited 1 time in total
Back to top
View user's profile Send private message
mi_unixbird
Tux's lil' helper
Tux's lil' helper


Joined: 24 Jul 2015
Posts: 102

PostPosted: Mon Jul 27, 2015 11:32 am    Post subject: Reply with quote

Quote:
Is there a bit of guidance on how to install it in parallel so I can boot on both and have a fallback to the 3.6 ?


It's really simple, put both kernels in /boot, you can do ls /boot right now and you see the kernel images you have there, you may already have multiple. Linux kernels must start with the name "kernel-" or "vmlinuz-" apart from that it's fair game.

After you put the second kernel in boot under whatever name you like, if they are different versions this is done automatically by the kernel make install, if they have the same version the make install script will put your other kernel on "<kernel_name>.old".

Finally if you use grub2, you just edit the /boot/grub/grub.cnf file, search for the "menuentry" fields. There should be an entry that clearly looks like your old install, simply copy it and place it under the old one and change the filenames of the kernel to something appropriate.

It might happen that it doesn't go completely smoothly and the new kernel needs some extra parameteres to be ran, the make install script often informs you of when it does.
Back to top
View user's profile Send private message
el muchacho
Tux's lil' helper
Tux's lil' helper


Joined: 26 Mar 2015
Posts: 77

PostPosted: Mon Jul 27, 2015 3:08 pm    Post subject: Reply with quote

Cool, thanks everyone for the tips. 8)
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