Files
ps5-linux-image/distros/steamos/README.md
mia 9fa102e098 Add SteamOS distro
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
2026-06-27 17:10:07 -04:00

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

What the build does

  1. Resolve steamdeck-repair-latest.img.bz2 → its dated filename so the cache key is stable.
  2. Decompress → losetup -P.
  3. Mount the first erofs partition (rootfs-A; A and B are identical) read-only, cp -a to $CHROOT.
  4. Mount the first ext4 < 2 GB partition that contains /lib (var-A), cp -a to $CHROOT/var — SteamOS splits /var off the rootfs and first-boot fails without it.
  5. Extract our linux-ps5-*.pkg.tar.zst and merge usr/, boot/, etc/ into $CHROOT.
  6. Delete SteamOS's linux-neptune kernel + modules so grub boots ours.
  7. 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 jupiter hardware 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.