Flux Linux Apple Silicon bootloader, based on m1n1.
  • Python 50.3%
  • C 43.5%
  • Rust 4.9%
  • Assembly 0.7%
  • Linker Script 0.3%
  • Other 0.3%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Cody Ho 7243b815c4 m1n1: clear the PMU panic counter on boot
I am very tired of crashing to recovery breaking my unattended LLM
loops.

Assisted-By: LLM
Signed-off-by: Cody Ho <codyho@stanford.edu>
2026-10-07 16:53:04 -07:00
.github CI: release: Change name of m1n1 stage2 release artifact 2026-08-13 14:33:08 -07:00
3rdparty_licenses Use Gravity Linux artwork for embedded boot logos 2026-09-18 21:49:57 -04:00
artwork@e613a87e52 Pin bootloader artwork submodule to licensed Gravity artwork 2026-09-15 18:10:35 -07:00
data Use Gravity Linux artwork for embedded boot logos 2026-09-18 21:49:57 -04:00
font convert -> magick 2026-05-04 20:02:10 -07:00
proxyclient license: switch SPDX identifiers to GPL-2.0-or-later 2026-10-07 01:07:02 -07:00
rust rust: prevent implicit libc calls with LLVM 23 2026-10-07 16:52:43 -07:00
src m1n1: clear the PMU panic counter on boot 2026-10-07 16:53:04 -07:00
sysinc license: switch SPDX identifiers to GPL-2.0-or-later 2026-10-07 01:07:02 -07:00
tests/python license: switch SPDX identifiers to GPL-2.0-or-later 2026-10-07 01:07:02 -07:00
tools license: switch SPDX identifiers to GPL-2.0-or-later 2026-10-07 01:07:02 -07:00
udev udev/80-m1n1.rules: Add udev rules 2022-07-30 13:41:38 +09:00
.clang-format rust: Initial Rust-based EFI FAT32 chainloader 2022-03-09 22:01:42 +09:00
.editorconfig .editorconfig: trim trailing whitespace 2021-01-15 04:04:12 +09:00
.gitignore Move creating gpu blobs to m1n1. 2026-01-03 18:18:12 +01:00
.gitmodules artwork: Update to Gravity Linux 2026-09-15 18:09:30 -07:00
CODEOWNERS CODEOWNERS: Add janne and chaos_princess for rust 2025-08-10 15:55:17 +02:00
config.h license: switch SPDX identifiers to GPL-2.0-or-later 2026-10-07 01:07:02 -07:00
docker-compose.yml tooling: Add container setup for build environment 2021-02-18 16:14:15 +09:00
Dockerfile upd: buster to bookworm 2025-08-10 08:35:01 +02:00
LICENSE.GPL2 legal: change license to GPL2 2026-08-13 13:56:49 -07:00
LICENSE.MIT legal: change license to GPL2 2026-08-13 13:56:49 -07:00
m1n1-raw.ld linker-scripts: Discard .ARM.attributes section 2026-05-15 11:11:49 +02:00
m1n1.conf.example mitigations: Add a module to toggle chicken bits for vuln mitigations 2025-01-30 09:57:39 +09:00
m1n1.ld linker-scripts: Discard .ARM.attributes section 2026-05-15 11:11:49 +02:00
Makefile m1n1: clear the PMU panic counter on boot 2026-10-07 16:53:04 -07:00
pytest.ini tests:prepare for pytest 2025-05-10 10:07:08 +02:00
README.md license: switch SPDX identifiers to GPL-2.0-or-later 2026-10-07 01:07:02 -07:00
requirements.ini tests:prepare for pytest 2025-05-10 10:07:08 +02:00
requirements.txt tests:prepare for pytest 2025-05-10 10:07:08 +02:00
version.sh Replace bashisms with posix shell alternatives. 2023-01-13 17:29:15 +09:00

m1n1: A bootloader and experimentation playground for Apple Silicon

Building

You need an aarch64-linux-gnu-gcc cross-compiler toolchain (or a native one, if running on ARM64). You will also need to install the aarch64-unknown-none-softfloat toolchain for rust.

$ rustup target add aarch64-unknown-none-softfloat
$ git clone --recursive https://github.com/AsahiLinux/m1n1.git
$ cd m1n1
$ make

To build on a native ARM64 machine:

  • On Linux, use make ARCH=.
  • On macOS using Homebrew:
