Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
EFI + gentoo-sources and grub
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
pegu
n00b
n00b


Joined: 19 Sep 2003
Posts: 55

PostPosted: Tue Oct 01, 2024 10:28 am    Post subject: EFI + gentoo-sources and grub Reply with quote

In https://wiki.gentoo.org/wiki/Handbook:AMD64/Installation/Disks#Mounting_the_root_partition the following commands are given to create the /efi mount point in the rootfs:

Code:

root #mount /dev/sda3 /mnt/gentoo
root #mkdir --parents /mnt/gentoo/efi


Next in https://wiki.gentoo.org/wiki/Handbook:AMD64/Installation/Base#UEFI_systems the efi partition will be mounted on on /efi in the chroot environment:

Code:

root #mount /dev/sda1 /efi




In https://wiki.gentoo.org/wiki/Handbook:AMD64/Installation/Kernel#Compiling_and_installing it will install the compiled kernel in /boot:


Code:

make && make modules_install
make install


This will simply install the kernel in /boot which is a subdirectory of the rootfs. Shouldn't the kernel be installed in /efi?
When I try to run make install I get a message saying that it can't find LILO which is not selected anywhere in the process.

Code:

/usr/src/linux # make install
  INSTALL /boot
Cannot find LILO.



BTW, further up it's stated that "Installkernel may be used to automate the kernel installation." which indicate that this step is optional.


In https://wiki.gentoo.org/wiki/Handbook:AMD64/Installation/Bootloader#UEFI_systems grub is installed, which results in no errors:

Code:

/usr/src/linux # grub-install --efi-directory=/efi
Installing for x86_64-efi platform.
Installation finished. No error reported.


The grub config will also be stored in the /boot directory on the rootfs according to https://wiki.gentoo.org/wiki/Handbook:AMD64/Installation/Bootloader#Configure

Code:

/usr/src/linux # grub-mkconfig -o /boot/grub/grub.cfg
Generating grub configuration file ...
Warning: os-prober will not be executed to detect other bootable partitions.
Systems on them will not be added to the GRUB boot configuration.
Check GRUB_DISABLE_OS_PROBER documentation entry.
Adding boot menu entry for UEFI Firmware Settings ...
done


Now the kernel is in the rootfs and grub is on the efi partition. How does grub find the kernel?

When I boot this system I only get a single grub entry with "UEFI Firmware Settings". I can interrupt it and boot the system from the grub command line by setting the root and specify the location of the kernel and root partition.

Shouldn't the efi partition be mounted at /boot prior to "make install" in order for grub to find these? Or what steps have I missed or what is missing in the installation guide when using EFI and building the kernel from gentoo-sources?
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 5118
Location: Bavaria

PostPosted: Tue Oct 01, 2024 11:35 am    Post subject: Reply with quote

Most of what you have written is completely correct, even if you doubt it. :lol:

Yes, it makes no difference whether you mount /efi BEFORE you chroot (with mount /dev/sda1 /mnt/gentoo/efi) or after you have changed via chroot (with mount /dev/sda1 /efi). Example: https://wiki.gentoo.org/wiki/User:Pietinger/Draft/Quick_Installation_OpenRC_for_an_UEFI_System#Mount_partitions

Until septermber 2023 the moutpoint for the ESP was indeed /boot. It was then changed to /efi. See more here: https://forums.gentoo.org/viewtopic-t-1165115-highlight-.html

Yes, this means that you mount the ESP on /efi, while /boot is an ordinary directory of the root directory (and thus located on the root partition).

GRUB consists of two parts. The first part can be started by UEFI and must therefore be on the ESP (exactly: \efi\gentoo\grubx64.efi). This part knows where the second part is located (this happens during the installation of grub with grub-install). The second part of grub is now located in /boot/grub (and thus on the root parttion). This second part reads the grub.cfg and now knows where the kernel is located.

If your grub does not find the kernel, it may be because the name of your kernel (in /boot) does not correspond to a standard and therefore the “grub-mkconfig” has not found a kernel (although there is one) and has not entered a kernel in the grub.cfg. This is exactly what your output from grub-mkconfig shows. I am missing a: “Found linux image: ...”

The installkernel influences the “make install” (via hooks) and therefore installkernel should be installed. Another possibility would be to copy the kernel itself (“make install” does nothing else). Have a look at this: https://wiki.gentoo.org/wiki/User:Pietinger/Tutorials/Manual_kernel_configuration#Cheat_Sheets

If you need more help, we would need the output of:

- ls -l /boot
- efibootmgr
- and the content of grub.cfg
_________________
https://wiki.gentoo.org/wiki/User:Pietinger
Back to top
View user's profile Send private message
pegu
n00b
n00b


Joined: 19 Sep 2003
Posts: 55

PostPosted: Tue Oct 01, 2024 1:50 pm    Post subject: Reply with quote

pietinger wrote:

The installkernel influences the “make install” (via hooks) and therefore installkernel should be installed.


Then the handbook should be updated stating that it should be installed and used rather than it may be used in this particular case?


pietinger wrote:

If your grub does not find the kernel, it may be because the name of your kernel (in /boot) does not correspond to a standard.


Again the handbook should be updated if installkernel is required to follow the correct naming convention in order for grub to find the kernel as the default vmlinuz does not seem to work.
Back to top
View user's profile Send private message
sMueggli
Guru
Guru


Joined: 03 Sep 2022
Posts: 496

PostPosted: Tue Oct 01, 2024 4:00 pm    Post subject: Reply with quote

And please show also
Code:
emerge -pv installkernel
Back to top
View user's profile Send private message
Nowa
Developer
Developer


Joined: 25 Jun 2014
Posts: 429
Location: Nijmegen

PostPosted: Tue Oct 01, 2024 5:35 pm    Post subject: Reply with quote

Quote:
Again the handbook should be updated if installkernel is required to follow the correct naming convention in order for grub to find the kernel as the default vmlinuz does not seem to work.


The default 'vmlinuz' does not work because it is missing a version identifier (which grub-mkconfig requires). That however does not mean that you cannot boot the plain 'vmlinuz' with grub, you'd simply have to register it manually or give it some name manually.

sys-kernel/installkernel exists for users who want semi- or full-auto installations of versioned kernel images, "may" is used in the handbook because we have many users who prefer to do things manually instead.
_________________
OS: Gentoo 6.10.12-gentoo-dist, ~amd64, 23.0/desktop/plasma/systemd
MB: MSI Z370-A PRO
CPU: Intel Core i9-9900KS
GPU: Intel Arc A770 16GB & Intel UHD Graphics 630
SSD: Samsung 970 EVO Plus 2 TB
RAM: Crucial Ballistix 32GB DDR4-2400
Back to top
View user's profile Send private message
pegu
n00b
n00b


Joined: 19 Sep 2003
Posts: 55

PostPosted: Wed Oct 02, 2024 7:02 pm    Post subject: Reply with quote

AndrewAmmerlaan wrote:

The default 'vmlinuz' does not work because it is missing a version identifier (which grub-mkconfig requires). That however does not mean that you cannot boot the plain 'vmlinuz' with grub, you'd simply have to register it manually or give it some name manually.


I understand this. When this happened I was able to boot it manually from the grub command line.

AndrewAmmerlaan wrote:

sys-kernel/installkernel exists for users who want semi- or full-auto installations of versioned kernel images, "may" is used in the handbook because we have many users who prefer to do things manually instead.



In my opinion the handbook should make it possible for a new or inexperienced user to follow it without ending up with a system which does not boot. The handbook should tell the user that this step has to be be performed in this case. Then there could be a note to the expert user that she may omit this step if she prefer to do things manually instead.
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