From 309b22f634606ee30d3be9a7d028678bd1fbc4df Mon Sep 17 00:00:00 2001 From: rickpeters Date: Sun, 27 Sep 2026 21:26:19 +0200 Subject: [PATCH] feat: Live session: power-off fix built for the ISO's kernels, Vapor look and layout at the live login --- .gitignore | 2 ++ TODO.md | 19 +++++------- .../xdg/autostart/steamify-live-theme.desktop | 7 +++++ .../usr/local/bin/steamify-live-theme | 7 +++++ archiso/packages_desktop.x86_64 | 1 + archiso/profiledef.sh | 1 + build-live-modules.sh | 30 +++++++++++++++++++ steamify-prepare.sh | 7 +++++ 8 files changed, 62 insertions(+), 12 deletions(-) create mode 100644 archiso/airootfs/etc/xdg/autostart/steamify-live-theme.desktop create mode 100755 archiso/airootfs/usr/local/bin/steamify-live-theme create mode 100755 build-live-modules.sh diff --git a/.gitignore b/.gitignore index 2b22e51..4366873 100644 --- a/.gitignore +++ b/.gitignore @@ -24,3 +24,5 @@ archiso/airootfs/etc/version-tag archiso/airootfs/usr/local/share/steamify/ archiso/airootfs/usr/lib/libboost_* archiso/airootfs/etc/steammachine-iso-build +archiso/airootfs/usr/lib/modules/ +archiso/airootfs/etc/modules-load.d/steamify-fremont-poweroff.conf diff --git a/TODO.md b/TODO.md index b286754..52a091a 100644 --- a/TODO.md +++ b/TODO.md @@ -2,12 +2,17 @@ ## Open -1. **Steamify PR**: `feat/defaults-mode` (2.6.0, `b948c20`) in +1. **Test the live session** after the next build (`build-live-modules.sh` + runs in the container before buildiso.sh): Vapor look and layout at the + live login, `lsmod | grep steamify` in the live session (on the Steam + Machine it loads; in the VM with `--fremont` too), and shutting down from + the live session on the real Steam Machine stays off. +2. **Steamify PR**: `feat/defaults-mode` (2.6.0, `b948c20`) in steamify-cachyos, pushed, no PR yet (checked 2026-09-27: not on main, newest release v2.5.2). Ready: open it; the user merges (never commit to main). The ISO's first-login step needs 2.6.0 released. -2. **Test on the real Steam Machine** from a USB stick (gamescope, LEDs, CEC, +3. **Test on the real Steam Machine** from a USB stick (gamescope, LEDs, CEC, power-off) before calling the ISO usable. ## Done @@ -30,16 +35,6 @@ ## Later -- **Power-off fix in the live session.** Without it the Steam Machine starts - again right after shutting down from the live ISO. Build - `steamify-fremont-poweroff.ko` in `steamify-prepare.sh` against the headers - of the ISO's kernel, put it in `airootfs/usr/lib/modules//extra` - and run depmod (small); or ship DKMS packages from a local repo (~250 MB of - headers on the ISO). Later maybe the CEC and LED drivers the same way. -- **Vapor theme in the live session.** Add `cachyos-vapor` to - `packages_desktop.x86_64` and set it as the live user's look and feel in - `airootfs/etc/skel` (kdeglobals `LookAndFeelPackage`, no layout file, so - Plasma lays out Vapor at the live login). - **Steamify wizard pages in the installer**, before anything is installed: the same choices as Steamify's menu (conversion, boot into gamescope or desktop, theme, Deck icons, single user, shortcut + non-Steam game, diff --git a/archiso/airootfs/etc/xdg/autostart/steamify-live-theme.desktop b/archiso/airootfs/etc/xdg/autostart/steamify-live-theme.desktop new file mode 100644 index 0000000..0dec1d2 --- /dev/null +++ b/archiso/airootfs/etc/xdg/autostart/steamify-live-theme.desktop @@ -0,0 +1,7 @@ +[Desktop Entry] +Type=Application +Name=Steamify live theme +Exec=/usr/local/bin/steamify-live-theme +OnlyShowIn=KDE; +X-KDE-autostart-phase=2 +NoDisplay=true diff --git a/archiso/airootfs/usr/local/bin/steamify-live-theme b/archiso/airootfs/usr/local/bin/steamify-live-theme new file mode 100755 index 0000000..64b3095 --- /dev/null +++ b/archiso/airootfs/usr/local/bin/steamify-live-theme @@ -0,0 +1,7 @@ +#!/bin/bash +# The live session in the Vapor look, with its SteamOS desktop layout. +# CachyOS's own layout comes from /etc/skel, which the live user gets before +# this runs; lookandfeeltool needs plasmashell up to replace it. +for _ in $(seq 30); do pgrep -u "$USER" -x plasmashell >/dev/null && break; sleep 1; done +sleep 2 +lookandfeeltool -a com.valve.vapor.desktop --resetLayout diff --git a/archiso/packages_desktop.x86_64 b/archiso/packages_desktop.x86_64 index 6dc5c53..5fd8d02 100644 --- a/archiso/packages_desktop.x86_64 +++ b/archiso/packages_desktop.x86_64 @@ -90,6 +90,7 @@ linux-cachyos linux-cachyos-nvidia-open linux-cachyos-zfs linux-firmware +cachyos-vapor linux-firmware-marvell lsb-release lsof diff --git a/archiso/profiledef.sh b/archiso/profiledef.sh index b22e79f..7157029 100644 --- a/archiso/profiledef.sh +++ b/archiso/profiledef.sh @@ -28,6 +28,7 @@ file_permissions=( ["/usr/local/bin/choose-mirror"]="0:0:755" ["/usr/local/bin/dmcheck"]="0:0:755" ["/usr/local/bin/steamify-install"]="0:0:755" + ["/usr/local/bin/steamify-live-theme"]="0:0:755" ["/usr/local/bin/calamares-online.sh"]="0:0:755" ["/usr/local/bin/remove-nvidia"]="0:0:755" ["/usr/local/bin/removeun"]="0:0:755" diff --git a/build-live-modules.sh b/build-live-modules.sh new file mode 100755 index 0000000..f6c496f --- /dev/null +++ b/build-live-modules.sh @@ -0,0 +1,30 @@ +#!/bin/bash +# build-live-modules.sh: builds Steamify's power-off fix for the live ISO's +# kernels, so the Steam Machine stays off after shutting down from the live +# session (recent kernels keep a firmware wake bit set; see Steamify's +# patches/steamify-fremont-poweroff.c). Run as root in the build container, +# after steamify-prepare.sh and before buildiso.sh: the headers come from the +# same repos at the same time as the ISO's kernels, so the versions match. +# The module checks for Fremont itself and does nothing on other hardware. +set -euo pipefail +cd "$(dirname "$0")" +src=archiso/airootfs/usr/local/share/steamify/steamify-fremont-poweroff.c +[[ -f "$src" ]] || { echo "No $src: run steamify-prepare.sh first." >&2; exit 1; } + +pacman -S --needed --noconfirm base-devel clang llvm lld linux-cachyos-headers linux-cachyos-lts-headers >/dev/null +work="$(mktemp -d)" +cp "$src" "$work/" +echo 'obj-m += steamify-fremont-poweroff.o' > "$work/Makefile" +for build in /usr/lib/modules/*/build; do + kver="$(basename "$(dirname "$build")")" + # CachyOS's kernels differ in compiler (linux-cachyos is clang-built): + # build with the one the kernel was built with. + llvm=() + grep -q '^CONFIG_CC_IS_CLANG=y' "$build/.config" && llvm=(LLVM=1) + make -s -C "$build" M="$work" "${llvm[@]}" clean modules + install -Dm644 "$work/steamify-fremont-poweroff.ko" \ + "archiso/airootfs/usr/lib/modules/$kver/extra/steamify-fremont-poweroff.ko" + echo "Power-off fix built for $kver." +done +rm -rf "$work" +install -Dm644 /dev/stdin archiso/airootfs/etc/modules-load.d/steamify-fremont-poweroff.conf <<< 'steamify-fremont-poweroff' diff --git a/steamify-prepare.sh b/steamify-prepare.sh index 1783fa2..9adede4 100755 --- a/steamify-prepare.sh +++ b/steamify-prepare.sh @@ -11,6 +11,13 @@ if [[ -n "${1:-}" ]]; then else curl -fsSL https://github.com/theupriser/steamify-cachyos/releases/latest/download/steamify.sh -o "$dest" fi +# The power-off fix's source, for build-live-modules.sh (live session). +poweroff="$(dirname "$dest")/steamify-fremont-poweroff.c" +if [[ -n "${1:-}" ]]; then + cp "$1/patches/steamify-fremont-poweroff.c" "$poweroff" +else + curl -fsSL https://raw.githubusercontent.com/theupriser/steamify-cachyos/main/patches/steamify-fremont-poweroff.c -o "$poweroff" +fi grep -q -- '--defaults' "$dest" || { echo "This Steamify has no --defaults (needs 2.6.0 or newer)." >&2; exit 1; } chmod 755 "$dest" # Temporary: cachyos-calamares-next 3.4.2-13 is linked against Boost 1.91