Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Good method for quick kernel upgrades.
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
finalturismo
Apprentice
Apprentice


Joined: 06 Jan 2020
Posts: 243

PostPosted: Sat Apr 03, 2021 4:55 pm    Post subject: Good method for quick kernel upgrades. Reply with quote

Here is a good video tutorial for doing a Kernel upgrade on Gentoo. I like how Genkernel and the menuconfig options are used together for doing a quick upgrade.
https://www.youtube.com/watch?v=Tn8U4yItx2s&t=1507s&ab_channel=FIXAPC
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 49138
Location: 56N 3W

PostPosted: Sat Apr 03, 2021 6:04 pm    Post subject: Reply with quote

Moved from Kernel & Hardware to Documentation, Tips & Tricks.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
mustafasalih1993
n00b
n00b


Joined: 09 Feb 2021
Posts: 39

PostPosted: Sat Apr 03, 2021 8:32 pm    Post subject: Reply with quote

nice video :)
in case it will be useful for whoever search for this in the future
i upgrade the kernel with the following (i don't use initramfs):
Code:
su
eselect kernel list
eselect kernel set $new kernel
cd /usr/src/linux/
cp ../$old-kernel-dir/.config .
make olddefconfig
make modules_prepare
make -j8
make -j8 modules_install
make install
emerge -av @module-rebuild
grub-mkconfig -o /boot/grub/grub.cfg
Back to top
View user's profile Send private message
Naib
Watchman
Watchman


Joined: 21 May 2004
Posts: 5965
Location: Removed by Neddy

PostPosted: Sat Apr 03, 2021 8:47 pm    Post subject: Reply with quote

mustafasalih1993 wrote:
nice video :)
in case it will be useful for whoever search for this in the future
i upgrade the kernel with the following (i don't use initramfs):
Quote:
su
eselect kernel list
eselect kernel set $new kernel
cd /usr/src/linux/
cp ../$old-kernel-dir/.config .
make olddefconfig

make modules_prepare
make -j8
make -j8 modules_install
make install
emerge -av @module-rebuild
grub-mkconfig -o /boot/grub/grub.cfg


these can be reduced to just "make oldconfig" if you also do a make install as make install copies the config to /boot and make oldconfig reads from /boot for an old config
_________________
https://www.otw20.com/ Where you can talk
Quote:
Removed by Chiitoo
Back to top
View user's profile Send private message
mustafasalih1993
n00b
n00b


Joined: 09 Feb 2021
Posts: 39

PostPosted: Sat Apr 03, 2021 9:05 pm    Post subject: Reply with quote

Naib wrote:

these can be reduced to just "make oldconfig" if you also do a make install as make install copies the config to /boot and make oldconfig reads from /boot for an old config


Oh, very nice! thank you for the useful tip :)
Back to top
View user's profile Send private message
pietinger
l33t
l33t


Joined: 17 Oct 2006
Posts: 966
Location: Bavaria

PostPosted: Sat Apr 03, 2021 11:17 pm    Post subject: Reply with quote

mustafasalih1993 wrote:
Code:
[...]
make modules_prepare
[...]

I dont understand why you do this. I never used it.

https://www.kernel.org/doc/html/latest/kbuild/modules.html says it is included in a "make". Is there a special need ?
Back to top
View user's profile Send private message
mustafasalih1993
n00b
n00b


Joined: 09 Feb 2021
Posts: 39

PostPosted: Sat Apr 03, 2021 11:55 pm    Post subject: Reply with quote

pietinger wrote:
https://www.kernel.org/doc/html/latest/kbuild/modules.html says it is included in a "make". Is there a special need ?

No nothing special, Thanks for pointing for that i didn't know that it's already done by default!
Back to top
View user's profile Send private message
figueroa
Veteran
Veteran


Joined: 14 Aug 2005
Posts: 1883
Location: Edge of the Marsh USA

PostPosted: Sat Sep 18, 2021 4:03 am    Post subject: Reply with quote

