Refurbish Mac Mini A1347 (Late 2014) – Part 5 – Install openSUSE

Background:

One of the Mac Minis will be used for KubeSphere in a lab environment and I wanted to experiment with openSUSE. However, due to Macs handles the EFI slight differently, both openSUSE’s default GRUB2 for EFI and GRUB2 Boot Loader configs fail during installation. I’ve experimented with different combination of settings and openSUSE would not boot successfully once the USB drive is removed. Eventually, rEFInd resolved the problem.

Setup:

  • Mac Mini late-2014 (macmini7,1) with 4GB RAM, 256GB SSD.
  • openSUSE Leap 15.5, with “Server” System Role (installed natively via USB, without macOS)
    • Partition layout:
      • /dev/sda1 at /boot/eft
      • /dev/sda2 for / with btrfs
      • /dev/sda3 at swap
    • “Secure Boot” is disabled under Boot Loader Settings, with Secure Boot Support unchecked.
    • “Protective MBR flag” set to “remove” under Boot Loader Settings.

Issue Details:

Installation using GRUB2 for EFI fails with the following error at around 93% when Boot Loader configs are being committed:

Error


Execution of command "[["/usr/sbin/grub2-install","--target=x86_64-efi","--force","--skip-fs-probe"]]" failed.
Exit code: 1
Error output: Installing for x86_64-efi platform.
Could not prepare Boot variable: invalid argument
/usr/sbin/grub2-install: error: efibootmgr failed to register the boot entry: input/output error.

The installation will finish successfully if “Update NVRAM Entry” is unchecked, or use GRUB2 Boot Loader (MBR). However, in both cases, openSUSE is unable to boot successfully without the help of the installation media, the Mac Mini will stuck at the following screen after power-on.

Solution:

The solution is fairly straightforward with the help of rEFInd.

1. Install openSUSE using the following Boot Loader Settings:

  • Boot Loader: GRUB2 for EFI
  • Uncheck Secure Boot Support
  • Uncheck Update NVRAM Entry
  • Protective MBR flag set to remove
  • Partition layout:
    • /dev/sda1 at /boot/eft
    • /dev/sda2 for / with btrfs
    • /dev/sda3 at swap

2. After installation finishes, boot openSUSE using the installation media and select More ... -- Boot Linux System , accept default settings and boot to the shell prompt.

I ran into a minor issue here which my keyboard doesn’t get recognized, but you should be able to use SSH to connect to the machine and perform the remaining steps. I didn’t further troubleshoot the driver issue. Also, I had the Mac Mini hardwired for internet so that I don’t have to load any WiFi drivers, but if you’re performing the steps on a Mac that doesn’t have an RJ45 port, you might need to perform extra steps to load the drivers.

3. Install rEFInd using the following commands:

# become root first just to make things easy.

cd /tmp

zypper refresh

zypper install -y wget unzip

wget https://phoenixnap.dl.sourceforge.net/project/refind/0.14.0.2/refind-bin-0.14.0.2.zip

unzip refind-bin-0.14.0.2.zip

cd refind-bin-0.14.0.2

./refind-install

After the installation finishes, you might see the following message:

ShimSource is none
Installing rEFInd on Linux....
ESP was found at /boot/efi using vfat
Installing driver for btrfs (btrfs_x64.efi)
Copied rEFInd binary files

Copying sample configuration file as refind.conf; edit this file to configure
rEFInd.

Creating new NVRAM entry

ALERT: There were problems running the efibootmgr program! You may need to
rename the refind_x64.efi binary to the default name (EFI/BOOT/bootx64.efi
on x86-64 systems, EFI/BOOT/bootia32.efi on x86 systems, or
EFI/BOOT/bootaa64.efi on ARM64 systems) to have it run!

Creating //boot/refind_linux.conf; edit it to adjust kernel options.

ALERT:
Installation has completed, but problems were detected. Review the output for
error messages and take corrective measures as necessary. You may need to
re-run this script or install manually before rEFInd will work.

If this is the case, perform the following steps:

cd /boot/efi/EFI/

cp -a refind/ BOOT

cd BOOT/

mv refind_x64.efi bootx64.efi

Additionally, if you need to, reset NVRAM using Command/Windows Key + Option/Alt + P + R keys.

Now that you should be able to see the rEFInd boot screen after a reboot, with openSUSE installation media removed. This method should also work for dual boot with macOS, or on other Mac models.