freebsd bless efi partition on mac hardware

NapoleonWils0n

Active Member

Reaction score: 45
Messages: 141

A normal freebsd install on mac hardware uses legacy boot so it takes 30 seconds for the boot screen to appear,
we can bless the efi partition and reduce the start up time to a couple of seconds

Preperation

1 - plug in a usb drive to your mac and then run the mac installer and select your external usb drive to install mac on to
2 - after the install has finished shutdown the mac and press option while you start up and select mac osx on the external drive
3 - after you have booted into mac on the external drive use disk utility to erase the internal drive on the mac which we will use to install freebsd onto

Then shutdown the mac and unplug the external usb drive with mac osx on

Freebsd install

1 - plug in a usb disk drive into the mac and insert the freebsd install cd ( that you created )
2 - hold down option as you start up the mac and you will see 2 disc icons, select the icon that says efi
3 - run the freebsd installer and select encrypted zfs on root

Mac disable sips

After the freebsd install has finished shutdown the mac

1 - plug in the external usb drive with mac osx
2 - hold down option and press the power button then select the recovery partition to boot into recovery mode
3 - after you have booted into recovery mode on the external drive open the utilities menu at the top of the screen and select terminal
4 - disable sips on the mac so we can use the bless command to bless the efi partion

Bash:
csrutil disable
+++
5 - quit the terminal to return to the main recovery mode screen
6 - then select shutdown to shutdown the mac

Mac bless efi partition

Next we need to boot back into mac osx on the external usb drive and bless the efi partition

1 - hold down option and turn on the mac and select mac osx on the external drive
2 - open the terminal on the mac and then run the following command to list disk paritions

Bash:
diskutil list
Look for the efi parition in the list in the terminal it should be /dev/disk0s1

3 - switch to root by running sudo su

Bash:
sudo su
4 - create a mount point called ESP in /Volumes

Bash:
mkdir -p /Volumes/ESP
5 - mount the efi partition you found by running diskutil list, it will have efi next to the drive

Bash:
mount -t msdos /dev/disk0s1 /Volumes/ESP
6 - bless the freebsd efi file

Bash:
bless --mount /Volumes/ESP --setBoot --file /Volumes/ESP/EFI/BOOT/BOOTX64.efi --shortform
7 - unmount the /Volume/ESP and the mounted freebsd efi partition

Bash:
umount /Volumes/ESP
8 - exit root

Bash:
exit
Shutdown the mac and unplug the external usb drive

Freebsd efi boot

now press the power button on the mac and it will boot into freebsd in efi mode straight away instead of using legacy boot
and taking 30 second to boot up
 
Top