system auto-configuration scripts for running steam on lainOS layer 03 https://lainos.net
Find a file
2026-10-11 16:56:01 +02:00
LICENSE Initial commit 2026-10-02 03:03:12 +02:00
README.md Update README.md 2026-10-11 16:56:01 +02:00
RTFM.sh add autoconfig script 2026-10-02 09:02:10 -07:00
steam_autoconfig.sh edit steam autoconfig script 2026-10-09 08:55:38 -07:00

🎮 Steam & Gaming Configuration

LainOS Layer 03 provides a dedicated, idempotent setup script to safely enable Steam and gaming compatibility without compromising the hardened, systemd-free OpenRC environment.

Steam Auto-Configuration Script

The steam_autoconfig.sh script handles the complex multilib and XWayland requirements of the Steam client declaratively. It is safe to re-run and performs a single reconciliation pass to rebuild any installed packages whose USE flags have changed.

Key Operations:

  • Preflight Verification: Ensures the active Portage profile inherits 23.0/hardened (merged-usr) to prevent split-usr collisions.
  • Repository Setup: Automatically configures the guru repository metadata and syncs the steam-overlay.
  • Targeted USE Flags: Applies precise, minimal USE flag adjustments in /etc/portage/package.use/steam to unblock multilib dependencies, enable XWayland support for Sway/wlroots, and prevent OpenRC from pulling in elogind or systemd.
  • Idempotent Reconciliation: Executes emerge -avN @world alongside games-util/steam-launcher and gnome-extra/zenity, ensuring the entire system is consistently rebuilt against the new policy in a single transaction.
  • Permissions: Automatically adds the current user to the input group for Steam Input and controller support.

Usage Instructions

Follow these steps to configure and install Steam:

  1. Sync the Portage tree to ensure all repository metadata is up to date:
    doas emerge --sync
    
  2. Run the steam_autoconfig.sh script. It will prompt you to integrate changes. Type Yes and press Enter:
    chmod +x steam_autoconfig.sh
    ./steam_autoconfig.sh
    
  3. Apply the autounmask changes by running dispatch-conf. If the autounmask changes are not on the first page, press n until you reach the correct page, then press u to accept the new changes. Press n again to cycle through any remaining pages until dispatch-conf exits:
    dispatch-conf
    
  4. Run the script again to complete the auto-configuration and Steam installation:
    ./steam_autoconfig.sh
    
  5. When the script has finished, log out and log back in to apply the new input group membership and XWayland environment variables, then launch Steam:
    steam
    

For unattended runs (e.g. inside a catalyst chroot), change emerge -avN to emerge -vN so Portage doesn't wait at a confirmation prompt.

When the script finishes: log out and log back in, then run steam. The logout applies the input group membership and lets Sway spawn XWayland.

What it does

Stage Action
1/4 Preflight Verifies the lainos profile inherits default/linux/amd64/23.0/hardened (merged-usr). Aborts otherwise; it never edits the profile itself.
2/4 Repos Adds missing masters/repo_name metadata to the guru overlay; registers steam-overlay in /etc/portage/repos.conf/ (bypasses a broken eselect repository).
3/4 USE policy Writes /etc/portage/package.use/steam (declarative; overwritten on every run).
4/4 Reconcile Syncs steam-overlay, then runs one transaction: emerge -avN @world games-util/steam-launcher gnome-extra/zenity. The -N flag rebuilds every installed package whose USE flags changed; the atoms install everything missing (Steam, zenity, XWayland, the multilib tree). Adds the calling user to the input group.

USE flags it sets, and why

Flag Reason
sys-libs/glibc hash-sysv-compat Restores the legacy DT_HASH ELF section; Easy Anti-Cheat binaries refuse to load without it.
games-util/game-device-udev-rules -acl The ebuild's REQUIRED_USE demands elogind or systemd when acl is on; neither exists on OpenRC.
sys-apps/dbus X steam-launcher explicitly blocks dbus[abi_x86_32,-X]; X removes the soft block.
llvm-core/llvm zstd Installed lld pins llvm's zstd/debug flags; prevents a slot conflict during the multilib rebuild.
llvm-core/llvm abi_x86_32
dev-libs/elfutils abi_x86_32
virtual/libelf abi_x86_32
Pre-seeds the 32-bit flags Portage's autounmask otherwise loops on forever ("backtracking terminated early").
gui-wm/sway X
gui-libs/wlroots X
Compiles XWayland support into the compositor. The Steam client is X11-only; without these it exits with "Unable to open X11 display" and no other error anywhere.

Files it writes

  • /var/db/repos/guru/metadata/layout.conf (appends masters = gentoo only if absent)
  • /var/db/repos/guru/profiles/repo_name (writes guru)
  • /etc/portage/repos.conf/steam-overlay.conf (overlay registration)
  • /etc/portage/package.use/steam (the USE policy above, overwritten)
  • /etc/group (adds your user to input via usermod)

What it deliberately does NOT do

  • Never edits the profile parent (checks only; a wrong parent is fatal, not fixable-by-script)
  • No ebuild patches, no FEATURES overrides, no /bin or /lib surgery
  • No kernel, sysctl, or limits tuning (LainOS ships those preconfigured)
  • No /dev/shm handling (a chroot-build concern, not a host one)
  • Never runs etc-update (protected config updates stay a human decision)
  • Does not manage the Steam client after first launch (Valve self-updates under ~/.local/share/Steam, outside Portage's control)

Field notes: the traps this script exists because of

  1. split-usr vs merged-usr. A 17.1-series profile forces the split-usr USE flag. On a merged-usr filesystem this makes sys-apps/systemd-utils install /bin/udevadm and /usr/bin/udevadm as two different objects mapping to one path, creating an internal image collision Portage refuses to merge, immune to FEATURES, package.use, and manual image surgery. The only real fix is a merged-usr profile (23.0). Hence the preflight.
  2. The silent no-window bug. Sway/wlroots built with USE="-X" compile without XWayland support. The xwayland enable config line is then silently ignored: no XWayland process, empty $DISPLAY, Steam dies with only "Unable to open X11 display". Diagnosing this cost more time than everything else combined; the two X flags prevent it.
  3. The dbus block. steam-launcher[steamruntime] carries !sys-apps/dbus[abi_x86_32,-X]; enabling X on dbus is the clean unblock.
  4. The autounmask loop. Multilib Steam pulls ~54 32-bit rebuilds; without pre-seeded abi_x86_32 pins on llvm/elfutils/libelf, Portage's backtracker terminates early with unsatisfiable-flag errors.
  5. OpenRC vs REQUIRED_USE. Controller udev rules want acl, and acl wants an init system OpenRC doesn't have. -acl keeps the rules.

Troubleshooting

Symptom Fix
steam: command not found after install doas env-update && source /etc/profile, or open a new terminal
Steam exits immediately, "Unable to open X11 display" XWayland not running: pgrep -a Xwayland. Confirm sway/wlroots have X enabled (emerge -pv gui-wm/sway), then log out and back in
"Steam is already running" but no window Zombie client: pkill -9 -f steam, relaunch
Popup dialogs fail silently zenity missing (the script installs it; verify with qlist -I gnome-extra/zenity)
Controllers not detected User not in input group yet (log out/in; check with groups)
EAC game won't launch Confirm hash-sysv-compat is active: equery uses sys-libs/glibc

Idempotency

Safe to re-run at any time. Config writes are declarative, and once the system matches the declared state the emerge transaction reports "Nothing to merge".