$ brew install llvm lld
$ make
  • On macOS using MacPorts:
$ sudo port install llvm clang
$ sudo port select llvm llvm-mp-<version>
$ make

The output will be in build/m1n1.macho.

To build verbosely, use make V=1.

Building using the container setup

If you have a container runtime installed, like Podman or Docker, you can make use of the compose setup, which contains all build dependencies.

$ git clone --recursive https://github.com/AsahiLinux/m1n1.git
$ cd m1n1
$ podman-compose run m1n1 make
$ # or
$ docker-compose run m1n1 make

Usage

Our wiki has more information on how to use m1n1.

To install on an OS container based on macOS <12.1, use m1n1.macho:

kmutil configure-boot -c m1n1.macho -v <path to your OS volume>

To install on an OS container based on macOS >=12.1, use m1n1.bin:

kmutil configure-boot -c m1n1.bin --raw --entry-point 2048 --lowest-virtual-address 0 -v <path to your OS volume>

Payloads

m1n1 supports running payloads by simple concatenation:

$ cat build/m1n1.macho Image.gz build/dtb/apple-j274.dtb initramfs.cpio.gz > m1n1-payload.macho
$ cat build/m1n1.bin Image.gz build/dtb/apple-j274.dtb initramfs.cpio.gz > m1n1-payload.bin

Supported payload file formats:

  • Kernel images (or compatible). Must be compressed or last payload.
  • Devicetree blobs (FDT). May be uncompressed or compressed.
  • Initramfs cpio images. Must be compressed.

Supported compression formats:

  • gzip
  • xz

License

Beginning with and including commit df7656cf17d04ec19de8acb8a78d57cc9b48fda1, fork-authored contributions on this fork's main branch are licensed under the GNU General Public License, version 2 or later (GPL-2.0-or-later). The combined work distributed by this fork from that commit onward is distributed under the GPL version 2 or later, except for components that retain a separate license as described below.

Commits before df7656cf17d04ec19de8acb8a78d57cc9b48fda1 retain the licenses that previously applied to them, including the MIT license. Commits pulled from upstream m1n1, whether before or after that commit, retain their original licenses. This licensing change does not relicense third-party components or other separately licensed material.

  • Copyright Cody Ho
  • Copyright The Asahi Linux Contributors

Please see the Git history for authorship information.

Portions of m1n1 are based on mini:

m1n1 embeds libfdt, which is dual BSD and GPL-2 licensed and copyright:

  • Copyright (C) 2014 David Gibson david@gibson.dropbear.id.au
  • Copyright (C) 2018 embedded brains GmbH
  • Copyright (C) 2006-2012 David Gibson, IBM Corporation.
  • Copyright (C) 2012 David Gibson, IBM Corporation.
  • Copyright 2012 Kim Phillips, Freescale Semiconductor.
  • Copyright (C) 2016 Free Electrons
  • Copyright (C) 2016 NextThing Co.

The ADT code in mini is also based on libfdt and subject to the same license.

m1n1 embeds minlzma, which is MIT licensed and copyright:

  • Copyright (c) 2020 Alex Ionescu

m1n1 embeds a slightly modified version of tinf, which is ZLIB licensed and copyright:

  • Copyright (c) 2003-2019 Joergen Ibsen

m1n1 embeds portions taken from arm-trusted-firmware, which is BSD licensed and copyright:

  • Copyright (c) 2013-2020, ARM Limited and Contributors. All rights reserved.

m1n1 embeds Doug Lea's malloc (dlmalloc), which is in the public domain (CC0).

m1n1 embeds portions of PDCLib, which is in the public domain (CC0).

m1n1 embeds the Source Code Pro font, which is licensed under the OFL-1.1 license and copyright:

  • Copyright 2010-2019 Adobe (http://www.adobe.com/), with Reserved Font Name 'Source'. All Rights Reserved. Source is a trademark of Adobe in the United States and/or other countries.
  • This Font Software is licensed under the SIL Open Font License, Version 1.1.

m1n1 embeds portions of the dwc3 usb linux driver, which was BSD-or-GPLv2 dual-licensed and copyright

m1n1 embeds portions of musl-libc's floating point library, which are MIT licensed and copyright

  • Copyright (c) 2017-2018, Arm Limited.

m1n1 embeds some rust crates. Licenses can be found in the vendor directory for every crate.