Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Installed a new Kernel, botched it, now wanna remove
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
Funkematics
n00b
n00b


Joined: 25 Aug 2018
Posts: 4

PostPosted: Thu Nov 29, 2018 9:55 pm    Post subject: Installed a new Kernel, botched it, now wanna remove Reply with quote

All the guides online seem to be concerned with removing old kernels, I'm looking for
help removing all kernels that aren't the one I'm using now (which is the old one), or new kernels. :oops:
Back to top
View user's profile Send private message
Muso
Veteran
Veteran


Joined: 22 Oct 2002
Posts: 1052
Location: The Holy city of Honolulu

PostPosted: Thu Nov 29, 2018 10:37 pm    Post subject: Re: Installed a new Kernel, botched it, now wanna remove Reply with quote

FunkyCosmonaut wrote:
All the guides online seem to be concerned with removing old kernels, I'm looking for
help removing all kernels that aren't the one I'm using now (which is the old one), or new kernels. :oops:


Why don't you just copy the working config in the kernel you are in to the new kernel and run make syncconfig?

https://wiki.gentoo.org/wiki/Kernel/Upgrade


Here's my (now fixed with --oneshot) kernel upgrading system (as root):
YMMV
Code:

cp /usr/src/linux/.config ~/kernel-config-`uname -r`
eselect kernel list
eselect kernel set 2
mount /boot
cd /usr/src/linux
zcat /proc/config.gz > /usr/src/linux/.config
make syncconfig
make && make modules_install
make install
grub-mkconfig -o /boot/grub/grub.cfg
emerge --oneshot nvidia-drivers
emerge --oneshot vmware-modules
umount /boot
reboot

_________________
"You can lead a horticulture but you can't make her think" ~ Dorothy Parker
2021 is the year of the Linux Desktop!
Back to top
View user's profile Send private message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 30917
Location: here

PostPosted: Fri Nov 30, 2018 7:11 am    Post subject: Reply with quote

Muso instead of
Code:
emerge --oneshot nvidia-drivers
emerge --oneshot vmware-modules

why you don't run emerge @module-rebuild? This command rebuild all modules installed through portage in your system.
_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
Dwosky
Tux's lil' helper
Tux's lil' helper


Joined: 07 Nov 2018
Posts: 135

PostPosted: Fri Nov 30, 2018 7:45 am    Post subject: Re: Installed a new Kernel, botched it, now wanna remove Reply with quote

FunkyCosmonaut wrote:
I'm looking for help removing all kernels that aren't the one I'm using now (which is the old one), or new kernels. :oops:

Have you checked the eclean-kernel tool? https://wiki.gentoo.org/wiki/Kernel/Removal#Removing_kernel_leftovers

It removes the kernels that are no longer refereced, so theoretically you should be able to hold your current old kernel and remove the older or newer ones in case they're no longer referenced.
Back to top
View user's profile Send private message
Funkematics
n00b
n00b


Joined: 25 Aug 2018
Posts: 4

PostPosted: Fri Nov 30, 2018 12:21 pm    Post subject: Re: Installed a new Kernel, botched it, now wanna remove Reply with quote

OoooOoOoooOo, Thank you everyooooone.

I actually had more than one botched kernels installed, lets just say I made many attempts. :P
But now I can clean up all the others and do a rebuild.
Back to top
View user's profile Send private message
Jaglover
Watchman
Watchman


Joined: 29 May 2005
Posts: 8291
Location: Saint Amant, Acadiana

PostPosted: Fri Nov 30, 2018 12:24 pm    Post subject: Reply with quote

It depends how sophisticated you want it to be. I use rm command to remove old kernels and cp command to install new kernels. Works for me.
_________________
My Gentoo installation notes.
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
Muso
Veteran
Veteran


Joined: 22 Oct 2002
Posts: 1052
Location: The Holy city of Honolulu

PostPosted: Fri Nov 30, 2018 1:52 pm    Post subject: Reply with quote

fedeliallalinea wrote:
Muso instead of
Code:
emerge --oneshot nvidia-drivers
emerge --oneshot vmware-modules

why you don't run emerge @module-rebuild? This command rebuild all modules installed through portage in your system.


Will check on the next kernel. I wasn't sure if it would pull in the vmware-modules.

Code:
 emerge -p @module-rebuild

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild   R    ] x11-drivers/nvidia-drivers-415.18
[ebuild   R    ] net-wireless/rtl8812au_aircrack-ng-5.2.20_p20180904-r1
[ebuild   R    ] app-emulation/vmware-modules-330.0.2


Nice! Process updated.
_________________
"You can lead a horticulture but you can't make her think" ~ Dorothy Parker
2021 is the year of the Linux Desktop!
Back to top
View user's profile Send private message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 30917
Location: here

PostPosted: Fri Nov 30, 2018 2:04 pm    Post subject: Reply with quote

Muso wrote:
Will check on the next kernel. I wasn't sure if it would pull in the vmware-modules.

Theoretically yes because is linux-mod eclass that add module to list (and vmware-module inherit from linux-mod), you can check reading file /var/lib/module-rebuild/moduledb
_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
skellr
l33t
l33t


Joined: 18 Jun 2005
Posts: 975
Location: The Village, Portmeirion

PostPosted: Fri Nov 30, 2018 8:27 pm    Post subject: Re: Installed a new Kernel, botched it, now wanna remove Reply with quote

FunkyCosmonaut wrote:
OoooOoOoooOo, Thank you everyooooone.

I actually had more than one botched kernels installed, lets just say I made many attempts. :P
But now I can clean up all the others and do a rebuild.

One thing that is nice when you want to experiment with the kernel is to give it a "local Version". If you give it a local version of something like -test it will append -test to the kernel,config, and modules directory so it won't overwrite/clobber your working kernel of the same version when you make install.
Code:
General Setup - > ()  Local version - append to kernel release
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Fri Nov 30, 2018 8:45 pm    Post subject: Reply with quote

skellr,

There is a downside to local version too. Its not, or at least, wasn't in the past, respected by all out of tree kernel modules.
nvidia-drivers was one popular case.

Thu fix for that is to edit the kernel Makefile which starts
Code:
# SPDX-License-Identifier: GPL-2.0
VERSION = 4
PATCHLEVEL = 19
SUBLEVEL = 0
EXTRAVERSION = -gentoo
and change the EXTRAVERSION. Then run
Code:
make clean
in the kernel tree.
_________________
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
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