Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
grub-install hangs (2006 iMac, intel core 2 duo)
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
exuberantmonkey
n00b
n00b


Joined: 09 Apr 2023
Posts: 19

PostPosted: Wed Apr 12, 2023 3:02 am    Post subject: grub-install hangs (2006 iMac, intel core 2 duo) Reply with quote

First time gentoo user.

I've been following the amd64 install handbook to install linux on my 2006 intel iMac. Not looking to multi-boot -- I repartitioned the drive per the handbook. Everything went smoothly until grub-install. I did some homework before this stage and read that the UEFI boot loader image for these Macs needs to be 32-bit. Hence, one deviation from the handbook was to include efi-32 in my GRUB_PLATFORMS var in /etc/portage/make.conf, i.e.

Code:
GRUB_PLATFORMS="efi-32 efi-64"


Then after emerge, for grub-install I tried

Code:
grub-install --target=i386-efi --efi-directory=/boot


but it seemed hung with no apparent progress. After 10 min or so I hit ctrl-C, tried the 64 bit install which also hung. Then alt-F2 to another terminal session to check some directories and it hung. So I just hard powered down. I can reboot from the USB stick and mount / chroot to get to this stage again but I'm not sure what to try.

I know i CAN work on this hardware. I have a MacBook Pro from the same year, and back in 2008 I was triple booting OS X / Windows / Linux for work and compiling our project on all three platforms. For that install I used Unbuntu. I think I used refit for multi-boot support.

Any suggestions would be greatly appreciated. I've been scanning forum and wiki but so far no luck.
Back to top
View user's profile Send private message
alamahant
Advocate
Advocate


Joined: 23 Mar 2019
Posts: 3879

PostPosted: Wed Apr 12, 2023 8:17 am    Post subject: Reply with quote

Try runnining
Code:

grub-install -v ......

see if it gives you more info.
If not working have you considered plain grub-pc?
But for that you will need to do extra work on your drive?
_________________
:)
Back to top
View user's profile Send private message
sMueggli
Guru
Guru


Joined: 03 Sep 2022
Posts: 374

PostPosted: Wed Apr 12, 2023 11:20 am    Post subject: Reply with quote

What shows
Code:
cat /sys/firmware/efi/fw_platform_size
?
Back to top
View user's profile Send private message
exuberantmonkey
n00b
n00b


Joined: 09 Apr 2023
Posts: 19

PostPosted: Wed Apr 12, 2023 6:24 pm    Post subject: Reply with quote

got past this step

fw_platform_size is 32 (I confirmed this before attempting the grub install)

When I rebooted / chrooted, it looked liked files had been copied to /boot by the session that hung.

