Package-based updates: sf-update, signed shell and app packages
- 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>
This commit is contained in:
@@ -21,7 +21,7 @@ if ! command -v cargo >/dev/null; then
|
||||
[ -x "$HOME/.cargo/bin/cargo" ] || curl -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal
|
||||
export PATH="$HOME/.cargo/bin:$PATH"
|
||||
fi
|
||||
cargo build --release -p sf-launcher -p sf-remote
|
||||
cargo build --release -p sf-launcher -p sf-remote -p sf-update
|
||||
|
||||
echo "== stage"
|
||||
STAGE="$WORK/image/stage"
|
||||
@@ -29,9 +29,27 @@ rm -rf "$STAGE"
|
||||
install -Dm755 target/release/sf-launcher "$STAGE/usr/bin/sf-launcher"
|
||||
install -Dm755 target/release/sf-remote "$STAGE/usr/bin/sf-remote"
|
||||
install -Dm755 tools/siri-remote/fastpair.py "$STAGE/usr/bin/sf-pair"
|
||||
install -Dm755 target/release/sf-update "$STAGE/usr/bin/sf-update"
|
||||
# Registry login for sf-update (read:package only). Kept out of git; without it
|
||||
# the TV can only update if the registry allows anonymous downloads.
|
||||
if [ -f image/secrets/update-token ]; then
|
||||
install -Dm600 image/secrets/update-token "$STAGE/usr/share/smartfox/update-token"
|
||||
else
|
||||
echo "warning: image/secrets/update-token is missing, sf-update will log in anonymously"
|
||||
fi
|
||||
mkdir -p "$STAGE/usr/share/smartfox"
|
||||
cp -r apps "$STAGE/usr/share/smartfox/apps"
|
||||
chmod +x image/mkosi.postinst.chroot image/mkosi.extra/usr/bin/sf-session image/mkosi.extra/usr/bin/sf-launcher-start image/mkosi.extra/usr/bin/sf-remote-debug image/mkosi.extra/usr/bin/sf-diag image/*.sh tools/vm/*.sh tools/siri-remote/*.sh tools/siri-remote/*.py
|
||||
# Versions of the factory copies: sf-update only installs newer packages.
|
||||
{
|
||||
echo "sf-shell = \"$(sed -n '/^\[workspace.package\]/,/^\[/ s/^version *= *"\(.*\)"/\1/p' Cargo.toml)\""
|
||||
for d in apps/*/; do
|
||||
v=$(sed -n 's/^version *= *"\(.*\)".*/\1/p' "$d/app.toml" | head -1)
|
||||
[ -n "$v" ] && echo "sf-app-$(basename "$d") = \"$v\""
|
||||
done
|
||||
} >"$STAGE/usr/share/smartfox/factory-versions.toml"
|
||||
mkdir -p "$STAGE/usr/share/doc/smartfox"
|
||||
cp docs/updates.md "$STAGE/usr/share/doc/smartfox/updates.md"
|
||||
chmod +x image/mkosi.postinst.chroot image/mkosi.extra/usr/bin/sf-session image/mkosi.extra/usr/bin/sf-launcher-start image/mkosi.extra/usr/bin/sf-remote-debug image/mkosi.extra/usr/bin/sf-diag image/mkosi.extra/usr/bin/sf-shell-exec image/*.sh tools/vm/*.sh tools/siri-remote/*.sh tools/siri-remote/*.py
|
||||
|
||||
echo "== mkosi"
|
||||
# Cache and output stay on the Linux filesystem (NTFS mounts break mkosi).
|
||||
|
||||
Reference in New Issue
Block a user