Files
ps5-linux-image/distros/fedora/image.yaml

281 lines
7.8 KiB
YAML

image:
name: ps5-fedora
distribution: fedora
release: "44"
description: Fedora GNOME (Wayland) desktop for PS5
architecture: x86_64
source:
downloader: fedora-http
url: https://kojipkgs.fedoraproject.org
skip_verification: true
packages:
manager: dnf
update: true
cleanup: true
sets:
- packages:
# Full GNOME desktop + GDM display manager.
- gnome-shell
- gnome-session
- gnome-terminal
- gdm
- mutter
- nautilus
- gnome-control-center
- gnome-settings-daemon
- gnome-keyring
- gnome-backgrounds
- gnome-text-editor
- gnome-system-monitor
- gnome-disk-utility
- gnome-calculator
- gnome-tweaks
- gnome-extensions-app
- gnome-software
- gnome-initial-setup
- file-roller
- loupe
- evince
- baobab
- xdg-desktop-portal-gnome
- xdg-user-dirs-gtk
- xorg-x11-server-Xwayland
- polkit
# Bluetooth
- bluez
- bluez-tools
# Audio / media
- pipewire
- wireplumber
- pipewire-pulseaudio
# Display / GPU (AMD) — userspace GL/Vulkan only; the kernel amdgpu driver
# comes from the linux-ps5 rpm. amdgpu is loaded LATE (by udev after pivot),
# exactly like the working Arch/Ubuntu images — NOT forced into the initramfs.
- mesa-dri-drivers
- mesa-vulkan-drivers
- mesa-va-drivers
- libinput
# Networking
- NetworkManager
- NetworkManager-wifi
- network-manager-applet
- linux-firmware
- iw
- wpa_supplicant
- wireless-regdb
- util-linux
# System
- glibc-langpack-en
- openssh-server
- sudo
- nano
- dracut
- kmod
- e2fsprogs
- parted
- cloud-utils-growpart
- kexec-tools
- zram-generator-defaults
- firefox
# Fonts
- dejavu-sans-fonts
- liberation-fonts
- google-noto-sans-fonts
- google-noto-emoji-fonts
- fontconfig
action: install
files:
- path: /etc/hostname
generator: hostname
- path: /etc/hosts
generator: hosts
- path: /etc/machine-id
generator: dump
- path: /etc/kernel/postinst.d/zz-update-boot
generator: copy
source: /tmp/build-staging/zz-update-boot
mode: "0755"
- path: /etc/fstab
generator: copy
source: /tmp/build-staging/fstab
- path: /usr/local/sbin/grow-rootfs
generator: copy
source: /tmp/build-staging/grow-rootfs
mode: "0755"
- path: /etc/systemd/system/grow-rootfs.service
generator: copy
source: /tmp/build-staging/grow-rootfs.service
- path: /opt/rpms/
generator: copy
source: /tmp/build-staging/rpms
actions:
- trigger: post-unpack
action: |-
#!/bin/bash
set -eux
echo "retries=10" >> /etc/dnf/dnf.conf
dnf makecache || true
- trigger: post-update
action: |-
#!/bin/bash
set -eux
passwd -l root
- trigger: post-packages
action: |-
#!/bin/bash
set -eux
fc-cache -f 2>/dev/null || true
# SSH — password auth only, root login via sudo
sed -i 's/^#*PermitRootLogin.*/PermitRootLogin no/' /etc/ssh/sshd_config
sed -i 's/^#*PasswordAuthentication.*/PasswordAuthentication yes/' /etc/ssh/sshd_config
systemctl enable sshd
systemctl enable NetworkManager
systemctl enable gdm
systemctl enable bluetooth.service
systemctl set-default graphical.target
# The PS5 kernel patch writes into the request_firmware() buffer to skip
# Sony's signature header (gfx_v10_0_early_init, amdgpu_sdma_init_microcode).
# Firmware loaded from a .xz file is decompressed into pages the kernel
# maps PAGE_KERNEL_RO, so that write oopses and /dev/dri never appears.
# Fedora is the only distro shipping .xz firmware — Ubuntu/Arch use .zst
# (writable vzalloc buffer) and Debian/Kali ship raw .bin, which is why
# only this image black-screened. Keep the PS5 GPU firmware uncompressed.
# linux-firmware dedupes identical blobs as symlinks (mec2 -> mec) and
# unxz refuses symlinks, so materialize links first while targets exist.
cd /usr/lib/firmware/amdgpu
for f in cyan_skillfish*.xz; do
if [ -L "$f" ]; then
tgt=$(readlink -f "$f")
rm "$f"
xz -dc "$tgt" > "${f%.xz}"
fi
done
unxz cyan_skillfish*.xz
ls -la cyan_skillfish*
- trigger: post-files
action: |-
#!/bin/bash
set -eux
systemctl enable grow-rootfs.service
# Built in a chroot → filesystem never SELinux-labelled. Disable SELinux.
mkdir -p /etc/selinux
if [ -f /etc/selinux/config ]; then
sed -i 's/^SELINUX=.*/SELINUX=disabled/' /etc/selinux/config
else
printf 'SELINUX=disabled\nSELINUXTYPE=targeted\n' > /etc/selinux/config
fi
# --- Default user + GDM autologin ---
useradd -m -G wheel,video,input,render -s /bin/bash ps5
echo "ps5:ps5" | chpasswd
echo "%wheel ALL=(ALL:ALL) NOPASSWD: ALL" > /etc/sudoers.d/wheel
# GDM autologin so the GNOME desktop appears without a login prompt.
mkdir -p /etc/gdm
sed -i 's/^\[daemon\]/[daemon]\nAutomaticLoginEnable=True\nAutomaticLogin=ps5/' /etc/gdm/custom.conf 2>/dev/null || \
cat > /etc/gdm/custom.conf <<'EOF'
[daemon]
AutomaticLoginEnable=True
AutomaticLogin=ps5
[security]
[xdmcp]
[chooser]
[debug]
EOF
# Skip gnome-initial-setup for the autologin user.
mkdir -p /home/ps5/.config
echo 'yes' > /home/ps5/.config/gnome-initial-setup-done
chown -R ps5:ps5 /home/ps5
# zram swap
printf '[zram0]\nzram-size = ram / 2\ncompression-algorithm = zstd\n' > /etc/systemd/zram-generator.conf
# --- Install custom kernel rpm (its %post builds initramfs + deploys boot) -
# amdgpu is NOT forced into the initramfs — it loads late via udev, exactly
# like the working Arch/Ubuntu images.
mkdir -p /boot/efi
rpm -ivh /opt/rpms/*.rpm
rm -rf /opt/rpms
KVER=$(ls -1t /lib/modules | head -1)
[ -f "/boot/efi/bzImage" ] && [ -f "/boot/efi/initrd.img" ]
# --- PS5 internal WiFi: firmware-stage + autoload service ---
# The mlan.ko/moal.ko modules and their modprobe.d options are already
# shipped by linux-ps5.rpm (built by kernel-builder/build.sh, which now
# applies all PS5 mwifiex patches in one place). The rpm ALSO ships
# /etc/modules-load.d/moal which would auto-load moal at boot before
# firmware has been copied from /boot/efi — kill that and let our
# ps5-iw620.service do the copy+load in the right order.
rm -f /etc/modules-load.d/moal
install -d /usr/local/sbin /etc/systemd/system /etc/modprobe.d /usr/share/doc/ps5-iw620
cat > /etc/modprobe.d/ps5-iw620-noautoload.conf <<'EOF'
blacklist moal
blacklist mlan
EOF
cat > /usr/local/sbin/ps5-iw620-load <<'EOF'
#!/bin/sh
set -eu
FW_NAME=nxp/pcieuartiw620_combo_v1.bin
FW_DST=/lib/firmware/$FW_NAME
FW_SRC=
for candidate in "/boot/efi/lib/$FW_NAME" "/boot/lib/$FW_NAME" "$FW_DST"; do
[ -f "$candidate" ] && { FW_SRC="$candidate"; break; }
done
[ -z "$FW_SRC" ] && FW_SRC="$(find /boot /boot/efi -path "*/$FW_NAME" -type f 2>/dev/null | head -n 1)"
[ -n "$FW_SRC" ] && [ -f "$FW_SRC" ] && install -D -m 0644 "$FW_SRC" "$FW_DST"
[ -f "$FW_DST" ] || { echo "PS5 IW620 firmware not found; skipping"; exit 0; }
modprobe -r moal mlan 2>/dev/null || true
modprobe cfg80211 || true
modprobe moal
rfkill unblock all 2>/dev/null || true
nmcli radio wifi on 2>/dev/null || true
EOF
chmod 0755 /usr/local/sbin/ps5-iw620-load
cat > /etc/systemd/system/ps5-iw620.service <<'EOF'
[Unit]
Description=Load PS5 IW620 internal WiFi
RequiresMountsFor=/boot/efi
Wants=systemd-udev-settle.service
After=local-fs.target systemd-udev-settle.service
Before=NetworkManager.service network-pre.target
[Service]
Type=oneshot
ExecStart=/usr/local/sbin/ps5-iw620-load
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
EOF
depmod -a "$KVER"
systemctl enable ps5-iw620.service