mirror of
https://github.com/ps5-linux/ps5-linux-image.git
synced 2026-07-17 23:40:37 +00:00
Adds `--distro steamos` as a first-class build target. Pattern is the
same as bazzite-deck/batocera: distros/steamos/build-rootfs.sh fetches
the upstream rootfs (Valve's Steam Deck recovery .img.bz2 from
steamdeck-images.steamos.cloud), extracts the rootfs-A + var-A btrfs
slots into $CHROOT, swaps in our linux-ps5 kernel pkg.tar.zst, and
rebuilds the initramfs with the modules amdgpu needs for the PS5
Oberon GPU.
PS5-specific fixes applied to the SteamOS rootfs:
- Replace /usr/bin/steamos-session-select with a shim that writes
/etc/sddm.conf.d/zzz-session-override.conf directly + restarts sddm.
The vendored helper goes through steamosctl / steamos-manager whose
Deck-hardware code paths silently no-op on PS5, leaving the UI stuck
at "Switching to Desktop..." with no actual session swap.
- Install a small Python dbus monitor (steam-session-switch-listener)
that catches org.freedesktop.DisplayManager.Seat.SwitchToUser from
Big Picture's "Switch to Desktop" button and writes the same
override file. No -steamos3 / -steampal needed (those trigger Steam's
A/B update reboot loop on a non-Deck box).
- Drop a Return-to-Gaming-Mode.desktop into /home/deck/Desktop pointing
at steamos-session-select gamescope.
- chown /home/deck to deck:deck (the recovery image leaves it root:root,
which breaks ~/.config writability on first Plasma launch).
- Enable sshd + set deck:deck so the box is reachable for further
iteration without dragging a USB keyboard around.
- Patch /etc/fstab: comment out the by-partsets atomic mount entries
(those paths don't exist on a flat-rootfs flash), append a LABEL-based
/efi mount so the FAT boot partition comes up cleanly. Required for
ps5-iw620-firmware.service to find the WLAN blob.
- Append amdgpu.dpm=0 + amdgpu.gpu_recovery=0 to the kernel cmdline.
modprobe.d alone isn't enough — amdgpu loads before the rootfs conf
is read, so the cmdline is the only reliable path. Without these
Switch-to-Desktop produces a black screen on the PS5 HDMI output.
- Polkit-deny the deck user reboot/poweroff to break Steam's update
reboot loop on first boot.
- Patch steam-jupiter to skip its OOBE rm -rf path. The OOBE assumes
Deck factory layout and wipes /home/deck/.local if it runs.
Verified end-to-end on real PS5 (HW-rev EA-1102): autologin lands in
gamescope, Switch-to-Desktop and Return-to-Gaming both work, sshd is
reachable, ps5-iw620 brings up internal WiFi after firmware staging.
Files:
- distros/steamos/build-rootfs.sh (646 lines)
- distros/steamos/README.md
- distros/steamos/return-to-gaming-mode.desktop
- distros/steamos/steam-session-switch-listener.{py,service}
- build_image.sh: steamos → FORMAT=arch (uses linux-ps5 pkg.tar.zst)
- .github/workflows/build-image.yml: steamos in matrix options + distros list
1.6 KiB
1.6 KiB
steamos
SteamOS 3 image variant for PS5, built by extracting the rootfs from
Valve's official Steam Deck recovery image and swapping in our
linux-ps5 kernel.
Source
- Upstream: https://steamdeck-images.steamos.cloud/recovery/steamdeck-repair-latest.img.bz2 (Steam Deck recovery image; SteamOS Holo Arch-based.)
- ~3.4 GB compressed bz2, ~10 GB decompressed.
- Valve CDN — no per-IP throttle observed; first-time cache pull on a
cold runner is ~3-5 min, subsequent runs are instant via
/data/cache/ps5/downloads/.
What the build does
- Resolve
steamdeck-repair-latest.img.bz2→ its dated filename so the cache key is stable. - Decompress → losetup -P.
- Mount the first erofs partition (rootfs-A; A and B are
identical) read-only,
cp -ato$CHROOT. - Mount the first ext4 < 2 GB partition that contains
/lib(var-A),cp -ato$CHROOT/var— SteamOS splits/varoff the rootfs and first-boot fails without it. - Extract our
linux-ps5-*.pkg.tar.zstand mergeusr/,boot/,etc/into$CHROOT. - Delete SteamOS's
linux-neptunekernel + modules so grub boots ours. depmod -a $KVER.
The standard image-builder flow then packs $CHROOT into an ext4
image with our EFI partition.
Caveats
- The Steam UI session expects the Deck's
jupiterhardware quirks (gamepad, ALS, fan curve daemons) — most of those won't apply on PS5. Falling back to plasma desktop on the first session is normal. - SteamOS is read-only by design (steamos-readonly enable). The image we build here is regular ext4; if you want the read-only A/B atomic experience, that needs a separate variant.