Jump to content

Generic Apple Mac (generic-apple-mac)

From postmarketOS Wiki
Apple Apple M-series Macs
Apple M-series Mac devices running postmarketOS
Apple M-series Mac devices running postmarketOS
Manufacturer Apple
Name Apple M-series Macs
Codename generic-apple-mac
Model Various (MacBooks, Mac Mini)
Released 2020
Type generic
Hardware
Chipset Apple M1
Apple M2
Apple M3
Apple M4
CPU ARM64 (4-12 cores
varies by model)
GPU Apple GPU (7-40 cores, varies by model)
Display Varies by model (13.3" to 32" displays, or headless)
Storage 256GB-8TB SSD (varies by model)
Memory 8GB-128GB unified memory (varies by model)
Architecture aarch64
Software
Original software
The software and version the device was shipped with.
macOS 11.0+ (varies by model)
Extended version
The most recent supported version from the manufacturer.
macOS
FOSS bootloader yes
postmarketOS
Category testing
Pre-built images
Whether pre-built images are available here.
no
Mainline
Instead of a Linux kernel fork, it is possible to run (Close to) Mainline.
yes
Device package device-generic-apple-mac
Kernel package linux-linux-asahi
Firmware package -
Initial MR
Initial merge request.
pmaports!7048
Features
Battery
Charging and battery level reporting works
Works
Screen
Display works. Ideally with sleep mode and brightness control.
Works
Keyboard
Build in physical keyboard
Works
Touchpad
Build in Touchpad
Works
Multimedia
3D Acceleration
Works
Audio
Audio playback, microphone, headset and buttons.
Partial
Camera
Works
Connectivity
WiFi
Works
Bluetooth
Works
Miscellaneous
FDE
Full disk encryption and unlocking with unl0kr.
Partial
USB-A
Full-sized USB-A port works (Usually applicable to SBCs and laptops).
Works
HDMI/DP
Video and audio output with HDMI or Display Port works.
Partial
U-Boot
Secondary Bootloader
It is possible to chainload U-Boot from stock bootloader.
Works
Mainline
Latest versions of U-Boot are not broken and it is possible to use them.
Works
Internal Storage
It is possible to boot from internal storage (e.g. eMMC or UFS).
Works
USB Host
It is possible to boot from a USB storage or connect a keyboard.
Works
USB Peripheral
It is possible to use device as a peripheral in U-Boot, e.g. for fastboot mode.
Works
Display
Works
Keyboard
Works
Note Note: This is a generic device package that supports multiple Apple M-series Mac models.
Note Note:For Intel-based Apple Mac support see the Generic x86 64 (generic-x86 64) port

Contributors

Users owning this device

  • Craftyguy (Notes: MacBook Air 13in M2 24GB 2TB)


Supported Models

This generic device package has only been tested on a very limited number of models, however in theory it should work with devices supported by the Asahi Linux project. For up to date status, see the Asahi Linux documentation for supported models and features.

Installation

Prerequisites

Before installing postmarketOS, you need to set up a basic UEFI environment using the Asahi Linux installer:

  1. Run the Asahi installer from macOS
  1. Choose the "UEFI only" installation option
  1. Allocate desired space for Linux

Using pmbootstrap

Warning WARNING: Do not use pmbootstrap install --disk or otherwise cat/dd the image created by pmbootstrap to install postmarketOS to the local storage device! Doing so will overwrite required Apple/APFS partitions and will require wiping the disk to recover. You have been warned!

Follow Installation/Using pmbootstrap. When asked for the device's vendor/codename, select generic as the vendor and apple-mac as the codename.

External Boot (USB)

postmarketOS can be booted from USB drives:

  1. Create a bootable USB stick:
$ pmbootstrap install --disk /path/to/usb/stick
  1. Reboot, U-Boot should detect and boot from the USB stick if there is no other Linux OS installed to local storage.

If U-boot fails to find the USB stick, try running usb reset from the U-Boot command-line.

If there is another Linux OS installed to local storage and U-Boot boots it instead of the USB stick, you can use the `eficonfig` utility from the U-Boot command-line to change the EFI boot order in U-Boot so that it tries to boot from USB first.

Note Note: Support for using the OS Installer is WIP

MacOS / Recovery APFS Restoration

idevicerestore can be used to recover MacOS and the recovery APFS partition, e.g. if they are accidentally wiped:

$ doas apk add idevicerestore

There's an excellent guide for how to enter DFU mode and use idevicerestore on the Fedora remix wiki.

Bootloader

Apple M-series Macs use a complex boot chain: Apple firmware → m1n1 stage 1 → m1n1 stage 2 → U-Boot → systemd-boot/GRUB → Linux

m1n1

m1n1 is the bootloader developed by the Asahi Linux project to bridge Apple's boot ecosystem to standard Linux boot. It performs hardware initialization and chainloads U-Boot. This is packaged in Alpine Linux as m1n1.

U-Boot

U-Boot provides UEFI services and can boot from external media. It enables standard PC-like boot behavior. This is packaged in Alpine Linux as u-boot-asahi.

See also