The time has come to install our bootloader, GRUB in this case. We will, before that, mount the EFI variables using a very long command:
mount | grep efivars &> /dev/null || mount -t efivarfs efivarfs /sys/firmware/efi/efivars
Run the appropriate command to install GRUB:
grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=Gentoo --recheck
If you are doing the installation in VirtualBox or VMware, it is recommended to run the following if you want to avoid eventual boot issues:
mkdir -p /boot/efi/EFI/boot && cp /boot/efi/EFI/Gentoo/grubx64.efi /boot/efi/EFI/boot/bootx64.efi
We are now at the step of configuring GRUB. Edit the /etc/default/grub file, to make the boot parameters' line look like the following, then save the file:
GRUB_CMDLINE_LINUX_DEFAULT="loglevel=3"
Then, generate the GRUB configuration file:
grub-mkconfig -o /boot/grub/grub.cfg
We are now ready to unmount the partitions and reboot the system. First exit the chroot:
exit
Then navigate out of the new system's root:
cd
Then unmount the partitions:
umount -R /mnt/gentoo
And reboot:
reboot
Note: You can now disconnect the installation media, our new system is ready to be used directly.
We are now ready to proceed with the next step.
Next page