- Shell 100%
| LICENSE | ||
| README.md | ||
| RTFM.sh | ||
| steam_autoconfig.sh | ||
🎮 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
gururepository metadata and syncs thesteam-overlay. - Targeted USE Flags: Applies precise, minimal USE flag adjustments in
/etc/portage/package.use/steamto unblock multilib dependencies, enable XWayland support for Sway/wlroots, and prevent OpenRC from pulling inelogindorsystemd. - Idempotent Reconciliation: Executes
emerge -avN @worldalongsidegames-util/steam-launcherandgnome-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
inputgroup for Steam Input and controller support.
Usage Instructions
Follow these steps to configure and install Steam:
- Sync the Portage tree to ensure all repository metadata is up to date:
doas emerge --sync - Run the
steam_autoconfig.shscript. It will prompt you to integrate changes. TypeYesand press Enter:chmod +x steam_autoconfig.sh ./steam_autoconfig.sh - Apply the autounmask changes by running
dispatch-conf. If the autounmask changes are not on the first page, pressnuntil you reach the correct page, then pressuto accept the new changes. Pressnagain to cycle through any remaining pages untildispatch-confexits:dispatch-conf - Run the script again to complete the auto-configuration and Steam installation:
./steam_autoconfig.sh - When the script has finished, log out and log back in to apply the new
inputgroup 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_32dev-libs/elfutils abi_x86_32virtual/libelf abi_x86_32 |
Pre-seeds the 32-bit flags Portage's autounmask otherwise loops on forever ("backtracking terminated early"). |
gui-wm/sway Xgui-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(appendsmasters = gentooonly if absent)/var/db/repos/guru/profiles/repo_name(writesguru)/etc/portage/repos.conf/steam-overlay.conf(overlay registration)/etc/portage/package.use/steam(the USE policy above, overwritten)/etc/group(adds your user toinputviausermod)
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
FEATURESoverrides, no/binor/libsurgery - No kernel, sysctl, or limits tuning (LainOS ships those preconfigured)
- No
/dev/shmhandling (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
- split-usr vs merged-usr. A
17.1-series profile forces thesplit-usrUSE flag. On a merged-usr filesystem this makessys-apps/systemd-utilsinstall/bin/udevadmand/usr/bin/udevadmas two different objects mapping to one path, creating an internal image collision Portage refuses to merge, immune toFEATURES,package.use, and manual image surgery. The only real fix is a merged-usr profile (23.0). Hence the preflight. - The silent no-window bug. Sway/wlroots built with
USE="-X"compile without XWayland support. Thexwayland enableconfig 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 twoXflags prevent it. - The dbus block.
steam-launcher[steamruntime]carries!sys-apps/dbus[abi_x86_32,-X]; enablingXon dbus is the clean unblock. - The autounmask loop. Multilib Steam pulls ~54 32-bit rebuilds; without pre-seeded
abi_x86_32pins on llvm/elfutils/libelf, Portage's backtracker terminates early with unsatisfiable-flag errors. - OpenRC vs REQUIRED_USE. Controller udev rules want
acl, andaclwants an init system OpenRC doesn't have.-aclkeeps 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".