Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Issues with grub trying to move to EFI
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
Ridrok
Tux's lil' helper
Tux's lil' helper


Joined: 26 Jan 2014
Posts: 116
Location: France

PostPosted: Thu Dec 12, 2024 8:41 pm    Post subject: Issues with grub trying to move to EFI Reply with quote

Hello,

I try to move to EFI, I currently use CSM (Asus) bios compatible mode.
Reading the Handbook for EFI, I get into a problem.

If I follow the handbook and reinstall grub with the entry GRUB_PLATFORMS="efi-64" in make.conf, then when running grub-install --efi-directory=/efi, I get
Code:
grub-install : error : /usr/lib/grub/i386-pc/modinfo.sh does not exist. Please use --target or --directory.


Having this entry in make.conf removes the pc use flag from grub

If I remove this entry, recompile grub with efi-64 and pc (uses automatically added) I get another message
Code:
Installing for i386-pc platform.
grub-install: error: install device isn't specified.


So I am a bit lost on how to generate the required EFI files in /efi mount point to the ESP partition.
Back to top
View user's profile Send private message
grknight
Retired Dev
Retired Dev


Joined: 20 Feb 2015
Posts: 1950

PostPosted: Thu Dec 12, 2024 8:47 pm    Post subject: Reply with quote

Ridrok wrote:
If I follow the handbook and reinstall grub with the entry GRUB_PLATFORMS="efi-64" in make.conf, then when running grub-install --efi-directory=/efi, I get
Code:
grub-install : error : /usr/lib/grub/i386-pc/modinfo.sh does not exist. Please use --target or --directory.

If you see this, then the system was not booted via a UEFI enabled loader such that the UEFI settings cannot be modified.

The best option is to boot with a live environment which supports doing so with UEFI and not CSM (Legacy BIOS).
Otherwise, an alternative is to use the --removable option to grub-install to bypass the modifying the boot settings and put the EFI executable into a default location (which may overwrite any existing default EFI executable).
Back to top
View user's profile Send private message
Ridrok
Tux's lil' helper
Tux's lil' helper


Joined: 26 Jan 2014
Posts: 116
Location: France

PostPosted: Thu Dec 12, 2024 8:55 pm    Post subject: Reply with quote

For sure I did not boot in UEFI, my gentoo has been installed with MBR so many years ago.
I cannot boot it with EFI, that is why I try to make it EFI

So egg and chicken here.

Then ok, will try a live UEFI boot
Back to top
View user's profile Send private message
Ralphred
l33t
l33t


Joined: 31 Dec 2013
Posts: 668

PostPosted: Fri Dec 13, 2024 9:58 pm    Post subject: Reply with quote

Ridrok wrote:
So egg and chicken here.
The egg came first, layed by a proto-chicken.
Ridrok wrote:
Then ok, will try a live UEFI boot
It's not really necessary
https://wiki.gentoo.org/wiki/Handbook:AMD64/Blocks/Bootloader#Debugging_GRUB wrote:
grub-install --target=x86_64-efi --efi-directory=/efi --removable
UEFI needs to be able to "self identify" bootable media, or USB disks etc. would never work. Once it's booted after running the above command you can run it again without --removable.
Back to top
View user's profile Send private message
Ridrok
Tux's lil' helper
Tux's lil' helper


Joined: 26 Jan 2014
Posts: 116
Location: France

PostPosted: Sat Dec 14, 2024 8:21 am    Post subject: Reply with quote

I managed to do it.
Handbooks and wiki are very confusing I would say.

What I did:
Boot the live Gentoo in EFI while still having CSM activated.
Moved my system to a new disk redoing the partitioning (Moving from SSD to NVME).
I had 2Mo bios grub, 80MB boot, 8GB swap and remaining as EXT4
I now have 1GB EFI, 32GB swap and remaining EXT4, got ride of the bios partition

Then I did mount /efi and /boot to the newly created 1GB partition with fstab (I did not install autofs) and did grub install, then
Code:
grub-mkconfig -o /efi/EFI/Gentoo/grub.cfg

Then from /usr/src/linux
Code:
make install

Then it was able to boot in EFI.

I then converted the windows 10 I have lying on another disk to GPT/EFI, I use it twice a year, but I wanted to keep it in case.

Finally I did deactivate CSM, and after all these years it boots with the console at proper resolution.
Moreover I now have Resizable Bar working.
Code:
~ % nvidia-smi -q | grep -i bar -A 3
    BAR1 Memory Usage
        Total                             : 32768 MiB
        Used                              : 54 MiB
        Free                              : 32714 MiB


Some settings in bios to have >4GB addressing + Resizable Bar activated in 2 places and this
Code:
~ % cat /etc/modprobe.d/nvidia-rebar.conf
options nvidia NVreg_EnableResizableBar=1
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