Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
grub-mkconfig does not detect any kernel
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
tshade
n00b
n00b


Joined: 01 Oct 2007
Posts: 21

PostPosted: Sat Dec 17, 2022 3:04 pm    Post subject: grub-mkconfig does not detect any kernel Reply with quote

I have searched for help, but I have got no clue of what can be happening. I am installing Gentoo (it's not the first time, I have been active since many years), and I have configured and installed the kernel. Now, I try

Code:
grub-mkconfig -o /boot/grub/menu.cfg


But it only adds an entry for "UEFI Firmware Settings"

What can be wrong? I have three partitions on my GPT table, first, sda1, 500MB, EFI, second, sda2, swap, third, sda3, root, ext4.

My computer is a Lenovo Tiny which supports UEFI (and has it enabled, and legacy boot is disabled)

sda1 is mounted in /boot/, I'm in a jail, with everything mounted (proc, sys, dev, run). I have tried mounting sda1 on /boot/EFI, but it also does not work.

I have already configured, compiled and installed te latest kernel.

Any more information you need, please, tell me.
Back to top
View user's profile Send private message
Logicien
Veteran
Veteran


Joined: 16 Sep 2005
Posts: 1555
Location: Montréal

PostPosted: Sat Dec 17, 2022 3:10 pm    Post subject: Reply with quote

Have you install os-prober for Grub to detect other systems. You can try Refind who is good too as a EFI bootloader. Is the path /boot/grub/menu.cfg or /boot/grub2/menu.cfg? On Gentoo Grub2 can be in the path.
_________________
Paul
Back to top
View user's profile Send private message
tshade
n00b
n00b


Joined: 01 Oct 2007
Posts: 21

PostPosted: Sat Dec 17, 2022 3:45 pm    Post subject: Reply with quote

I execute 'os-prober' and the result is empty. What am I doing wrong? BTW, /boot/ contains:

EFI, System.map, System.old, gentoo, grub (not grub2), vmlinuz, vmlinuz.old

And /boot/grub/ contains: fonts, grub.cfg, grubenv, locale, themes, x86_64-efi

I have compiled and installed os-prober, grub correctly detects it, but only efi-64 in GRUB_PLATFORMS.
Back to top
View user's profile Send private message
FilthyPitDog
Apprentice
Apprentice


Joined: 12 Jan 2021
Posts: 194
Location: South Pacific

PostPosted: Sat Dec 17, 2022 9:40 pm    Post subject: Reply with quote

Make sure GRUB_PLATFORMS="efi-64" is in make.conf

then redo

grub-install --target=x86_64-efi --efi-directory=/boot
grub-mkconfig -o /boot/grub/grub.cfg
_________________
Gentoo is a way of life...
Back to top
View user's profile Send private message
tshade
n00b
n00b


Joined: 01 Oct 2007
Posts: 21

PostPosted: Sun Dec 18, 2022 4:10 pm    Post subject: Reply with quote

I have run the two commands, still no luck. Everything seems Ok, but grub does not detect any kernel.
Back to top
View user's profile Send private message
Logicien
Veteran
Veteran


Joined: 16 Sep 2005
Posts: 1555
Location: Montréal

PostPosted: Sun Dec 18, 2022 4:41 pm    Post subject: Reply with quote

What are the permissions in
Code:
ls -al /etc/grub.d/

What's the contain of /etc/default/grub

You can create your own Grub menu entries in /etc/grub.d/40_custom, make it executable and run

Code:
grub-mkconfig -o /boot/grub/grub.cfg


Read the contain of /boot/grub/grub.cfg after grub-mkconfig can be helpfull of what the command did. If you mount sda1 in the /boot directory of Gentoo it change something. It normally go to /boot/efi. Other questions: do your rich the Grub menu when you boot the computer? Is there something in the menu?
_________________
Paul
Back to top
View user's profile Send private message
sabayonino
Veteran
Veteran


Joined: 03 Jan 2012
Posts: 1036

PostPosted: Sun Dec 18, 2022 7:56 pm    Post subject: Reply with quote

Hi.
Is /boot mounted ? if Yes the EFI directory and its contents overlapped /boot

if you have /boot as "efi" directory , by default it is not mounted so the real /boot is on the / filesystem

I suggest to keep EFI filesystem separated from /boot

/boot ext4 ( or simply keep the /boot directory on / )
/boot/EFI directory FAT32-efi where to install the efi-firmware

Code:
# grub-install .... --efi-directory=/boot/EFI


EFI directory no need to be mounted so you can avoid to mount over fstab file


My conf is :
Code:

UUID=AF48-5865                                  /boot/efi       vfat    noauto        0 1
UUID=21184dd9-893a-4aa6-8007-eb2b2d938c1d       /       ext4    defaults,noatime,discard        0 1
UUID=5da6c362-2960-42cb-96f6-5c5795df84dc       /home   ext4    defaults,noatime,discard        0 2


Code:
blkid | grep sda
/dev/sda4: LABEL="fs_home" UUID="5da6c362-2960-42cb-96f6-5c5795df84dc" BLOCK_SIZE="4096" TYPE="ext4" PARTLABEL="fs_home" PARTUUID="b4d79c7a-d3bd-41e5-90fb-190cf6f023c5"
/dev/sda2: LABEL_FATBOOT="FS_EFI" LABEL="FS_EFI" UUID="AF48-5865" BLOCK_SIZE="512" TYPE="vfat" PARTLABEL="fs_efi" PARTUUID="437dfe8e-50b4-4f33-87ed-3b1895e8d21a"
/dev/sda3: LABEL="fs_root" UUID="21184dd9-893a-4aa6-8007-eb2b2d938c1d" BLOCK_SIZE="4096" TYPE="ext4" PARTLABEL="fs_root" PARTUUID="b27b9880-71ee-4af0-81d4-591f52ee8839"


/boot contents
Code:
ls /boot
 amd-uc.img                       grub                                    memtest86plus                        vmlinuz-5.15.80-gentoo-dist
 config-5.15.77-gentoo-dist       initramfs-5.15.77-gentoo-dist.img       System.map-5.15.77-gentoo-dist       vmlinuz-5.15.80-gentoo-dist.old
 config-5.15.80-gentoo-dist       initramfs-5.15.80-gentoo-dist.img       System.map-5.15.80-gentoo-dist
 config-5.15.80-gentoo-dist.old   initramfs-5.15.80-gentoo-dist.img.old   System.map-5.15.80-gentoo-dist.old
 efi                              intel-uc.img                            vmlinuz-5.15.77-gentoo-dist

_________________
LRS i586 on G.Drive
LRS x86-64 EFI on MEGA
Back to top
View user's profile Send private message
tshade
n00b
n00b


Joined: 01 Oct 2007
Posts: 21

PostPosted: Sun Dec 18, 2022 10:38 pm    Post subject: Reply with quote

All files in /etc/grub.d/ are executable, except the README, all owned by root.

/etc/default/grub: all lines are commented, except GRUB_DISABLE_OS_PROBER=false and GRUB_DISTRIBUTOR="Gentoo"

I still don't see anything wrong or inusual.
Back to top
View user's profile Send private message
grknight
Retired Dev
Retired Dev


Joined: 20 Feb 2015
Posts: 1912

PostPosted: Mon Dec 19, 2022 12:58 am    Post subject: Reply with quote

tshade wrote:
I execute 'os-prober' and the result is empty. What am I doing wrong? BTW, /boot/ contains:

EFI, System.map, System.old, gentoo, grub (not grub2), vmlinuz, vmlinuz.old

And /boot/grub/ contains: fonts, grub.cfg, grubenv, locale, themes, x86_64-efi

I have compiled and installed os-prober, grub correctly detects it, but only efi-64 in GRUB_PLATFORMS.


Naming your kernel just vmlinuz is the issue. The default 10_linux script for grub expects a version after it such as the one created by 'make install'
Back to top
View user's profile Send private message
sMueggli
Guru
Guru


Joined: 03 Sep 2022
Posts: 490

PostPosted: Mon Dec 19, 2022 4:20 pm    Post subject: Re: grub-mkconfig does not detect any kernel Reply with quote

tshade wrote:

Code:
grub-mkconfig -o /boot/grub/menu.cfg



I think you should use
Code:
grub-mkconfig -o /boot/grub/grub.cfg

to avoid other problems (after fixing the real problem).
Back to top
View user's profile Send private message
tshade
n00b
n00b


Joined: 01 Oct 2007
Posts: 21

PostPosted: Mon Dec 19, 2022 6:12 pm    Post subject: Reply with quote

@sMueggli you're right, it's a typo.

It's now working, grub has detected the vmlinuz-5.15.75-gentoo kernel. But I wonder... why does it not automatically do it? I mean, kernel "make install". The Handbook recommends creating /dev/sda1 type vfat, partition type EFI to mount on /boot.

I guess this is not correct, it should mount /dev/sda1 on /boot/EFI, is it right?

I have selected the installed kernel to boot and get "Booting Gentoo GNU/Linux", "Loading Linux 5.15.75-gentoo", nothing more.

I'll try and change /dev/sda1 EFI partition, just in case.
Back to top
View user's profile Send private message
tshade
n00b
n00b


Joined: 01 Oct 2007
Posts: 21

PostPosted: Mon Dec 19, 2022 6:28 pm    Post subject: Reply with quote

I have changed boot partition to mount on /boot/EFI/, main sda3 partition contains everything else, including the kernel itself. No luck, I'm stuck in "Loading Linux 5.15.75-gentoo"...

I'm surprised the kernel itself has not append the version number to vmlinuz file, it's the first time I have to append it manually.
Back to top
View user's profile Send private message
grknight
Retired Dev
Retired Dev


Joined: 20 Feb 2015
Posts: 1912

PostPosted: Mon Dec 19, 2022 6:32 pm    Post subject: Reply with quote

tshade wrote:
I have changed boot partition to mount on /boot/EFI/, main sda3 partition contains everything else, including the kernel itself. No luck, I'm stuck in "Loading Linux 5.15.75-gentoo"...

I'm surprised the kernel itself has not append the version number to vmlinuz file, it's the first time I have to append it manually.


You are not "stuck". The kernel is starting but you are unable to see anything without configuring a valid video driver to display to the screen.
UEFI does not have a text fall back to display anything until video is properly set.
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 5094
Location: Bavaria

PostPosted: Mon Dec 19, 2022 6:34 pm    Post subject: Reply with quote

tshade,

you are probably missing framebuffer. See more in our "neighbour" thread: https://forums.gentoo.org/viewtopic-p-8764937.html#8764937
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 5094
Location: Bavaria

PostPosted: Mon Dec 19, 2022 6:41 pm    Post subject: Reply with quote

tshade wrote:
It's now working, grub has detected the vmlinuz-5.15.75-gentoo kernel. But I wonder... why does it not automatically do it? I mean, kernel "make install". The Handbook recommends creating /dev/sda1 type vfat, partition type EFI to mount on /boot.

I guess this is not correct, it should mount /dev/sda1 on /boot/EFI, is it right?

[...]

I'll try and change /dev/sda1 EFI partition, just in case.

Please dont do it. GO with our AMD64 handbook. Mount your /dev/sda1 (=your ESP with FAT32) to /boot.

You have two choices:

1. You are using only a ESP (efi system partition) and mount it as /boot (you will have later: /boot/EFI/gentoo/grubx64.efi)

2. You are using two partition: One ESP and an additional for more boot stuff. THEN you must mount add. Partition as /boot. here you can make a directory efi. To this you mount your ESP (you will have later: /boot/efi/EFI/gentoo/grubx64.efi)

Needless to say, I dont recommend option 2.

Next: "make install" copies ONLY your kernel to /boot (nothing more). If you use grub you must tell grub to do a new configuration WITH this new kernel. Therefore I recommend to do ALWAYS a "grub-mkconfig -o /boot/grub/grub.cfg" afterwards.
Back to top
View user's profile Send private message
sMueggli
Guru
Guru


Joined: 03 Sep 2022
Posts: 490

PostPosted: Tue Dec 20, 2022 4:59 pm    Post subject: Reply with quote

There are more than two choices.

The handbook is not wrong, but is also not the only possible solution. The best solution depends on your needs.

You can (ab)use the EFI System Partition and mount it to /boot. But you can also have a separate /boot partition or you can use the existing /boot directory on your system root partition (also known as /).

The ESP must be formatted as FAT and has all the advantages and disadvantages of FAT.
Back to top
View user's profile Send private message
tshade
n00b
n00b


Joined: 01 Oct 2007
Posts: 21

PostPosted: Tue Dec 20, 2022 8:54 pm    Post subject: Reply with quote

Thank you, now, I'm having trouble with GRUB not detecting its config files /boot/grub/x86_64-efi/normal.mod not found

I have tried Boot repair disk, and no luck. Super Grub Disk allows me to boot the gentoo kernel, but I cannot use root, I will set the password by hand, sudo is not installed. I think I will set root password and boot using Super Grub Disk, then reinstalling grub.
Back to top
View user's profile Send private message
tshade
n00b
n00b


Joined: 01 Oct 2007
Posts: 21

PostPosted: Tue Dec 20, 2022 9:02 pm    Post subject: Reply with quote

BTW, the framebuffer now works, omg, this is so complicated... :-( I'm trying lots of things, no luck.
Back to top
View user's profile Send private message
luna80
Veteran
Veteran


Joined: 01 Feb 2004
Posts: 1556
Location: switzerland

PostPosted: Wed Dec 21, 2022 6:10 am    Post subject: Reply with quote

maybe is a stupid question bu did you launch

Code:
make install


after compiling the kernel, the kernel is present in /boot?
_________________
*** !f j00 c4n r34D tH15 tH3N j00 n33D t0 l0g Off ***
Back to top
View user's profile Send private message
tshade
n00b
n00b


Joined: 01 Oct 2007
Posts: 21

PostPosted: Wed Dec 21, 2022 3:19 pm    Post subject: Reply with quote

Of course, I have executed make install... It has installed the kernel in /boot/vmlinuz, which is not correct (it should append it's version). Strange thing: I have compiled and installed Gentoo many times and I have never seen this problem, I mean, kernel always installs in /boot/vmlinuz-[version]. I think I will wait until I get a different point of view. The clue might be somewhere... I am making a [probably stupid] mistake, so your comment is completely relevant.
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 5094
Location: Bavaria

PostPosted: Wed Dec 21, 2022 3:57 pm    Post subject: Reply with quote

tshade wrote:
[...] It has installed the kernel in /boot/vmlinuz, which is not correct (it should append it's version). Strange thing: I have compiled and installed Gentoo many times and I have never seen this problem, I mean, kernel always installs in /boot/vmlinuz-[version].

Do you have both empy ? (If not, do it)
Code:
General setup  --->
    ()  Local version - append to kernel release
    [ ] Automatically append version information to the version string
Back to top
View user's profile Send private message
WareChameleon
n00b
n00b


Joined: 13 Jun 2021
Posts: 13

PostPosted: Thu May 09, 2024 9:02 pm    Post subject: Reply with quote

tshade wrote:
Of course, I have executed make install... It has installed the kernel in /boot/vmlinuz, which is not correct (it should append it's version). Strange thing: I have compiled and installed Gentoo many times and I have never seen this problem, I mean, kernel always installs in /boot/vmlinuz-[version]. I think I will wait until I get a different point of view. The clue might be somewhere... I am making a [probably stupid] mistake, so your comment is completely relevant.


Experienced this May 9 2024 under similar circumstances.

Renaming vmlinuz to vmlinuz-6.6.30 did NOTHING.

Renaming to kernel-6.6.30 led to successful detection by grub-mkconfig
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 5094
Location: Bavaria

PostPosted: Thu May 09, 2024 9:06 pm    Post subject: Reply with quote

In the meantime we had several versions of “installkernel” (each with a different behaviour) ... maybe it would be good if you activate the necessary use-flags with the help of https://wiki.gentoo.org/wiki/Installkernel and update to the current version.
_________________
https://wiki.gentoo.org/wiki/User:Pietinger
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