Booting FreeBSD 12 on an iMac

outpaddling

Member

Reaction score: 17
Messages: 71

I recently installed FreeBSD 12.0 on two older iMacs. dmidecode info from one of them:

BIOS Information
Vendor: Apple Inc.
Version: IM91.88Z.008D.B08.0904271717
Release Date: 04/27/09
ROM Size: 4096 kB
Characteristics:
PCI is supported
BIOS is upgradeable
BIOS shadowing is allowed
Boot from CD is supported
Selectable boot is supported
ACPI is supported
IEEE 1394 boot is supported
Smart battery is supported
Function key-initiated network boot is supported
BIOS Revision: 0.1

Handle 0x000F, DMI type 1, 27 bytes
System Information
Manufacturer: Apple Inc.
Product Name: iMac9,1
Version: 1.0
Serial Number: H00126VQDWY

Installation proceeded without any issues on both of them and both will boot FreeBSD without any 3rd party boot menu (just hold Alt/Option during startup and select the FreeBSD partition from the bootable icons that appear.

Only problem is I cannot figure out how to select FreeBSD as the startup disk. It does not appear as an option when choosing a startup disk in OS X System Preferences and the bless commands I've found on the web don't help either.

Anyone know if this is possible and how to do it?

Thanks,

Jason
 

Beastie7

Well-Known Member

Reaction score: 157
Messages: 401

You may need to change the EFI boot manager entirely to do this. To my knowledge, the default EFI boot manager on macs doesn't support non-macOS systems as the startup disk. If Apple provided boot camp support for FreeBSD then you should be able to select your newly created partition as the startup disk from system preferences - but that's yet to be seen.

Something like rEFInd would need to be installed first for you to do something like this.
 

NapoleonWils0n

Active Member

Reaction score: 34
Messages: 112

I recently installed FreeBSD 12.0 on two older iMacs. dmidecode info from one of them:

BIOS Information
Vendor: Apple Inc.
Version: IM91.88Z.008D.B08.0904271717
Release Date: 04/27/09
ROM Size: 4096 kB
Characteristics:
PCI is supported
BIOS is upgradeable
BIOS shadowing is allowed
Boot from CD is supported
Selectable boot is supported
ACPI is supported
IEEE 1394 boot is supported
Smart battery is supported
Function key-initiated network boot is supported
BIOS Revision: 0.1

Handle 0x000F, DMI type 1, 27 bytes
System Information
Manufacturer: Apple Inc.
Product Name: iMac9,1
Version: 1.0
Serial Number: H00126VQDWY

Installation proceeded without any issues on both of them and both will boot FreeBSD without any 3rd party boot menu (just hold Alt/Option during startup and select the FreeBSD partition from the bootable icons that appear.

Only problem is I cannot figure out how to select FreeBSD as the startup disk. It does not appear as an option when choosing a startup disk in OS X System Preferences and the bless commands I've found on the web don't help either.

Anyone know if this is possible and how to do it?

Thanks,

Jason
Hi Mate

I wrote a guide on how to bless the efi partition on the mac so it boots into Freebsd automatically after 3 or 4 seconds,
without having to hold down alt

If you install Freebsd 12 with the bios+uefi option it should automatically boot into Freebsd

Im pretty sure you can't use the OSX System Preferences to set Freebsd as the start up disk,
you need to bless the efi partition
 
OP
OP
O

outpaddling

Member

Reaction score: 17
Messages: 71

That's awesome, thanks! I assume this same procedure should work on a dual-booted system, Mac OS X and FreeBSD on the same hard disk. One of my iMacs is FreeBSD-only, so I'll try this trick to eliminate the 30-second delay. On the other I shrunk the El Capitan partition via Disk Utility and installed FreeBSD on the freed up space. Problem is it won't boot into recover mode from the hard disk. :-/ Not sure when I'll have time to go at this again, but I'll follow up if I discover anything new.
 

NapoleonWils0n

Active Member

Reaction score: 34
Messages: 112

That's awesome, thanks! I assume this same procedure should work on a dual-booted system, Mac OS X and FreeBSD on the same hard disk. One of my iMacs is FreeBSD-only, so I'll try this trick to eliminate the 30-second delay. On the other I shrunk the El Capitan partition via Disk Utility and installed FreeBSD on the freed up space. Problem is it won't boot into recover mode from the hard disk. :-/ Not sure when I'll have time to go at this again, but I'll follow up if I discover anything new.
Hi Mate

It should work on a dual boot but i havent tried to be honest

The 30 second delay is because there isnt a blessed efi partition and so falls back to legacy boot,
you can hold down option at boot and the freebsd partition will show up and then you can click on it but thats a pain

You can install osx onto a usb stick and then plug that in and hold down alt to boot up from the usb drive
and then use osx on the external drive to bless the efi partition on the internal drive

I helped another user on the forum who had exactly the same problem as you and blessing the efi partition worked for them,
i think they may have been using an iMac as well

Let me know if you need any help more than happy to talk you through the steps if you get stuck
 
OP
OP
O

outpaddling

Member

Reaction score: 17
Messages: 71

Thanks, I'm good. I know exactly what you're saying. They only thing I hadn't realized is that you have to disable SIPS for the bless command to work. Waiting 30-seconds for a reboot once a month doesn't really bother me. The inability to boot FreeBSD by default on the dual-booted system is an issue, though. I was also unable to install refind because I could not boot into recovery mode and disable SIPS, so my next step is to fix the recovery mode issue regardless. I think this is purely an OS X issue. Thanks again...
 

NapoleonWils0n

Active Member

Reaction score: 34
Messages: 112

Thanks, I'm good. I know exactly what you're saying. They only thing I hadn't realized is that you have to disable SIPS for the bless command to work. Waiting 30-seconds for a reboot once a month doesn't really bother me. The inability to boot FreeBSD by default on the dual-booted system is an issue, though. I was also unable to install refind because I could not boot into recovery mode and disable SIPS, so my next step is to fix the recovery mode issue regardless. I think this is purely an OS X issue. Thanks again...
HI Mate

You can't boot into the recovery partition on your dual boot set up,
what you can do is install osx onto a usb drive or thumb stick, that will create a recovery partition on the external usb drive
which you can use to disable sips

The other thing you can do is create a bootable usb installer for the mac,
which you can boot up from and then use the terminal in the installer to disable sips and bless the efi partition

heres the apple documentation on how to create a bootable usb installer

Plug in the usb drive hold down alt and boot into the mac osx installer,
what you do is go to the screen where it ask you to select the drive to install osx onto to

In the menu at the top of the screen there is an option to open the terminal,
which you can use to disable sips and bless the efi partition, after you bless the efi partition you can re enable sips if you want

Then you exit the mac osx installer without installing mac osx and reboot and freebsd should boot automatically
 
OP
OP
O

outpaddling

Member

Reaction score: 17
Messages: 71

Finally had a chance to look into this. It's been a brutal month...

Here's a log of exactly what I did:

In FreeBSD, run
gpart list
to determine EFI partition (disk 0, partition 1 in this case)
Boot from installer USB (El Capitan)
Immediately open Terminal from utilities menu (no need to go to disk selection screen)
csrutil disable
Quit Terminal
Restart from Apple menu
Boot into installer USB again
Open Terminal
mkdir /Volumes/ESP
mount -t msdos /dev/disk0s1 /Volumes/ESP
bless --mount /Volumes/ESP --setBoot --file /Volumes/ESP/efi/boot/BOOTx64.efi -
umount /Volumes/ESP

Note that case differs from your instructions. This is what shell autocomplete produced. It probably doesn't matter since it's an MSDOS filesystem.
Quit Terminal
Restart from Apple menu - no immediate boot
Power off, power on - booted FreeBSD with no delay

Thanks very much for providing the detailed instructions!
 
Top