Skip to main content

Kernel setup

The PS5 kernel is stock Linux plus one patch file and a config. Two repositories carry it:

RepositoryWhat it isGet it as
rmuxnet/ps5-linux-patches-1A fork on a newer stable kernel. Nearly everything in upstream main plus CPU and GPU clock drivers for the base PS5 and the Pro, its own Bluetooth patches, the IW620 Wi-Fi driver built in, and build.sh.A zip with install.sh from its releases, or build.sh on the PS5.
ps5-linux/ps5-linux-patchesThe official patch set. Every push to main becomes a packaged release with the fan curve, the HDMI work, the Pro GPU and VCN..deb, .pkg.tar.zst and .rpm packages, or the package repository.

rmuxnet's repository is a fork of the official one and its work is merged upstream over time. Use it unless you need the package manager route; the two differ in the details listed under What is where. What the version strings and branches mean, and how to apply single patches on top, is on Kernel sources and patches. PS5 Bazzite Deck has its own kernel and update process, see its release notes.

The loader always starts the kernel (bzImage) and initrd (initrd.img) from the FAT32 partition of the USB drive, labelled boot and usually mounted at /boot/efi (or /efi on Bazzite). Whatever way you install a kernel, it has to end up there.

M.2 installs

A kernel update on an M.2 install has left some users with a black screen or a kernel that doesn't match its modules. Read Error messages before you update one.

Install rmuxnet's release​

Download the release zip from the releases page (about 45 MB) and run its installer on the PS5:

unzip ps5-linux-<version>.zip
cd ps5-linux-<version>
sudo ./install.sh

Then cold boot the PS5 (power off, start it, run the loader). The script:

  • copies the modules to /lib/modules/<version> and the kernel to /boot,
  • builds the initrd with mkinitcpio, update-initramfs or dracut, whichever the distro has,
  • writes /etc/modprobe.d/ps5-iw620.conf for the Marvell IW620 Wi-Fi driver that comes with the kernel, and copies its firmware from the boot partition (lib/nxp/pcieuartiw620_combo_v1.bin) to /lib/firmware/nxp/ when it is there, so the internal Wi-Fi works without ps5-linux-mwifiex,
  • finds the mounted partition that holds bzImage and asks you to confirm it (or pass the path: sudo ./install.sh /boot/efi),
  • backs the old bzImage and initrd.img up to /boot/efi-backup/<date> (the last three are kept) and copies the new ones in.

To roll back, copy the backup over the files on the boot partition and cold boot again:

sudo cp /boot/efi-backup/<date>/bzImage /boot/efi/bzImage
sudo cp /boot/efi-backup/<date>/initrd.img /boot/efi/initrd.img
sync

