Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Grub doesn't recognize the 5.4 kernel.
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
hjkl
Apprentice
Apprentice


Joined: 22 Apr 2021
Posts: 198
Location: Somewhere in Europe

PostPosted: Wed May 12, 2021 11:29 am    Post subject: Grub doesn't recognize the 5.4 kernel. Reply with quote

Hi,


I just installed the 5.4 kernel as backup since im using the 5.12.2 kernel, however, when i emerge it (i emerged it multiple times now and once uninstalled, so practically i reinstalled it & then rebuilt it a few times)

it gives me this output:

Code:

 * Messages for package sys-kernel/gentoo-sources-5.4.109:

 * Note: Even though you have successfully unmerged
 * your kernel package, directories in kernel source location:
 * /usr/src/linux-5.4.109-gentoo
 * with modified files will remain behind. By design, package managers
 * will not remove these modified files and the directories they reside in.
 * For more detailed kernel removal instructions, please see:
 * https://wiki.gentoo.org/wiki/Kernel/Removal



So, I just ignored that.

Then I did grub-mkconfig -o /boot/grub/grub.cfg

Then I saw that grub doesn't detect it at all?

What could be the cause?

Cheers!
_________________
Having problems compiling since 2021 :(
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Wed May 12, 2021 12:12 pm    Post subject: Reply with quote

fullbyte,

/boot is not mounted

The new kernel is buried in Grubs menu somewhere.

The new kernel name is not recognised by grub-mkconfig as being a kernel file.

Something else entirely.
_________________
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
hjkl
Apprentice
Apprentice


Joined: 22 Apr 2021
Posts: 198
Location: Somewhere in Europe

PostPosted: Wed May 12, 2021 12:42 pm    Post subject: Reply with quote

NeddySeagoon wrote:
fullbyte,

/boot is not mounted

The new kernel is buried in Grubs menu somewhere.

The new kernel name is not recognised by grub-mkconfig as being a kernel file.

Something else entirely.



This helped a bit.

Cheers!
_________________
Having problems compiling since 2021 :(
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Wed May 12, 2021 12:53 pm    Post subject: Reply with quote

fullbyte,

Tell us what you find, it will help others.
_________________
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
hjkl
Apprentice
Apprentice


Joined: 22 Apr 2021
Posts: 198
Location: Somewhere in Europe

PostPosted: Wed May 12, 2021 12:58 pm    Post subject: Reply with quote

NeddySeagoon wrote:
fullbyte,

Tell us what you find, it will help others.



So, I had to rebuild the kernel basically via

Code:

sudo make -j20 && sudo make modules_install && sudo emerge @module-rebuild && sudo make install && grub-mkconfig -o /boot/grub/grub.cfg

(editing something random before that to make it)

That somehow made grub detect it?
_________________
Having problems compiling since 2021 :(
Back to top
View user's profile Send private message
Ralphred
Guru
Guru


Joined: 31 Dec 2013
Posts: 495

PostPosted: Wed May 12, 2021 2:09 pm    Post subject: Reply with quote

fullbyte wrote:
Code:
 ~snip~ && grub-mkconfig -o /boot/grub/grub.cfg

Just a quick note about that.
I don't have any modules so am happy to just run
Code:
host /usr/src/linux # make -j12 && make install
but allowing grub-mkconfig to just overwrite your existing config without checking it detected everything first, too trusting.
I always
Code:
grub-mkconfig >/dev/null
first just to check it's detected everything, then
Code:
grub-mkconfig > /boot/grub/grub.cfg-x.y.z
where x.y.z is the kernel version you just built. You don't need this now, but if grub-mkconfig starts producing .cfg files that don't work in the future, you have a reference.
Now sanity check the /boot/grub/grub.cfg-x.y.z file for UUID/PARTUUID etc. If it's OK then
Code:
grub-mkconfig > /boot/grub/grub.cfg
and check it boots.

Admittedly keeping grub.cfg-x.y.z files is a bit OTT, but the primary >/dev/null saved me from installing a .cfg that completely ignored my windows install on another drive just yesterday.
Back to top
View user's profile Send private message
mustafasalih1993
n00b
n00b


Joined: 09 Feb 2021
Posts: 38

PostPosted: Wed May 12, 2021 2:18 pm    Post subject: Reply with quote

Hello fullbyte
you don't have rebuild your kernel if you already did before,
after you mounted your /boot as Neddy commented, you just need to cd into the kernel directory again and do only a `make install`
this command will not rebuild your kernel it will copy the kernel executable to your $(INSTALL_PATH)
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Wed May 12, 2021 7:21 pm    Post subject: Reply with quote

fullbyte,

Start with
Code:
make clean
to force a rebuild. That removes all the binary files in the kernel tree but leaves the .config alone.
If thats not clean enough, there is
Code:
make mrproper
That removes more, including the .config.
_________________
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
hjkl
Apprentice
Apprentice


Joined: 22 Apr 2021
Posts: 198
Location: Somewhere in Europe

PostPosted: Thu May 13, 2021 4:23 pm    Post subject: Reply with quote

NeddySeagoon wrote:
fullbyte,

Start with
Code:
make clean
to force a rebuild. That removes all the binary files in the kernel tree but leaves the .config alone.
If thats not clean enough, there is
Code:
make mrproper
That removes more, including the .config.



Will do next time! Cheers

Sorry about the late reply.
_________________
Having problems compiling since 2021 :(
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