- sf-update (root): lists sf-shell / sf-app-* in the Gitea generic registry, downloads, checks the Ed25519 signature and unpacks to /var/lib/sf-pkg, switches via current/previous/staged symlinks; the factory copies on the read-only root stay as fallback. A new shell is on trial and rolls back after 3 failed starts. - Launcher: apps from factory + installed packages (newer version wins), Settings > System > Updates (check, install now), shell trial confirm. - Image: sf-update units (boot apply, 6-hourly download, launcher requests), sf-shell-exec wrapper for sf-remote, factory versions, registry token. - CI: .gitea/workflows/packages.yml builds, signs and uploads packages whose version isn't published yet (tools/pkg/packages.sh). - docs/updates.md: protocol and layout. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
35 lines
1.3 KiB
Bash
35 lines
1.3 KiB
Bash
#!/bin/sh
|
|
# Runs inside cage: apply the output mode, then start the launcher.
|
|
if [ -n "${SMARTFOX_MODE:-}" ]; then
|
|
OUT=$(wlr-randr | awk 'NR==1 {print $1}')
|
|
wlr-randr --output "$OUT" --custom-mode "$SMARTFOX_MODE" ||
|
|
echo "sf-launcher-start: could not set $SMARTFOX_MODE on $OUT"
|
|
fi
|
|
|
|
# The launcher from the installed sf-shell package, else the factory copy.
|
|
# A new shell is on trial until it has run for a while (it then drops a
|
|
# "confirm" request). If it doesn't get there in 3 starts, ask sf-update to
|
|
# roll it back and start the factory launcher meanwhile (docs/updates.md).
|
|
PKG=/var/lib/sf-pkg/sf-shell
|
|
REQ=/var/lib/smartfox/update-requests
|
|
TRIES=/var/lib/smartfox/shell-tries
|
|
LAUNCHER=/usr/bin/sf-launcher
|
|
if [ -x "$PKG/current/bin/sf-launcher" ]; then
|
|
LAUNCHER="$PKG/current/bin/sf-launcher"
|
|
if [ -f "$PKG/trial" ]; then
|
|
n=$(($(cat "$TRIES" 2>/dev/null || echo 0) + 1))
|
|
echo "$n" >"$TRIES"
|
|
if [ "$n" -gt 3 ]; then
|
|
echo "sf-launcher-start: shell $(cat "$PKG/trial") failed $((n - 1)) times, rolling back"
|
|
rm -f "$TRIES"
|
|
touch "$REQ/rollback"
|
|
LAUNCHER=/usr/bin/sf-launcher
|
|
else
|
|
export SMARTFOX_SHELL_TRIAL=1
|
|
fi
|
|
else
|
|
rm -f "$TRIES"
|
|
fi
|
|
fi
|
|
exec "$LAUNCHER" --fullscreen --apps /usr/share/smartfox/apps --apps /var/lib/sf-pkg/apps
|