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.
- Clone the sources
git clone -b fairydust --single-branch --depth 1 https://github.com/AsahiLinux/linux.git
cd linux- 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- Edit
CONFIG_LOCALVERSIONto 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 withuname -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- Compile the kernel. Here
nprocgives the amount of cores tomake. We setLOCALVERSION=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)- Install the kernel and modules. Note the order, modules_install must be first.
sudo make INSTALL_MOD_STRIP=1 modules_install install- Look at
/usr/bin/update-m1n1. As described by the Asahi Linux docs, it runs something roughly equivalent tocat 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/*/dtbor 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/linuxto 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- 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- Reboot.
uname -rshould now show6.18.5-asahi-fairydust, and you should be able to connect to monitors that support DisplayPort over USB-C.