Not all tested yet. This fork adds CI on hosted runners, eight more images and the CachyOS Deck UI image. The CachyOS Deck UI image has been tested on a PS5; the other new images and the CI changes have not all been tested.
Builds bootable Linux USB images for PlayStation 5 using Docker containers. Supports Ubuntu 26.04, Arch, CachyOS (Gamescope + Steam), Fedora (GNOME), individually or as a multi-distro image with kexec switching.
- Docker (with permission to run
--privilegedcontainers) — install as per your distro's instructions - ~30GB free disk space for Ubuntu, Arch, or CachyOS
Once Docker is installed, add your user to the docker group and apply it without logging out:
sudo usermod -aG docker $USER
newgrp docker# Build a single Ubuntu 26.04 image
./build_image.sh --distro ubuntu2604
OR
# Build CachyOS (Arch-based, Gamescope + Steam Big Picture)
./build_image.sh --distro cachyos
OR
OR
# Build Fedora (GNOME desktop)
./build_image.sh --distro fedora
OR
# Build a multi-distro image (ubuntu2604 + arch + cachyos)
./build_image.sh --distro allThe script auto-clones the kernel source, applies PS5 patches, compiles, and builds the image. Subsequent runs reuse cached artifacts automatically. Press Ctrl+C at any time to abort cleanly.
sudo dd if=output/ps5-ubuntu2604.img of=/dev/sdX bs=4M status=progress| Flag | Description | Default |
|---|---|---|
--distro |
ubuntu2604, arch, cachyos, fedora, or all |
ubuntu2604 |
--kernel |
Path to kernel source directory | auto-clone version selected by PS5 patch set |
--img-size |
Disk image size in MB | 12000 (32000 for all) |
--clean |
Remove all cached build artifacts and start fresh | off |
--kernel-only |
Build and package the kernel only, then exit | off |
--patches-ref |
Branch, tag, or commit SHA for patches | v1.2 |
The build automatically skips stages that have already completed:
- Kernel source — reused if
work/linux/exists - Kernel packages — reused if
.deb/.pkg.tar.zstfiles exist inlinux-bin/ - Root filesystem — reused if chroot directories are populated
Use --clean to wipe everything and rebuild from scratch. The build will also suggest --clean if a stage fails.
PS5 Linux Image Builder
=======================
Distro: all
(ubuntu2604 arch cachyos)
Image size: 32000MB
Kernel src: /path/to/work/linux
Stages:
1. Kernel cached
2. Root filesystem build
3. Disk image build
Logs: /path/to/build.log
✓ Kernel packages (cached)
✓ Build image builder image
⠹ Building arch rootfs
All verbose output goes to build.log. The terminal shows a spinner with live progress.
| Distro | Desktop | Kernel format | Init |
|---|---|---|---|
| Ubuntu 26.04 (Resolute) | GNOME | .deb |
systemd |
| Arch | Sway | .pkg.tar.zst |
systemd |
| CachyOS | Gamescope + Steam Big Picture (Arch + [cachyos] repo, no v3 migration in image build) |
.pkg.tar.zst |
systemd |
CachyOS Deck UI (cachyos-deck) |
boots into Steam game mode, KDE Plasma as the desktop | .pkg.tar.zst |
systemd |
cachyos-deck boots into Steam game mode, switches to Plasma and back from Steam's power menu, and restarts into
Linux by kexec. Controllers paired with the PS5 are imported.
Switches on the boot partition:
| file or setting | effect |
|---|---|
no-hdr |
never offer HDR |
no-scx |
no LAVD scheduler |
no-kexec-restart |
Restart goes back to the PS5 system software |
no-steamos-manager |
no steamos-manager (Steam's storage pages) |
cmdline.txt without splash |
boot text instead of the splash |
cmdline.txt without hdmi.vrr=1 |
no VRR |
Keep video=DP-1:1920x1080@60 in cmdline.txt: without it game mode can start with no picture on a 4K display.
Desktop shortcuts: Update PS5 Kernel (ps5-update-kernel, --rollback to go back), Last System Update, and Install
Decky Loader.
--distro all builds a 32GB image with 4 partitions (one EFI boot partition plus three root filesystems):
| Partition | Type | Label | Content |
|---|---|---|---|
| p1 | FAT32 | boot | Shared kernel, per-distro initrds, kexec scripts |
| p2 | ext4 | ubuntu2604 | Ubuntu 26.04 rootfs |
| p3 | ext4 | arch | Arch rootfs |
| p4 | ext4 | cachyos | CachyOS rootfs |
The boot partition contains kexec scripts to switch between distros at runtime. Ubuntu 26.04 is the default boot target.
Use --kernel-only to compile the PS5 kernel and produce installable packages without building a full disk image.
./build_image.sh --kernel-only # .deb (default)
./build_image.sh --kernel-only --distro all # .deb + .pkg.tar.zst
./build_image.sh --kernel-only --patches-ref main # fetch from specific branch/tag
./build_image.sh --kernel-only --clean # wipe and rebuild from scratchOutput packages are written to linux-bin/. Install on a running PS5 Linux system:
sudo dpkg -i linux-bin/linux-ps5_*.debThe kernel package installs ps5-stage-gpu-firmware.service. It only acts on a PS5 Pro, when ps5-linux-loader has dumped the Viola GPU firmware (viola_*.bin) to /boot/efi/lib/firmware/amdgpu/ and the kernel's amdgpu can load it. Then it:
- copies the files to
/usr/lib/firmware/amdgpu/ - rebuilds the initramfs and deploys it to the boot partition with
zz-update-boot, or on Bazzite by copying it to/boot/efi/initrd.img
amdgpu uses the firmware from the next boot on. The service does nothing on other models, without the firmware, or on Batocera and SteamOS. Check it with journalctl -u ps5-stage-gpu-firmware.
build_image.sh # Image builder (also supports --kernel-only)
docker/
kernel-builder/ # Kernel compilation container
kernel-builder-arch/ # Repackages .deb kernel as .pkg.tar.zst
image-builder/
Dockerfile # Image building container (distrobuilder)
entrypoint.sh # Single-distro build logic
entrypoint-multi.sh # Multi-distro build logic
distros/
ubuntu2604/ # Ubuntu 26.04 (Resolute)
arch/ # Arch Linux
cachyos/ # CachyOS repos + Gamescope/Steam
shared/ # Kernel postinst hooks (single + multi)
boot/
cmdline.txt # Kernel cmdline template (__DISTRO__ placeholder)
vram.txt # VRAM allocation
kexec-{ubuntu2604,arch,cachyos}.sh
work/ # Build artifacts (auto-created)
linux-bin/ # Compiled kernel packages
output/ # Final .img files