Late to this party, I understand it's better to use make oldconfig rather than make olddefconfig. The olddefconfig option will put any new kernel configuration options at the kernel defaults, which may or may not be what you want. The oldconfig option will prompt you through new configuration options and let you select what's right for your system.

I mention this here since someone helped me by mentioning it to me.

Here are my kernel notes which I keep in the file /usr/src/kernel.txt:
Code:
# Install your new kernel sources. Using 4.9.233 throughout as example.
emerge -a gentoo-sources

or

emerge -a =sys-kernel/gentoo-sources-4.9.233

# NB: /usr/src/linux should currently be a symlink to your current kernel sources.
# Copy the .config from your current kernel sources to your new kernel sources, i.e.
cd /usr/src/
cp linux/.config linux-4.9.233-gentoo/

# Remove the (old) symlink.
rm linux

# Create a new "linux" symlink to your new kernel sources, i.e.
ln -s linux-4.9.233-gentoo linux

# Alternatively, you can change/set the symlink using eselect. Example:
eselect kernel list
Available kernel symlink targets:
  [1]   linux-4.9.221-gentoo
  [2]   linux-4.9.228-gentoo *
  [3]   linux-4.9.233-gentoo

eselect kernel set 3

# Be sure to check your work with:
eselect kernel list
Available kernel symlink targets:
  [1]   linux-4.9.221-gentoo
  [2]   linux-4.9.228-gentoo
  [3]   linux-4.9.233-gentoo *

or

ls -l
lrwxrwxrwx  1 root     root           20 Aug 24 13:20 linux -> linux-4.9.233-gentoo/
drwxr-xr-x 26 root     root         4096 May  5 22:58 linux-4.9.221-gentoo/
drwxr-xr-x 26 root     root         4096 Aug  9 23:11 linux-4.9.228-gentoo/
drwxr-xr-x 26 root     root         4096 Aug 24 13:41 linux-4.9.233-gentoo/

# Change to the new kernel sources directory using,
cd linux/

# Update .config according to new kernel options.
make oldconfig

# Configure the new kernel.
make menuconfig

# Compile the new kernel and install the modules.
make && make modules_install

# Copy important kernel boot files to /boot
cp .config /boot/config-4.9.233-gentoo
cp System.map /boot/System.map-4.9.233-gentoo
cp arch/x86/boot/bzImange /boot/kernel-4.9.233-gentoo

# Alternatively, I understand instead of manually copying files to /boot, one
# can run "make install" which will do it for you automatically. I've never
# done it that way. My way contributes to developing muscle memory.

# remove old symlink "vmlinuz" to old /boot/kernel-n.n.nnn-gentoo and create new
# symlink "vmlinuz" to new kernel file
cd /boot
rm vmlinuz
ln -s kernel-4.9.233-gentoo vmlinuz

# Configure boot loader (grub assumed).
grub-mkconfig -o /boot/grub/grub.cfg

Reference: https://wiki.gentoo.org/wiki/Handbook:AMD64/Installation/Kernel

Note: https://www.kernel.org/doc/html/v5.4/admin-guide/pm/cpufreq.html
Note: https://www.kernel.org/doc/html/v5.10/admin-guide/pm/cpufreq.html

_________________
Andy Figueroa
hp pavilion hpe h8-1260t/2AB5
i7-2600 @ 3.40GHz; 16 gb
amd64/17.1/desktop (stable)
Radeon HD 7570 & spinning rust
Back to top
View user's profile Send private message
Juippisi
Developer
Developer


Joined: 30 Sep 2005
Posts: 561
Location: /home

PostPosted: Sun Sep 26, 2021 6:26 am    Post subject: Reply with quote

You can use your customized kernel config and enable 'savedconfig' IUSE for gentoo-kernel,
https://packages.gentoo.org/packages/sys-kernel/gentoo-kernel

or if you just want a working kernel fast, emerge gentoo-kernel-bin,
https://packages.gentoo.org/packages/sys-kernel/gentoo-kernel-bin
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks 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