feat: Steamify's choices in the installer: a Steam Machine page (what to leave out) and a Start in page (gaming mode or desktop), passed to steamify.sh --defaults

This commit is contained in:
theupriser committed 2026-09-27 21:59:38 +02:00
1 parent c6212a774b
commit 81f2eea63d
6 files changed
+77 -16

No files matched your search

@@ -47,7 +47,8 @@ EOF
sudo cp "/usr/share/calamares/settings_${mode}.conf" /etc/calamares/settings.conf
# Steamify: its step (modules/shellprocess_steamify.conf) before the
# installer cleans up after itself.
sudo sed -i -e 's/^- id: cleanup_calamares$/- id: steamify\n module: shellprocess\n config: shellprocess_steamify.conf\n\n&/' \
sudo sed -i -e 's/^- id: cleanup_calamares$/- id: steamifyskip\n module: packagechooser\n config: packagechooser_steamifyskip.conf\n\n- id: steamifyboot\n module: packagechooser\n config: packagechooser_steamifyboot.conf\n\n- id: steamify\n module: shellprocess\n config: shellprocess_steamify.conf\n\n&/' \
-e 's/^ - packagechooser@desktop$/&\n - packagechooser@steamifyskip\n - packagechooser@steamifyboot/' \
-e 's/^ - shellprocess@cleanup_calamares$/ - shellprocess@steamify\n&/' /etc/calamares/settings.conf
exec pkexec-wrapper calamares -D6 >> $log
}
@@ -1,11 +1,16 @@
#!/bin/bash
# steamify-install <target root> <user>: runs Steamify's default setup for
# steamify-install <target root> <user> [<skip ids>] [gamescope|desktop]:
# runs Steamify's default setup (minus what the installer's Steam Machine
# page leaves out, where the boot page says) for
# the new user inside the installed system (Calamares, after the users and
# services steps). Steamify refuses root and asks sudo per command, so the
# user gets a NOPASSWD rule for this run only, named to be read last: sudo
# takes the last matching rule, and a later %wheel rule would ask again. Never fails the install: a
# problem leaves the log and Steamify can be run again from the desktop.
root="$1" user="$2"
# The pages' ids, comma-separated; the "Everything" entry is an empty id.
skip="$(tr ',' '\n' <<< "${3:-}" | grep -v '^$' | paste -sd, -)"
boot="${4:-gamescope}"
log="$root/var/log/steamify-install.log"
rule="$root/etc/sudoers.d/zz-steamify-install"
[[ -d "$root" && -n "$user" ]] || exit 0
@@ -15,7 +20,7 @@ printf '%s ALL=(ALL) NOPASSWD: ALL\n' "$user" > "$rule"
chmod 440 "$rule"
arch-chroot "$root" runuser -u "$user" -- env -i HOME="/home/$user" USER="$user" LOGNAME="$user" \
PATH=/usr/local/bin:/usr/bin TERM=dumb LANG=C.UTF-8 \
bash -c 'cd ~ && bash /var/tmp/steamify.sh --defaults < /dev/null' > "$log" 2>&1
bash -c 'cd ~ && bash /var/tmp/steamify.sh --defaults --skip "$0" --boot "$1" < /dev/null' "$skip" "$boot" > "$log" 2>&1
echo "exit: $?" >> "$log"
rm -f "$rule" "$root/var/tmp/steamify.sh"
exit 0