The release is built with Clang, full LTO and -march=znver2 (the PS5's Zen 2 cores); it is a kernel for the PS5, not for an ordinary PC.

PS5 Pro

install.sh doesn't copy the Pro's GPU firmware into the initrd. Put the eight viola_*.bin files in /lib/firmware/amdgpu/ before you run it, see PS5 Pro. Not tested by the wiki editors with this installer.

Build with build.sh​

build.sh builds the same kernel on the PS5 itself. It clones Linux, applies the patch, builds with Clang, installs the modules and deploys to the boot partition with the same backup as install.sh. A full build takes a long time on the console; the source tree stays in ../linux, so the next one is faster.

Dependencies​

sudo apt install build-essential bc bison flex libssl-dev libelf-dev libncurses-dev dwarves git clang lld llvm ccache

Build​

git clone https://github.com/rmuxnet/ps5-linux-patches-1 ps5-linux-patches
cd ps5-linux-patches
./build.sh

The script asks whether the partition it found with bzImage on it is the right one. Press Enter to use it, or n to type the path. Cold boot when it is done. Roll back as above; the script prints the backup folder.

All options are in build.cfg. Copy it to your own file and pass that to build.sh to change them:

OptionDefaultWhat it does
KERNEL_REFThe tag the patch set targetsThe kernel tag to build. Point releases come from the stable tree, release tags from mainline.
LTOfullfull, thin or none. Full LTO needs the most memory.
MARCH, MTUNEznver2CPU flags. Keep them for the PS5.
CCACHEyCaches object files in ~/.cache/ccache so rebuilds are faster.
SWAP_GBautoAdds a swap file for the build: 10 GB with full LTO, 6 GB with thin, none without.
EFI_DIRautoThe boot partition. Set it to skip the question.
DEPLOY_EFIyn builds and installs the modules without touching the boot partition.

The Wi-Fi driver for the Marvell IW620 (NXP mwifiex, already patched for the kernel version) is in oot/mwifiex and is built with the kernel. Nothing else is needed for Wi-Fi.

Build by hand​

Without the script, the steps are the usual ones. The .config is made with Clang, so always pass LLVM=1, and keep the folder name ps5-linux-patches: the config loads the VCN firmware from ../ps5-linux-patches/firmware. Use the kernel tag named in the first lines of .config.

git clone https://github.com/rmuxnet/ps5-linux-patches-1 ps5-linux-patches
git clone --depth 1 --branch <kernel-tag> https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
cd linux
git apply ../ps5-linux-patches/linux.patch
cp ../ps5-linux-patches/.config .config
make LLVM=1 olddefconfig
make LLVM=1 -j$(nproc)
sudo make LLVM=1 INSTALL_MOD_STRIP=1 modules_install

For Wi-Fi, copy the driver into the tree before you build:

cp -a ../ps5-linux-patches/oot/mwifiex drivers/net/wireless/nxp-wlan
sed -i 's/\$(CONFIG_NXP_WLAN_DRIVER)/m/g' drivers/net/wireless/nxp-wlan/Makefile
echo 'obj-m += nxp-wlan/' >> drivers/net/wireless/Makefile

The same steps work for upstream ps5-linux-patches (clone that repository instead; its .config is for GCC, so LLVM=1 is optional there, and it has no oot/ driver).

Keep the initrd small

INSTALL_MOD_STRIP=1 installs the modules without debug symbols. Without it an amdgpu.ko is hundreds of megabytes, the initrd grows accordingly and boot is slow.

Copy the kernel to the boot partition​

make install doesn't put anything where the loader looks. Build the initrd for the new kernel, back up the current files on the boot partition and copy the new ones in. Run this from the linux folder:

KVER=$(make -s kernelrelease LLVM=1)
sudo update-initramfs -c -k "$KVER"
sudo cp /boot/initrd.img-$KVER /tmp/initrd.img
sudo mv /boot/efi/bzImage /boot/efi/bzImage.old
sudo mv /boot/efi/initrd.img /boot/efi/initrd.img.old
sudo cp arch/x86/boot/bzImage /boot/efi/bzImage
sudo cp /tmp/initrd.img /boot/efi/initrd.img
sync

If the new kernel doesn't boot, rename the .old files back from another computer (the boot partition is FAT32, so any PC can open it).

Install upstream's packaged kernel​

The official repository publishes .deb, .pkg.tar.zst and .rpm packages on its releases page for every commit on main. The easiest way to get them is the package repository: it installs the kernel with your package manager, copies it to the boot partition for you and keeps it up to date. Or install a downloaded package by hand:

sudo dpkg -i linux-ps5_*.deb

A current package brings the fan curve and the GPU governor; the CPU boost still needs ps5_control from ps5-linux-tools, the IW620 Wi-Fi needs ps5-linux-mwifiex (the package repository bundles it), and the Slim's and Pro's Bluetooth fixes aren't upstream.

Build a kernel for Bazzite Game Mode​

Bazzite's Game Mode starts Steam through the cardwired service, which loads an eBPF program. That needs two kernel features:

  1. The BPF LSM. CONFIG_BPF_LSM=y is set in both configs, but bpf is missing from CONFIG_LSM, so it never activates. Add bpf to CONFIG_LSM, or add lsm=landlock,lockdown,yama,integrity,apparmor,bpf to cmdline.txt.
  2. Kernel BTF. CONFIG_DEBUG_INFO_BTF=y is in both current configs. Check that /sys/kernel/btf/vmlinux exists; older configs need it turned on.

Without them, cardwired crash-loops with CardwireEbpfError(LSMNotEnabled) or error parsing /sys/kernel/btf/vmlinux, Gamescope is killed a second after it starts, and after five attempts Bazzite drops you to the desktop. PS5 Bazzite Deck applies both changes.

What is where​

"Upstream" is ps5-linux/ps5-linux-patches main and its packages. The table is a snapshot; the pull requests upstream and the changelogs of the other two are the running record.

ChangeUpstream mainrmuxnet's kernelPS5 Bazzite Deck
HDR on FLAVA3, HDMI CEC, display hotplug✅✅✅
USB-C DisplayPort output, off by default✅✅✅
PS5 Pro GPU with the Viola firmware✅✅✅
Native FRL for 4K120 with 4:2:0 fallback and ALLM, on by default✅✅❌ Own 4K120 path, see Display and HDMI
GPU clock governor with ps5_gpufreq.temp_limit✅❌ Replaced by ps5-gpufreq, see GPU✅
GFX1013 MMIO TLB flush and GFXOFF guard✅❌ Dropped✅
hwmon fan driver✅ Curve on by default✅ Curve on by default✅ Firmware mode by default, see Fan control
CPU and GPU clock drivers ps5-cpufreq, ps5-gpufreq, with the Pro's clock range❌✅⚠️ ps5-cpufreq only, kept off on the Pro
Slim MediaTek Wi-Fi driver in the config✅✅✅
Slim and Pro MediaTek Bluetooth, IW620 L2CAP fix❌ Only the IW620 quirks entry⚠️ A different Bluetooth patch, reported broken by its author✅
IW620 Wi-Fi driver built with the kernel❌✅✅
UVC webcams, Logitech wheel force feedback❌✅✅ (wheels)
VRR, RGB range flag, display link lock, 100 Hz test modes❌❌✅
Suspend-to-idle❌❌ Open pull request✅

Still listed as to do in both repositories: an amdgpu SMU driver so the base PS5 reports its GPU frequency and temperature correctly. Known bugs in both: the screen saver doesn't work, and HDMI audio and 1440p or 4K output fail on some monitors.

Kernel parameters (cmdline.txt)​

All kernel parameters, the default lines and how to edit cmdline.txt and vram.txt are on Boot options.