To be sure, I ran grub-install again, with -v option and also with --removable options (after finding https://forums.gentoo.org/viewtopic-t-1147524-highlight-grub+mac.html). This time it ran quickly and exited.

I rebooted, and my gentoo install boots, but gets stuck after "Checking local filesystems ..."
Back to top
View user's profile Send private message
exuberantmonkey
n00b
n00b


Joined: 09 Apr 2023
Posts: 19

PostPosted: Wed Apr 12, 2023 9:49 pm    Post subject: Reply with quote

added nomodeset to the kernel boot options and now it boots to console

yay!
Back to top
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 21708

PostPosted: Thu Apr 13, 2023 1:06 am    Post subject: Reply with quote

On most hardware, nomodeset will ultimately cause you more problems, because it disables KMS, and modern display servers expect to use KMS. It might be necessary for very old hardware where no KMS support was ever developed, but if you run into problems with a display server, my first guess would be to blame nomodeset.
Back to top
View user's profile Send private message
sMueggli
Guru
Guru


Joined: 03 Sep 2022
Posts: 374

PostPosted: Thu Apr 13, 2023 6:50 am    Post subject: Reply with quote

exuberantmonkey wrote:

To be sure, I ran grub-install again, with -v option and also with --removable options (after finding https://forums.gentoo.org/viewtopic-t-1147524-highlight-grub+mac.html). This time it ran quickly and exited.


This will install the bootloader to \EFI\BOOT\BOOTX64.EFI. That is used as a fallback path and for removable devices. If you have more than one bootloader installed, it is very likely that the binary will be overwritten from time to time by other bootloaders.

Please check the existing bootloader entries in the NVRAM with
Code:
efibootmgr
Back to top
View user's profile Send private message
exuberantmonkey
n00b
n00b


Joined: 09 Apr 2023
Posts: 19

PostPosted: Thu Apr 13, 2023 5:20 pm    Post subject: Reply with quote

I was being concise. When I ran with -v option, I entered this:

Code:
grub-install -v --target=i386-efi --efi-directory=/boot --removable


When I mount my boot partition, I see:
/boot/EFI/BOOT/BOOTIA32.EFI
/boot/EFI/BOOT/grub.efi
/boot/EFI/gentoo/grub.efi
/boot/EFI/gentoo/grubia32.efi
(plus some files in /boot and a /boot/grub directory with more files and subdirectories, none of which contain .efi files)

From efimanager, I only have one entry, BOOTFFFF, which references /File(\EFI\BOOT\BOOTIA32.EFI). I removed the stale mac OS entries after install and set BootOrder to FFFF.

Thanks for the help!


Last edited by exuberantmonkey on Thu Apr 13, 2023 11:28 pm; edited 1 time in total
Back to top
View user's profile Send private message
exuberantmonkey
n00b
n00b


Joined: 09 Apr 2023
Posts: 19

PostPosted: Thu Apr 13, 2023 11:16 pm    Post subject: Reply with quote

oh I understand now what you meant by the fallback path

so I ran this to create a Boot0000 entry referring to \EFI\gentoo\grubia32.efi:

Code:
efibootmgr -c -d /dev/sda -p 1 -L "Gentoo Linux" -l '\EFI\gentoo\grubia32.efi'


but when I reboot and run efibootmgr, it still reports BootCurrent as FFFF.

The efibootmgr wiki page shows use of both \EFI\Grub\grubx64.efi and \efi\boot\bootx64.efi, so it is unclear which to use for the official boot entry.

I delete the Boot0000 entry just created, and ran this to create a Boot0000 entry referring to \EFI\BOOT\BOOTIA32.efi.

Code:
efibootmgr -c -d /dev/sda -p 1 -L "Gentoo Linux" -l '\EFI\BOOT\BOOTIA32.efi'


And now when I boot, BootCurent is 0000.

Should I copy that BOOTIA32.efi to the gentoo folder and use that?
Back to top
View user's profile Send private message
sMueggli
Guru
Guru


Joined: 03 Sep 2022
Posts: 374

PostPosted: Fri Apr 14, 2023 9:05 am    Post subject: Reply with quote

Without the output of
Code:
efibootmgr
it is a bit hard to follow you.

You can try to change the boot order with
Code:
efibootmgr -o 0000,FFFF,0005,0003


But you should check the boot order again after a reboot. If the boot order is not persistent, then you should go inside the UEFI settings and find a way to modify the boot order from the UEFI settings.

No, you should not copy around files (you can copy the file into your home folder to always have a working efi binary at hand). If you start with manual interactions, you have to reexecute the actions again in a few months.
Both binaries (\EFI\BOOT\BOOTIA32.efi and \EFI\gentoo\grubia32.efi) should have the same sha256sum, so copying files around does not change the behaviour. If the checksums are different, we can further investigate.

You can check that the timestamp of \EFI\gentoo\grubia32.efi changes after a successful "grub-install".
Back to top
View user's profile Send private message
exuberantmonkey
n00b
n00b


Joined: 09 Apr 2023
Posts: 19

PostPosted: Fri Apr 14, 2023 5:56 pm    Post subject: Reply with quote

This is the efibootmgr output:

Code:
BootCurrent: 0000
Timeout: 5 seconds
BootOrder: 0000,FFFF
Boot0000* Gentoo Linux   HD(1,GPT,06dafb9e-6289-ce46-880b-f16c64d24911,0x800,0x80000)/File(\EFI\BOOT\BOOTIA32.EFI)
BootFFFF*    PciRoot(0x0)/Pci(0x1f,0x2)/Sata(2,0,0)/HD(1,GPT,06dafb9e-6289-ce46-880b-f16c64d24911,0x800,0x80000)/File(\EFI\BOOT\BOOTIA32.efi)


When I reinstall, using

Code:
grub-install -v --target=i386-efi --efi-directory=/boot --removable


the timestamp of /boot/EFI/BOOT/BOOTIA32.efi changes, but the timestamp of /boot/EFI/gentoo/grubia32.efi does NOT change.

I confirmed that both these efi binaries have the same sha256sum (as do the copies just named grub.efi in both directories).

When I create an additional boot entry for grubia32.efi, it is added as Boot0001 and placed first in the boot order. And yet, after I boot, BootCurrent is still 0000, the BOOTIA32.efi entry. I do not get a boot menu for these options -- the iMac firmware presumably chooses.

Code:
BootCurrent: 0000
Timeout: 5 seconds
BootOrder: 0001,0000,FFFF
Boot0000* Gentoo Linux   HD(1,GPT,06dafb9e-6289-ce46-880b-f16c64d24911,0x800,0x80000)/File(\EFI\BOOT\BOOTIA32.EFI)
Boot0001* Gentoo Linux   HD(1,GPT,06dafb9e-6289-ce46-880b-f16c64d24911,0x800,0x80000)/File(\EFI\gentoo\grubia32.efi)
BootFFFF*    PciRoot(0x0)/Pci(0x1f,0x2)/Sata(2,0,0)/HD(1,GPT,06dafb9e-6289-ce46-880b-f16c64d24911,0x800,0x80000)/File(\EFI\BOOT\BOOTIA32.efi)
Back to top
View user's profile Send private message
sMueggli
Guru
Guru


Joined: 03 Sep 2022
Posts: 374

PostPosted: Sat Apr 15, 2023 9:49 am    Post subject: Reply with quote

exuberantmonkey wrote:
This is the efibootmgr output:

Code:
BootCurrent: 0000
Timeout: 5 seconds
BootOrder: 0000,FFFF
Boot0000* Gentoo Linux   HD(1,GPT,06dafb9e-6289-ce46-880b-f16c64d24911,0x800,0x80000)/File(\EFI\BOOT\BOOTIA32.EFI)
BootFFFF*    PciRoot(0x0)/Pci(0x1f,0x2)/Sata(2,0,0)/HD(1,GPT,06dafb9e-6289-ce46-880b-f16c64d24911,0x800,0x80000)/File(\EFI\BOOT\BOOTIA32.efi)


When I reinstall, using

Code:
grub-install -v --target=i386-efi --efi-directory=/boot --removable


the timestamp of /boot/EFI/BOOT/BOOTIA32.efi changes, but the timestamp of /boot/EFI/gentoo/grubia32.efi does NOT change.

That is to be expected. Without the "--removable" it should be the other way round.


exuberantmonkey wrote:

When I create an additional boot entry for grubia32.efi, it is added as Boot0001 and placed first in the boot order. And yet, after I boot, BootCurrent is still 0000, the BOOTIA32.efi entry. I do not get a boot menu for these options -- the iMac firmware presumably chooses.


I do not have any noticeable experience with Mac. But you are not alone with the problem: https://davidjb.com/blog/2015/06/configuring-refind-boot-manager-as-your-startup-disk-on-a-mac/
Back to top
View user's profile Send private message
exuberantmonkey
n00b
n00b


Joined: 09 Apr 2023
Posts: 19

PostPosted: Sat Apr 22, 2023 6:44 pm    Post subject: Reply with quote

After rebuilding the kernel to change some settings, I ran grub-install without the --removable option. Worked without issue this time (during the original install it hung, perhaps a system glitch after hours of building linux?). And now Boot0000 points to \EFI\gentoo\grubia32.efi.

Code:
BootCurrent: 0000
Timeout: 5 seconds
BootOrder: 0000,FFFF
Boot0000* gentoo   HD(1,GPT,06dafb9e-6289-ce46-880b-f16c64d24911,0x800,0x80000)/File(\EFI\gentoo\grubia32.efi)
BootFFFF*    PciRoot(0x0)/Pci(0x1f,0x2)/Sata(2,0,0)/HD(1,GPT,06dafb9e-6289-ce46-880b-f16c64d24911,0x800,0x80000)/File(\EFI\BOOT\BOOTIA32.efi)


Still cannot boot without disabling mode setting in the kernel startup flags. Now I'm trying to rebuild the kernel with firmware for ATI X1600 included to see whether it makes a difference to enable mode setting.
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