Skip to content

Instantly share code, notes, and snippets.

@discapes
Created January 24, 2026 23:05
Show Gist options
  • Select an option

  • Save discapes/f5299ef27893737a9f1b4516293b9993 to your computer and use it in GitHub Desktop.

Select an option

Save discapes/f5299ef27893737a9f1b4516293b9993 to your computer and use it in GitHub Desktop.

Here's how to compile and install the fairydust branch of the Asahi Linux kernel, to test out experimental DisplayPort over USB-C support. I wrote this for Gentoo, though it can be adapted for Asahi Fedora Remix, too.

  1. Clone the sources
git clone -b fairydust --single-branch --depth 1 https://github.com/AsahiLinux/linux.git
cd linux
  1. Read the current kernel config into .config. I recommend updating and booting to the same Linux release that fairydust is based on, in my case 6.18.5.
gunzip -c /proc/config.gz > .config
# alternatively: cat /boot/config-6.18.5-p1-asahi-dist > .config
  1. Edit CONFIG_LOCALVERSION to uniquely identify the kernel that we are going to build, specifically setting the suffix of the kernel release. You can check the currently booted kernel release with uname -r. It also determines the filename of the kernel (e.g. vmlinuz-6.18.5-asahi-fairydust), the initramfs and the path to the modules directory.
sed -i 's/CONFIG_LOCALVERSION=.*/CONFIG_LOCALVERSION="-asahi-fairydust"/' .config
  1. Compile the kernel. Here nproc gives the amount of cores to make. We set LOCALVERSION= to avoid the default behaviour of a '+' being appended to the kernel release if the current git commit isn't tagged.
make LOCALVERSION= -j$(nproc)
  1. Install the kernel and modules. Note the order, modules_install must be first.
sudo make INSTALL_MOD_STRIP=1 modules_install install
  1. Look at /usr/bin/update-m1n1. As described by the Asahi Linux docs, it runs something roughly equivalent to cat build/m1n1.bin /path/to/dtbs/*.dtb /path/to/uboot/u-boot-nodtb.bin > /boot/efi/m1n1/boot.bin. The important thing to know is that the Linux kernel requires device tree blobs generated from the current kernel sources. At least on Gentoo, you don't need to install them to /usr/lib/modules/*/dtb or anything like that, since update-m1n1 copies the files from the location defined in /etc/default/update-m1n1, which for me is /usr/src/linux/arch/arm64/boot/dts/apple/*.dtb. Therefore, we need /usr/src/linux to point to the source tree that we just cloned on the fairydust branch, before running update-m1n1. Note, this is the step that might be different for Asahi Fedora users.
sudo unlink /usr/src/linux
sudo ln -s $PWD /usr/src/linux
ls -l /usr/src/linux
sudo update-m1n1
  1. Update the grub config to use the newly built kernel. By default it picks the kernel for the first 'Gentoo GNU/Linux' menuentry based only on the alphabetical/numeric order of the kernel name, but we can override this by setting GRUB_TOP_LEVEL.
echo 'GRUB_TOP_LEVEL="/boot/vmlinuz-6.18.5-asahi-fairydust"' | sudo tee -a /etc/default/grub
sudo grub-mkconfig -o /boot/grub/grub.cfg
  1. Reboot. uname -r should now show 6.18.5-asahi-fairydust, and you should be able to connect to monitors that support DisplayPort over USB-C.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment