Split the apps and the SDK out of Fennec OS
The apps are developed apart from the OS now, each in its own repo under gitea.bluefox.support/fennec: - sdk: sf-app (the app contract: manifest, permissions, store rules, sandbox, launch; from sf-ipc), sf-ui, sf-pack, the app template, the developer guide. The OS depends on it by tag (v0.1.0). - youtube, steam: store apps. netflex (native) replaces the Netflex web app. - store: the Fennec catalog, the store source a new TV starts with. This repo keeps the OS and its own apps (Settings, App Store, AirPlay, Miracast). sf-ipc re-exports sf-app, so OS code is mostly unchanged. - Store apps may register for DIAL (the `dial` permission); an official app with the same DIAL name wins. - Built-in icon names are for official apps only. - The image installs the catalog apps at build time (factory-store.toml, sf-update store in mkosi.postinst.chroot). Steam's system part stays in the image: 32-bit libraries, controller udev rules (from Valve's apt repo), Valve's key. - Older TVs move over by themselves: sf-update adds the replacements to store.toml once, the old factory app stays until its replacement is installed, YouTube's and Steam's data folders move to the new ids, and the old sf-app-<id> packages are not installed any more. Shell 0.3.0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -41,27 +41,15 @@ else
|
||||
echo "warning: image/secrets/update-token is missing, sf-update will log in anonymously"
|
||||
fi
|
||||
mkdir -p "$STAGE/usr/share/smartfox"
|
||||
# Official apps only: a folder with its own .git is a store app developed in
|
||||
# place (docs/store-app-guide.md), not part of the image.
|
||||
# Official apps only. A folder with its own .git is a store app checked out
|
||||
# here for development (e.g. apps/netflex-tv): not part of the image. Store
|
||||
# apps come from their own repos (factory-store.toml, mkosi.postinst.chroot).
|
||||
mkdir -p "$STAGE/usr/share/smartfox/apps"
|
||||
for d in apps/*/; do
|
||||
[ -e "$d/.git" ] && continue
|
||||
cp -r "$d" "$STAGE/usr/share/smartfox/apps/"
|
||||
done
|
||||
# Apps with a packaging hook (Steam: the official steam-launcher from Valve).
|
||||
for hook in tools/pkg/*/package.sh; do
|
||||
id=$(basename "$(dirname "$hook")")
|
||||
[ -d "$STAGE/usr/share/smartfox/apps/$id" ] || continue
|
||||
echo "== $id $(bash "$hook" "$STAGE/usr/share/smartfox/apps/$id" | tail -1)"
|
||||
done
|
||||
chmod -R a+x "$STAGE"/usr/share/smartfox/apps/*/bin 2>/dev/null || true
|
||||
# Steam's controller rules (uinput, Steam Controller, DualSense...) and the
|
||||
# key of Valve's repository (mkosi.postinst.chroot: the 32-bit libraries).
|
||||
if [ -d "$STAGE/usr/share/smartfox/apps/steam/udev" ]; then
|
||||
mkdir -p "$STAGE/usr/lib/udev/rules.d"
|
||||
cp "$STAGE"/usr/share/smartfox/apps/steam/udev/*.rules "$STAGE/usr/lib/udev/rules.d/"
|
||||
install -Dm644 tools/pkg/steam/valve-archive-keyring.gpg "$STAGE/usr/share/keyrings/valve-archive-keyring.gpg"
|
||||
fi
|
||||
# Versions of the factory copies: sf-update only installs newer packages.
|
||||
{
|
||||
echo "sf-shell = \"$(sed -n '/^\[workspace.package\]/,/^\[/ s/^version *= *"\(.*\)"/\1/p' Cargo.toml)\""
|
||||
|
||||
BIN
image/mkosi.extra/usr/share/keyrings/valve-archive-keyring.gpg
Normal file
BIN
image/mkosi.extra/usr/share/keyrings/valve-archive-keyring.gpg
Normal file
Binary file not shown.
17
image/mkosi.extra/usr/share/smartfox/factory-store.toml
Normal file
17
image/mkosi.extra/usr/share/smartfox/factory-store.toml
Normal file
@@ -0,0 +1,17 @@
|
||||
# store.toml of a new TV (docs/store.md): the Fennec catalog as a source, and
|
||||
# its apps installed with these permissions approved. The image build
|
||||
# installs them (mkosi.postinst.chroot: sf-update store), so a new TV has them
|
||||
# without a network; after that they update like any store app.
|
||||
sources = ["https://gitea.bluefox.support/fennec/store"]
|
||||
|
||||
[apps."support.bluefox.netflex"]
|
||||
source = "https://gitea.bluefox.support/fennec/netflex"
|
||||
permissions = ["network", "gpu", "audio"]
|
||||
|
||||
[apps."support.bluefox.youtube"]
|
||||
source = "https://gitea.bluefox.support/fennec/youtube"
|
||||
permissions = ["network", "gpu", "audio", "dial"]
|
||||
|
||||
[apps."support.bluefox.steam"]
|
||||
source = "https://gitea.bluefox.support/fennec/steam"
|
||||
permissions = ["network", "gpu", "audio", "gamepad", "dbus-session"]
|
||||
@@ -18,9 +18,10 @@ fi
|
||||
getent group netdev >/dev/null || groupadd -r netdev
|
||||
usermod -aG netdev tv
|
||||
|
||||
# Steam (apps/steam, docs/store.md): the client is 32-bit. Valve's metapackages
|
||||
# pull in the i386 graphics and system libraries it needs; the launcher itself
|
||||
# is the sf-app-steam package (factory copy in /usr/share/smartfox/apps/steam).
|
||||
# Steam support (the Steam app is a store app: fennec/steam). The client is
|
||||
# 32-bit: Valve's metapackages pull in the i386 graphics and system libraries
|
||||
# it needs. The controller udev rules (uinput, Steam Controller, DualSense...)
|
||||
# come from Valve's steam-launcher package, without installing the launcher.
|
||||
if [ -f /usr/share/keyrings/valve-archive-keyring.gpg ]; then
|
||||
dpkg --add-architecture i386
|
||||
cat >/etc/apt/sources.list.d/steam.sources <<'EOF'
|
||||
@@ -33,6 +34,10 @@ Signed-By: /usr/share/keyrings/valve-archive-keyring.gpg
|
||||
EOF
|
||||
apt-get update -q
|
||||
DEBIAN_FRONTEND=noninteractive apt-get install -y -q --no-install-recommends steam-libs-amd64 steam-libs-i386:i386 mesa-vulkan-drivers:i386 libvulkan1:i386
|
||||
t=$(mktemp -d)
|
||||
(cd "$t" && apt-get download -q steam-launcher && dpkg-deb -x steam-launcher_*.deb x)
|
||||
install -m644 "$t"/x/lib/udev/rules.d/*.rules /usr/lib/udev/rules.d/
|
||||
rm -rf "$t"
|
||||
apt-get clean
|
||||
fi
|
||||
|
||||
@@ -82,6 +87,15 @@ printf '[Icon Theme]\nInherits=smartfox-blank\n' >/usr/share/icons/default/index
|
||||
|
||||
chmod +x /usr/bin/sf-session /usr/bin/sf-pair /usr/bin/sf-remote-debug /usr/bin/sf-diag /usr/bin/sf-shell-exec 2>/dev/null || true
|
||||
|
||||
# Factory store apps (docs/store.md): the Fennec catalog's apps, installed now
|
||||
# so a new TV has them offline. Needs the catalog repos to be public.
|
||||
install -d -o tv -g tv /var/lib/smartfox
|
||||
install -o tv -g tv -m644 /usr/share/smartfox/factory-store.toml /var/lib/smartfox/store.toml
|
||||
if ! sf-update store; then
|
||||
echo "warning: the factory store apps could not be installed; the TV installs them once online" >&2
|
||||
fi
|
||||
rm -rf /var/lib/sf-pkg/.download
|
||||
|
||||
# Factory copy of /var: sf-data-init.service fills the empty data partition from it.
|
||||
rm -rf /usr/share/factory/var
|
||||
mkdir -p /usr/share/factory
|
||||
|
||||
Reference in New Issue
Block a user