Installers: ask for sudo in the terminal, and cope with SteamVR off

- frame_sudo (scripts/_env.sh) replaces three copies of sudo_run. On
  the Frame it asks in the terminal even when stdin isn't one, which
  install.sh's steps never had: saying yes to the Bluetooth fixes or
  hand tracking stopped the install with "no terminal for sudo".
  From a PC it asks through ssh -t when .env has no password.
- start_with_steamvr: the pointer, power, and gaze services restart
  when SteamVR runs (a re-install runs the new code) and are left to
  start with it when it doesn't, instead of failing the install.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
DeeJanuzandClaude Opus 5.5 committed 2026-10-01 15:04:49 -06:00
1 parent 12c42cd455
commit 0280e7441d
8 files changed
+62 -58

No files matched your search

+1 -1
View File
@@ -40,7 +40,7 @@ The service runs after Bluetooth has started and never makes Bluetooth wait for
The install writes to `/etc`, so it needs `sudo` and the `steamos` user's password.
- On the headset, `sudo` asks for the password in the terminal. If you've never set one, run `passwd` first.
- From a PC over SSH, there's no terminal on the Frame to ask in, so put the password in a `.env` file at the repo root:
- From a PC over SSH, the scripts ask for it in your terminal (through `ssh -t`). To skip the question, or with no terminal, put the password in a `.env` file at the repo root:
```
steamos_root_pwd="your-password"
+3 -14
View File
@@ -1,8 +1,7 @@
#!/usr/bin/env bash
# Install (or remove) the persistent Bluetooth LE workarounds on the Frame.
# Needs host sudo. On the Frame, sudo asks for the password in the terminal.
# From a PC (or with no terminal), the password comes from steamos_root_pwd in the
# repo's .env and is sent to sudo -S on stdin, never on a command line.
# Needs host sudo: it asks for the password in the terminal, on the Frame or from a PC
# (frame_sudo in scripts/_env.sh, which also takes it from the repo's .env).
# Usage: setup/bluetooth/install.sh [install|uninstall|run]
# run re-apply now without restarting bluetooth (after pairing a new device)
set -euo pipefail
@@ -11,17 +10,7 @@ root=$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)
. "$root/scripts/_env.sh"
src=$FRAME_REPO/setup/bluetooth
sudo_run() {
if [ "$FRAME_LOCAL" = 1 ] && [ -t 0 ]; then
sudo bash -c "$1" # asks for the password here
return
fi
local pw
pw=$(sed -n 's/^steamos_root_pwd=//p' "$root/.env" 2>/dev/null)
pw=${pw#[\"\']}; pw=${pw%[\"\']} # .env values may be quoted
[ -n "$pw" ] || { echo "no terminal for sudo, and steamos_root_pwd is missing from $root/.env" >&2; exit 1; }
printf '%s\n' "$pw" | on_frame "sudo -S -p '' bash -c $(printf %q "$1")"
}
sudo_run() { frame_sudo "$1"; }
case ${1:-install} in
install)