# Fairydust kernel package for Asahi Arch (ALARM)

These are the three files I used to build and install a patched `linux-asahi`
kernel with USB-C DisplayPort Alt Mode on a MacBook Pro M1 (J293), packaged for
pacman so the stock kernel stays installed as a rescue entry.

They accompany the post
[Omarchy 4 on Asahi Arch: Every Trap I Hit on an M1 MacBook](https://grzegorzsmajdor.com/blog/2026-omarchy-asahi-arch-m1/).

| File | What it does |
| --- | --- |
| `PKGBUILD` | Builds `linux-asahi-fairydust`, pinned to Asahi 7.1.6-1, with a distinct `localversion` so it installs beside stock `linux-asahi` |
| `build-and-install.sh` | Checks the hardware and free space, installs build dependencies and the pinned Rust toolchain, runs `makepkg`, installs the package, rebuilds the initramfs, updates m1n1 with the patched DTBs and regenerates the GRUB menu |
| `verify.sh` | Run after rebooting into the new kernel: one OK/FAIL line per piece of hardware |

## Two files you have to produce yourself

The `PKGBUILD` expects two more files next to it, neither of which is mine to
redistribute.

**`config`** — the kernel configuration. Start from the stock Asahi one on a
machine already running `linux-asahi`:

```bash
zcat /proc/config.gz > config
```

The `PKGBUILD` then enables `TYPEC_NVIDIA_ALTMODE` and `TYPEC_TBT_ALTMODE` as
modules on top of it.

**`fairydust.patch`** — the Alt Mode work from the Asahi Linux project's
[`fairydust` branch](https://github.com/AsahiLinux/linux/tree/fairydust). It is
their code, so generate it from their tree rather than copying it from a blog:

```bash
git clone https://github.com/AsahiLinux/linux.git
cd linux
git diff asahi-7.1.6-1..origin/fairydust > ../fairydust.patch
```

At the time of writing that was 13 commits touching the Apple device trees. Then
refresh the checksums, because `PKGBUILD` pins them:

```bash
updpkgsums   # from pacman-contrib
```

## Before you run it

- **The version pin is deliberate.** This builds against Asahi `7.1.6-1` exactly.
  When stock `linux-asahi` moves on, bump `_rcver`/`_asahirel`, regenerate the
  patch, and expect it to need rework — the patch may simply not apply.
- **The hardware guard is for a J293** (MacBook Pro 13-inch M1). On any other
  Mac, change that check in `build-and-install.sh` and confirm your model is
  covered by the patch.
- **Budget 1–3 hours and ~35 GiB** of free space, and keep the machine plugged in.
- **Do not uninstall the stock kernel.** The whole point of packaging this is
  that GRUB lists both, so a failed boot is one menu entry away from recovery.

Licensed GPL-2.0, matching the kernel it builds.
