Compare commits

..

No commits in common. "main" and "main" have entirely different histories.
main ... main

39 changed files with 538 additions and 953 deletions

View File

@ -48,7 +48,7 @@ project:
- pmOS booting on cellphone to modified environment - pmOS booting on cellphone to modified environment
- Scripts for packaging of on-phone artifacts - Scripts for packaging of on-phone artifacts
7. ✓✓ Demo exercising phone infrastructure 7. Demo exercising phone infrastructure
8. ✓✓ Dataspace Protocol specification 8. ✓✓ Dataspace Protocol specification
- Draft specification of interaction protocols for secure - Draft specification of interaction protocols for secure
@ -73,7 +73,7 @@ project:
- Development of generic system-layer components - Development of generic system-layer components
- Development of mobile-phone-specific components - Development of mobile-phone-specific components
13. ✓✓ Demo exercising realised system layer 13. Demo exercising realised system layer
14. Security & accessibility review 14. Security & accessibility review
- Security review of items 8, 9 and 12 would be most worthwhile. - Security review of items 8, 9 and 12 would be most worthwhile.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 17 KiB

View File

@ -1,2 +0,0 @@
/packages
/target

View File

@ -80,17 +80,17 @@ veryclean: clean
build-image: check-tools .build-image.$(ARCH) build-image: check-tools .build-image.$(ARCH)
.build-image.$(ARCH): $(KEYFILE) .build-image.$(ARCH): $(KEYFILE)
docker build \ docker buildx build \
--progress plain \
$(DOCKER_BUILD_ARGS) \ $(DOCKER_BUILD_ARGS) \
--pull \
--platform=linux/$(DOCKER_ARCH) \ --platform=linux/$(DOCKER_ARCH) \
-t synit-build:$(ARCH) . -t synit-build:$(ARCH) .
touch $@ touch $@
.build-image.rust.$(ARCH): .build-image.$(ARCH) .build-image.rust.$(ARCH): .build-image.$(ARCH)
docker build \ docker buildx build \
--progress plain \
$(DOCKER_BUILD_ARGS) \ $(DOCKER_BUILD_ARGS) \
--pull \
--platform=linux/$(DOCKER_ARCH) \ --platform=linux/$(DOCKER_ARCH) \
-t synit-build-rust:$(ARCH) -f Dockerfile.rust . -t synit-build-rust:$(ARCH) -f Dockerfile.rust .
touch $@ touch $@
@ -105,15 +105,12 @@ $(KEYFILE):
check-tools: check-tools:
@rm -f .versions @rm -f .versions
@rustc +nightly --version >> .versions @preserves-tool --version >> .versions
@cross +nightly --version >> .versions
@docker --version >> .versions
@python3 --version >> .versions
@git --version >> .versions @git --version >> .versions
@ssh -V >> .versions 2>&1 @ssh -V >> .versions 2>&1
@rsync --version | head -1 >> .versions @rsync --version | head -1 >> .versions
@python3 --version >> .versions
@rustc --version >> .versions
@cargo --version >> .versions
@make --version | head -1 >> .versions @make --version | head -1 >> .versions
@cc --version | head -1 >> .versions @docker --version >> .versions
@preserves-tool --version >> .versions
@qemu-system-aarch64 --version | head -1 >> .versions
@ls -la /proc/sys/fs/binfmt_misc/qemu-aarch64 >> .versions 2>&1 || true

View File

@ -1,7 +1,7 @@
#!/bin/sh #!/bin/sh
case $1 in case $1 in
aarch64) echo arm64;; aarch64) echo arm64;;
x86_64) echo amd64;; x86_64) echo x86_64;;
armv7) echo armhf;; armv7) echo armhf;;
*) *)
echo 'ERROR: Unknown Alpine ARCH '"$1" >&2 echo 'ERROR: Unknown Alpine ARCH '"$1" >&2

View File

@ -1,6 +1,6 @@
# Maintainer: Tony Garnock-Jones <tonyg@leastfixedpoint.com> # Maintainer: Tony Garnock-Jones <tonyg@leastfixedpoint.com>
pkgname=preserves-schemas pkgname=preserves-schemas
pkgver=0.994.0-r20240301 pkgver=0.6.3-r20220619
pkgrel=0 pkgrel=0
pkgdesc="Shared Preserves Schema definitions" pkgdesc="Shared Preserves Schema definitions"
url="https://preserves.dev/" url="https://preserves.dev/"
@ -20,5 +20,5 @@ package() {
} }
sha512sums=" sha512sums="
2f6a14ec262a8ed8120f0cfe4c6e7641dd5abd6e17a18cc3fb5f51c5d6a0801ac6ace53234a1b35a38452e24b59bf25b4c1697f56c2a7527c33867a1ad8e4248 preserves-0.994.0-r20240301.zip 9fde41df7ca69252924da758eb7e7129fb83edb6a2dd9ec2d7115b17a8e390b9f30335393cdd4d06219a1b002fb04b4bd867a0bd8d80d18e1be85f857d5da3b0 preserves-0.6.3-r20220619.zip
" "

View File

@ -4,4 +4,4 @@ buildlog.*
preserves-tool.aarch64 preserves-tool.aarch64
preserves-tool.armv7 preserves-tool.armv7
preserves-tool.x86_64 preserves-tool.x86_64
preserves-rs/ preserves/

View File

@ -1,21 +1,24 @@
# -*- makefile -*- # -*- makefile -*-
prepare: preserves-rs miniclean prepare: preserves miniclean
$(MAKE) -C preserves-rs $(ARCH)-binary-release echo nightly > preserves/implementations/rust/rust-toolchain
cp -p preserves-rs/target/target.$(ARCH)/$(ARCH)-*/release/preserves-tool \ $(MAKE) -C preserves/implementations/rust $(ARCH)-binary-release
cp -p preserves/implementations/rust/target/$(ARCH)-*/release/preserves-tool \
preserves-tool.$(ARCH) preserves-tool.$(ARCH)
(cd preserves-rs/preserves-tools && cargo metadata --format-version 1) \ (cd preserves/implementations/rust/preserves-tools && cargo metadata --format-version 1) \
| preserves-tool convert --output-format unquoted \ | preserves-tool convert --output-format unquoted \
--select '. "packages" / [. "name" = "preserves-tools"] . "version"' \ --select '. "packages" / [. "name" = "preserves-tools"] . "version"' \
> VERSION > VERSION
(cd preserves-rs; ../../../gitversion) > GITVERSION rm -f preserves/implementations/rust/rust-toolchain
(cd preserves; ../../../gitversion) > GITVERSION
preserves-rs: preserves:
git clone https://gitlab.com/preserves/preserves-rs git clone https://gitlab.com/preserves/preserves
miniclean: miniclean:
rm -f preserves-tool.$(ARCH) rm -f preserves-tool.$(ARCH)
clean: miniclean clean: miniclean
rm -rf preserves-rs/target rm -rf preserves/implementations/rust/target
rm -f preserves/implementations/rust/rust-toolchain
rm -f VERSION rm -f VERSION

View File

@ -1,27 +1,27 @@
# Maintainer: Tony Garnock-Jones <tonyg@leastfixedpoint.com> # Maintainer: Tony Garnock-Jones <tonyg@leastfixedpoint.com>
pkgname=py3-preserves pkgname=py3-preserves
_pyname=preserves _pyname=preserves
pkgver=0.994.0 pkgver=0.16.1
pkgrel=0 pkgrel=0
pkgdesc="Preserves serialization format" pkgdesc="Preserves serialization format"
url="https://preserves.dev/" url="https://preserves.dev/"
arch="noarch" arch="noarch"
license="Apache-2.0" license="Apache-2.0"
depends="python3" depends="python3"
makedepends="py3-setuptools py3-pip py3-wheel py3-build" makedepends="py3-setuptools py3-pip py3-wheel"
_pypiprefix="${_pyname%${_pyname#?}}" _pypiprefix="${_pyname%${_pyname#?}}"
source="https://files.pythonhosted.org/packages/source/$_pypiprefix/$_pyname/$_pyname-$pkgver.tar.gz" source="https://files.pythonhosted.org/packages/source/$_pypiprefix/$_pyname/$_pyname-$pkgver.tar.gz"
builddir="$srcdir/$_pyname-$pkgver" builddir="$srcdir/$_pyname-$pkgver"
options="!check" options="!check"
build() { build() {
python3 -m build python3 setup.py build
} }
package() { package() {
python3 -m pip install --prefix=/usr --root="$pkgdir" ./dist/preserves-$pkgver-*.whl python3 setup.py install --prefix=/usr --root="$pkgdir"
} }
sha512sums=" sha512sums="
1b4c65f61a85204d68dcf6568fc63511ac407af1606e4d7edf7adfa12c1cf3ab72e4e344ee9536f012fda1fe3cf22ca5e90db712e3621890d5723708f0c0ce80 preserves-0.994.0.tar.gz 4091fbdcff4c6a276248267d7af288aec035c88b0fd8295e48c3ee6fd1caca9071184ec8467bcc9e2685810e78db8151baabaaba4b5c0562d533af7039dd003e preserves-0.16.1.tar.gz
" "

View File

@ -1,27 +1,27 @@
# Maintainer: Tony Garnock-Jones <tonyg@leastfixedpoint.com> # Maintainer: Tony Garnock-Jones <tonyg@leastfixedpoint.com>
pkgname=py3-syndicate pkgname=py3-syndicate
_pyname=syndicate-py _pyname=syndicate-py
pkgver=0.16.0 pkgver=0.8.5
pkgrel=0 pkgrel=0
pkgdesc="Syndicated Actor model for Python" pkgdesc="Syndicated Actor model for Python"
url="https://syndicate-lang.org/" url="https://syndicate-lang.org/"
arch="noarch" arch="noarch"
license="GPL-3.0-or-later" license="GPL-3.0-or-later"
depends="python3 py3-preserves py3-websockets" depends="python3 py3-preserves py3-websockets"
makedepends="py3-setuptools py3-pip py3-wheel py3-build" makedepends="py3-setuptools py3-pip py3-wheel"
_pypiprefix="${_pyname%${_pyname#?}}" _pypiprefix="${_pyname%${_pyname#?}}"
source="https://files.pythonhosted.org/packages/source/$_pypiprefix/$_pyname/$_pyname-$pkgver.tar.gz" source="https://files.pythonhosted.org/packages/source/$_pypiprefix/$_pyname/$_pyname-$pkgver.tar.gz"
builddir="$srcdir/$_pyname-$pkgver" builddir="$srcdir/$_pyname-$pkgver"
options="!check" options="!check"
build() { build() {
python3 -m build python3 setup.py build
} }
package() { package() {
python3 -m pip install --prefix=/usr --root="$pkgdir" ./dist/syndicate_py-$pkgver-*.whl python3 setup.py install --prefix=/usr --root="$pkgdir"
} }
sha512sums=" sha512sums="
bc4298d9b7dce9fb7cfa0ae9490f7cb61dc9fcbd2d6cdf1396657645d20ff48fb342c64383ee58569d2cf2c630c9f0ffa781288b82f7d199ae3a4499a288b160 syndicate-py-0.16.0.tar.gz 34de54a53d6a8197b534a2b3982b501439f7a1b4e9befd19b60a01516a36ce0b8bf61681d4b4b798e6a17d8ece3ffcff0017c1858e5f5f8b43f8677e19b78d88 syndicate-py-0.8.5.tar.gz
" "

View File

@ -1,6 +1,6 @@
# Maintainer: Tony Garnock-Jones <tonyg@leastfixedpoint.com> # Maintainer: Tony Garnock-Jones <tonyg@leastfixedpoint.com>
pkgname=syndicate-schemas pkgname=syndicate-schemas
pkgver=0.4.0-r20240301 pkgver=0.0.2-r20220206
pkgrel=1 pkgrel=1
pkgdesc="Shared Syndicate Preserves Schema definitions" pkgdesc="Shared Syndicate Preserves Schema definitions"
url="https://syndicate-lang.org/" url="https://syndicate-lang.org/"
@ -19,5 +19,5 @@ package() {
} }
sha512sums=" sha512sums="
5669756bceec8c5283041f701016e413981894e268a8630ea32332a2529143242c190dd31425de18daa249c913f10402700c00dee07ab4ee92c13a5210c68853 0.4.0-r20240301.zip 9e23aae70aebcfc96b043a6bc437027a803f6eff78a8f2725cc50b0fa83a75e814c789fd05b6333bb1a31af396b984fbed82e37daf7f542d909cee4a052b5adc 0.0.2-r20220206.zip
" "

View File

@ -1,7 +1,7 @@
# Contributor: Tony Garnock-Jones <tonyg@leastfixedpoint.com> # Contributor: Tony Garnock-Jones <tonyg@leastfixedpoint.com>
# Maintainer: Tony Garnock-Jones <tonyg@leastfixedpoint.com> # Maintainer: Tony Garnock-Jones <tonyg@leastfixedpoint.com>
pkgname=syndicate-sh pkgname=syndicate-sh
pkgver=0.0.3 pkgver=0.0.1
pkgrel=0 pkgrel=0
pkgdesc="Syndicate connectivity shell support functions" pkgdesc="Syndicate connectivity shell support functions"
url="https://syndicate-lang.org/" url="https://syndicate-lang.org/"
@ -25,5 +25,5 @@ package() {
} }
sha512sums=" sha512sums="
ed6140f2ade11d8bd9f730efba28bacd9b517d9035dc890ab5c3cc85f3cd735aee8930e686b3e507291325384a377613c3b1b1f0ee395fbfa1e9fc1e6a86e407 syndicate.sh 21abf6305b7e81ebe4d0175a8c0c5a6fb1a75422071dea49f5a923e2dc5de7b41a194b2ead38afe4076834d3f299d77cdd21e88c6f7c52816e691907c1a683d3 syndicate.sh
" "

View File

@ -1,7 +1,7 @@
# Contributor: Tony Garnock-Jones <tonyg@leastfixedpoint.com> # Contributor: Tony Garnock-Jones <tonyg@leastfixedpoint.com>
# Maintainer: Tony Garnock-Jones <tonyg@leastfixedpoint.com> # Maintainer: Tony Garnock-Jones <tonyg@leastfixedpoint.com>
pkgname=synit-config pkgname=synit-config
pkgver=0.0.8$(cat GITVERSION) pkgver=0.0.6$(cat GITVERSION)
pkgrel=0 pkgrel=0
pkgdesc="synit system layer configuration" pkgdesc="synit system layer configuration"
url="https://synit.org/" url="https://synit.org/"

View File

@ -1,5 +1,5 @@
# Sending <exec SOMECOMMAND RESTARTPOLICY> causes the command to be run. ; Sending <exec SOMECOMMAND RESTARTPOLICY> causes the command to be run.
# ;
?? <exec ?argv ?restartPolicy> [ ?? <exec ?argv ?restartPolicy> [
let ?id = timestamp let ?id = timestamp
let ?facet = facet let ?facet = facet
@ -14,6 +14,6 @@
? <service-state <daemon $d> failed> [$facet ! stop] ? <service-state <daemon $d> failed> [$facet ! stop]
] ]
# If the restart policy is not specified, it is defaulted to `on-error`. ; If the restart policy is not specified, it is defaulted to `on-error`.
# ;
?? <exec ?argv> ! <exec $argv on-error> ?? <exec ?argv> ! <exec $argv on-error>

View File

@ -1,7 +1,7 @@
# To "run" a milestone service, ; To "run" a milestone service,
# - assert that it is both started and ready ; - assert that it is both started and ready
# - that's it! ; - that's it!
# ;
? <run-service <milestone ?m>> [ ? <run-service <milestone ?m>> [
<service-state <milestone $m> started> <service-state <milestone $m> started>
<service-state <milestone $m> ready> <service-state <milestone $m> ready>

View File

@ -1,4 +1,4 @@
# To the usual suite of service states we add `up`, meaning "either `ready` or `complete`". ; To the usual suite of service states we add `up`, meaning "either `ready` or `complete`".
# ;
? <service-state ?x ready> <service-state $x up> ? <service-state ?x ready> <service-state $x up>
? <service-state ?x complete> <service-state $x up> ? <service-state ?x complete> <service-state $x up>

View File

@ -1,28 +1,28 @@
# Attenuate `$config` by rewriting plain `require-service` assertions to `require-core-service` ; Attenuate `$config` by rewriting plain `require-service` assertions to `require-core-service`
# assertions. Allow all other assertions through. ; assertions. Allow all other assertions through.
# ;
let ?sys = <* $config [<or [ let ?sys = <* $config [
<rewrite <require-service ?s> <require-core-service $s>> <rewrite <require-service ?s> <require-core-service $s>>
<accept _> <filter _>
]>]> ]>
# Give meaning to `require-core-service`: it is an ordinary `require-service`, plus a ; Give meaning to `require-core-service`: it is an ordinary `require-service`, plus a
# declaration that the `core` milestone depends on the service. ; declaration that the `core` milestone depends on the service.
# ;
? <require-core-service ?s> [ ? <require-core-service ?s> [
<depends-on <milestone core> <service-state $s up>> <depends-on <milestone core> <service-state $s up>>
<require-service $s> <require-service $s>
] ]
# Load config in the `core` directory, using the wrapped `config` so that all plain services ; Load config in the `core` directory, using the wrapped `config` so that all plain services
# required are changed to be *core* services. ; required are changed to be *core* services.
# ;
<require-service <config-watcher "/etc/syndicate/core" { <require-service <config-watcher "/etc/syndicate/core" {
config: $sys config: $sys
gatekeeper: $gatekeeper gatekeeper: $gatekeeper
log: $log log: $log
}>> }>>
# In addition, require the `core` milestone explicitly. ; In addition, require the `core` milestone explicitly.
# ;
<require-service <milestone core>> <require-service <milestone core>>

View File

@ -1,22 +1,22 @@
# Attenuate `$config` by rewriting plain `require-service` assertions to ; Attenuate `$config` by rewriting plain `require-service` assertions to
# `require-basic-service` assertions. Allow all other assertions through. ; `require-basic-service` assertions. Allow all other assertions through.
# ;
let ?basic = <* $config [<or [ let ?basic = <* $config [
<rewrite <require-service ?s> <require-basic-service $s>> <rewrite <require-service ?s> <require-basic-service $s>>
<accept _> <filter _>
]>]> ]>
# Give meaning to `require-basic-service`: it is an ordinary `require-service`, plus a ; Give meaning to `require-basic-service`: it is an ordinary `require-service`, plus a
# declaration that the service depends on the `core` milestone. ; declaration that the service depends on the `core` milestone.
# ;
? <require-basic-service ?s> [ ? <require-basic-service ?s> [
<depends-on $s <service-state <milestone core> up>> <depends-on $s <service-state <milestone core> up>>
<require-service $s> <require-service $s>
] ]
# Once we see that the `core` milestone is ready, start processing the `services` ; Once we see that the `core` milestone is ready, start processing the `services`
# directory. ; directory.
# ;
? <service-state <milestone core> up> [ ? <service-state <milestone core> up> [
<require-service <config-watcher "/etc/syndicate/services" { <require-service <config-watcher "/etc/syndicate/services" {
config: $basic config: $basic

View File

@ -1,4 +1,4 @@
# Pinephone: ; Pinephone:
<require-service <qmi-wwan "/dev/cdc-wdm0">> <require-service <qmi-wwan "/dev/cdc-wdm0">>
<depends-on <qmi-wwan "/dev/cdc-wdm0"> <service-state <daemon eg25-manager> up>> <depends-on <qmi-wwan "/dev/cdc-wdm0"> <service-state <daemon eg25-manager> up>>
@ -7,7 +7,7 @@
<depends-on <daemon eg25-manager> <service-state <daemon eg25-manager-monitor> up>> <depends-on <daemon eg25-manager> <service-state <daemon eg25-manager-monitor> up>>
<daemon eg25-manager-monitor "/usr/lib/synit/eg25-manager-monitor"> <daemon eg25-manager-monitor "/usr/lib/synit/eg25-manager-monitor">
# More generally: ; More generally:
? <user-setting <mobile-data-enabled>> [ ? <user-setting <mobile-data-enabled>> [
? <user-setting <mobile-data-apn ?apn>> [ ? <user-setting <mobile-data-apn ?apn>> [
@ -20,25 +20,25 @@
? <run-service <daemon <qmi-wwan-manager ?dev ?apn>>> [ ? <run-service <daemon <qmi-wwan-manager ?dev ?apn>>> [
<daemon <qmi-wwan-manager $dev $apn> ["/usr/lib/synit/qmi-wwan-manager" $dev $apn]> <daemon <qmi-wwan-manager $dev $apn> ["/usr/lib/synit/qmi-wwan-manager" $dev $apn]>
# Occasionally qmi-wwan-manager complains on stderr about the link going away, but doesn't ; Occasionally qmi-wwan-manager complains on stderr about the link going away, but doesn't
# terminate. Fortunately it doesn't seem to talk on stderr at all unless the link goes away, ; terminate. Fortunately it doesn't seem to talk on stderr at all unless the link goes away,
# so we interpret any stderr activity (!) as indication of a problem here. ; so we interpret any stderr activity (!) as indication of a problem here.
$log ?? <log _ { $log ?? <log _ {
service: <daemon <qmi-wwan-manager $dev $apn>> service: <daemon <qmi-wwan-manager $dev $apn>>
stream: stderr stream: stderr
pid: ?pid pid: ?pid
}> [ }> [
# We used to just do this: ; We used to just do this:
# ;
# $config ! <restart-service <daemon <qmi-wwan-manager $dev $apn>>> ; $config ! <restart-service <daemon <qmi-wwan-manager $dev $apn>>>
# ;
# ... but it immediately restarts the service, causing lots of pointless load and log spam. ; ... but it immediately restarts the service, causing lots of pointless load and log spam.
# TODO: make it so you can include an exit status in the restart request; something like ; TODO: make it so you can include an exit status in the restart request; something like
# "restart immediately" vs "simulated normal termination" vs "simulated error termination", ; "restart immediately" vs "simulated normal termination" vs "simulated error termination",
# triggering the appropriate supervisor behaviours. ; triggering the appropriate supervisor behaviours.
# ;
# So instead we kill the qmicli program with a signal, which *does* trigger the supervisor ; So instead we kill the qmicli program with a signal, which *does* trigger the supervisor
# in the right way. ; in the right way.
let ?pid = stringify $pid let ?pid = stringify $pid
$config ! <exec ["kill", "-INT", $pid] never> $config ! <exec ["kill", "-INT", $pid] never>
] ]

View File

@ -15,7 +15,7 @@
] ]
? <run-service <daemon <udhcpc ?ifname>>> [ ? <run-service <daemon <udhcpc ?ifname>>> [
# We use a custom script that gives mobile-data devices a sensible routing metric ; We use a custom script that gives mobile-data devices a sensible routing metric
<daemon <udhcpc $ifname> ["udhcpc" "-i" $ifname "-fR" "-s" "/usr/lib/synit/udhcpc.script"]> <daemon <udhcpc $ifname> ["udhcpc" "-i" $ifname "-fR" "-s" "/usr/lib/synit/udhcpc.script"]>
] ]

View File

@ -30,14 +30,5 @@ mkdir -p /usr/local/etc/syndicate/services
# particular we no longer want to run the DHCP server that PostmarketOS runs by default on # particular we no longer want to run the DHCP server that PostmarketOS runs by default on
# usb0. Instead we will be a DHCP client. (This was just easiest to set up.) # usb0. Instead we will be a DHCP client. (This was just easiest to set up.)
killall unudhcpd || true killall unudhcpd || true
# We also don't want the splash screen.
killall pbsplash || true
# This tells Rust programs built with jemallocator to be very aggressive about keeping their
# heaps small. Synit currently targets small machines. Without this, I have seen the system
# syndicate-server take around 300MB of heap when doing not particularly much; with this, it
# takes about 15MB in the same state. There is a performance penalty on being so aggressive
# about heap size, but it's more important to stay small in this circumstance right now.
export _RJEM_MALLOC_CONF="narenas:1,tcache:false,dirty_decay_ms:0,muzzy_decay_ms:0"
exec /sbin/synit-pid1 exec /sbin/synit-pid1

View File

@ -2,7 +2,7 @@
prepare: miniclean prepare: miniclean
$(MAKE) -C ../../../synit-pid1 $(ARCH)-binary-release $(MAKE) -C ../../../synit-pid1 $(ARCH)-binary-release
cp -p ../../../synit-pid1/target/target.$(ARCH)/$(ARCH)-*/release/synit-pid1 synit-pid1.$(ARCH) cp -p ../../../synit-pid1/target/$(ARCH)-*/release/synit-pid1 synit-pid1.$(ARCH)
(cd ../../../synit-pid1 && cargo metadata --format-version 1) | \ (cd ../../../synit-pid1 && cargo metadata --format-version 1) | \
preserves-tool convert --output-format unquoted \ preserves-tool convert --output-format unquoted \
--select '. "packages" / [. "name" = "synit-pid1"] . "version"' > VERSION --select '. "packages" / [. "name" = "synit-pid1"] . "version"' > VERSION

View File

@ -1,6 +1,6 @@
#!/bin/sh #!/bin/sh
apk add ca-certificates openssl wget apk add ca-certificates openssl
openssl s_client -showcerts -connect "$1":3127 </dev/null 2>/dev/null \ openssl s_client -showcerts -connect "$1":3127 </dev/null 2>/dev/null \
| openssl x509 | tee /usr/local/share/ca-certificates/synit-squid-snakeoil.crt | openssl x509 | tee /usr/local/share/ca-certificates/synit-squid-snakeoil.crt
update-ca-certificates update-ca-certificates

View File

@ -1,5 +1,5 @@
#!/bin/sh #!/bin/sh
docker build -t synit-squid "$(dirname "$0")" docker buildx build -t synit-squid "$(dirname "$0")"
docker run --rm --name fetch-squid-cert synit-squid cat /etc/ssl/certs/squid-ca.pem \ docker run --rm --name fetch-squid-cert synit-squid cat /etc/ssl/certs/squid-ca.pem \
> squid-ca.pem > squid-ca.pem
docker run -it --rm \ docker run -it --rm \

View File

@ -1,14 +1,14 @@
´³bundle·µ³ui„´³schema·³version°³ definitions·³Fill´³orµµ±fixed´³atom³Double„„µ±fill´³rec´³lit³fill„´³tupleµ´³named³weight´³atom³ SignedInteger„„´³named³rank´³atom³ SignedInteger„„„„„„„„³Root´³rec´³lit³root„´³tupleµ´³named³id´³refµ„³WidgetId„„´³named³order´³refµ„³SortKey„„„„„³Click´³rec´³lit³click„´³tupleµ´³named³widget´³refµ„³WidgetId„„„„„³Color´³rec´³lit³rgba„´³tupleµ´³named³red´³atom³Double„„´³named³green´³atom³Double„„´³named³blue´³atom³Double„„´³named³alpha´³atom³Double„„„„„³State´³rec´³lit³state„´³tupleµ´³named³widget´³refµ„³WidgetId„„´³named³key³any„´³named³value³any„„„„³Touch´³rec´³lit³touch„´³tupleµ´³named³widget´³refµ„³WidgetId„„´³named³touchId³any„„„„³Parent´³rec´³lit³parent„´³tupleµ´³named³id´³refµ„³WidgetId„„´³named³parentId´³refµ„³WidgetId„„´³named³order´³refµ„³SortKey„„„„„³Sizing´³rec´³lit³sizing„´³tupleµ´³named³ideal´³atom³Double„„´³named³stretch´³refµ„³Fill„„´³named³shrink´³refµ„³Fill„„„„„³Widget´³rec´³lit³widget„´³tupleµ´³named³id´³refµ„³WidgetId„„´³named³type´³refµ„³ ´³bundle·µ³ui„´³schema·³version³ definitions·³Fill´³orµµ±fixed´³atom³Double„„µ±fill´³rec´³lit³fill„´³tupleµ´³named³weight´³atom³ SignedInteger„„´³named³rank´³atom³ SignedInteger„„„„„„„„³Root´³rec´³lit³root„´³tupleµ´³named³id´³refµ„³WidgetId„„´³named³order´³refµ„³SortKey„„„„„³Click´³rec´³lit³click„´³tupleµ´³named³widget´³refµ„³WidgetId„„„„„³Color´³rec´³lit³rgba„´³tupleµ´³named³red´³atom³Double„„´³named³green´³atom³Double„„´³named³blue´³atom³Double„„´³named³alpha´³atom³Double„„„„„³State´³rec´³lit³state„´³tupleµ´³named³widget´³refµ„³WidgetId„„´³named³key³any„´³named³value³any„„„„³Touch´³rec´³lit³touch„´³tupleµ´³named³widget´³refµ„³WidgetId„„´³named³touchId³any„„„„³Parent´³rec´³lit³parent„´³tupleµ´³named³id´³refµ„³WidgetId„„´³named³parentId´³refµ„³WidgetId„„´³named³order´³refµ„³SortKey„„„„„³Sizing´³rec´³lit³sizing„´³tupleµ´³named³ideal´³atom³Double„„´³named³stretch´³refµ„³Fill„„´³named³shrink´³refµ„³Fill„„„„„³Widget´³rec´³lit³widget„´³tupleµ´³named³id´³refµ„³WidgetId„„´³named³type´³refµ„³
WidgetType„„„„„³Window´³rec´³lit³window„´³tupleµ´³named³id´³refµ„³WidgetId„„´³named³space´³embedded³any„„„„„³BoxSize´³rec´³lit³box-size„´³tupleµ´³named³ WidgetType„„„„„³Window´³rec´³lit³window„´³tupleµ´³named³id´³refµ„³WidgetId„„´³named³space´³embedded³any„„„„„³BoxSize´³rec´³lit³box-size„´³tupleµ´³named³
horizontal´³refµ„³Sizing„„´³named³vertical´³refµ„³Sizing„„„„„³SortKey´³orµµ±double´³atom³Double„„µ±string´³atom³String„„„„³LeafType´³orµµ±blank´³lit³blank„„µ±text´³lit³text„„µ±slider´³lit³slider„„µ±image´³lit³image„„µ±icon´³lit³icon„„„„³NodeType´³orµµ±column´³lit³column„„µ±row´³lit³row„„„„³WidgetId³any³ Attribute´³rec´³lit³ attribute„´³tupleµ´³named³id´³refµ„³WidgetId„„´³named³key´³atom³Symbol„„´³named³value³any„„„„³ horizontal´³refµ„³Sizing„„´³named³vertical´³refµ„³Sizing„„„„„³SortKey´³orµµ±double´³atom³Double„„µ±string´³atom³String„„„„³LeafType´³orµµ±blank´³lit³blank„„µ±text´³lit³text„„µ±slider´³lit³slider„„µ±image´³lit³image„„µ±icon´³lit³icon„„„„³NodeType´³orµµ±column´³lit³column„„µ±row´³lit³row„„„„³WidgetId³any³ Attribute´³rec´³lit³ attribute„´³tupleµ´³named³id´³refµ„³WidgetId„„´³named³key´³atom³Symbol„„´³named³value³any„„„„³
WidgetType´³orµµ±NodeType´³refµ„³NodeType„„µ±LeafType´³refµ„³LeafType„„„„³ WindowTitle´³rec´³lit³ window-title„´³tupleµ´³named³title´³atom³String„„„„„³WidgetInstance´³rec´³lit³widget-instance„´³tupleµ´³named³id´³refµ„³WidgetId„„´³named³instance´³embedded³any„„„„„³WindowCloseable´³rec´³lit³window-closeable„´³tupleµ„„„³VisibleScrollRange´³orµµ±none´³lit³none„„µ±visibleScrollRange´³rec´³lit³visible-scroll-range„´³tupleµ´³rec´³lit³min„´³tupleµ´³named³minId´³refµ„³WidgetId„„´³named³ WidgetType´³orµµ±NodeType´³refµ„³NodeType„„µ±LeafType´³refµ„³LeafType„„„„³ WindowTitle´³rec´³lit³ window-title„´³tupleµ´³named³title´³atom³String„„„„„³WidgetInstance´³rec´³lit³widget-instance„´³tupleµ´³named³id´³refµ„³WidgetId„„´³named³instance´³embedded³any„„„„„³WindowCloseable´³rec´³lit³window-closeable„´³tupleµ„„„³VisibleScrollRange´³orµµ±none´³lit³none„„µ±visibleScrollRange´³rec´³lit³visible-scroll-range„´³tupleµ´³rec´³lit³min„´³tupleµ´³named³minId´³refµ„³WidgetId„„´³named³
minSortKey´³refµ„³SortKey„„„„„´³rec´³lit³max„´³tupleµ´³named³maxId´³refµ„³WidgetId„„´³named³ minSortKey´³refµ„³SortKey„„„„„´³rec´³lit³max„´³tupleµ´³named³maxId´³refµ„³WidgetId„„´³named³
maxSortKey´³refµ„³SortKey„„„„„„„„„„„„³ embeddedType€„„µ³mime„´³schema·³version°³ definitions·³Value´³rec´³lit³mime„´³tupleµ´³named³type´³atom³Symbol„„´³named³data´³atom³ maxSortKey´³refµ„³SortKey„„„„„„„„„„„„³ embeddedType€„„µ³mime„´³schema·³version³ definitions·³Value´³rec´³lit³mime„´³tupleµ´³named³type´³atom³Symbol„„´³named³data´³atom³
ByteString„„„„„„³ embeddedType€„„µ³time„´³schema·³version°³ definitions·³Stamp´³rec´³lit³rfc3339„´³tupleµ´³named³value´³atom³String„„„„„„³ embeddedType€„„µ³audio„´³schema·³version°³ definitions·³Sink´³orµµ±speaker´³lit³speaker„„µ±headset´³lit³headset„„µ±earpiece´³lit³earpiece„„„„³Source´³orµµ± speakerphone´³lit³ speakerphone„„µ±headset´³lit³headset„„µ±handset´³lit³handset„„„„³Mapping´³rec´³lit³ alsa-mapping„´³tupleµ´³named³abstract´³refµ„³Endpoint„„´³named³concrete´³atom³String„„„„„³Endpoint´³orµµ±source´³rec´³lit³source„´³tupleµ´³named³value´³refµ„³Source„„„„„„µ±sink´³rec´³lit³sink„´³tupleµ´³named³value´³refµ„³Sink„„„„„„„„³HeadsetSpeakerPresent´³rec´³lit³headset-speaker-present„´³tupleµ„„„³HeadsetMicrophonePresent´³rec´³lit³headset-microphone-present„´³tupleµ„„„„³ embeddedType€„„µ³hayes„´³schema·³version°³ definitions·³Result´³rec´³lit³result„´³tupleµ´³named³text´³atom³String„„´³named³tag´³refµ„³ MaybeString„„´³named³fields´³refµ„³ MaybeStrings„„„„„³ ByteString„„„„„„³ embeddedType€„„µ³time„´³schema·³version³ definitions·³Stamp´³rec´³lit³rfc3339„´³tupleµ´³named³value´³atom³String„„„„„„³ embeddedType€„„µ³audio„´³schema·³version³ definitions·³Sink´³orµµ±speaker´³lit³speaker„„µ±headset´³lit³headset„„µ±earpiece´³lit³earpiece„„„„³Source´³orµµ± speakerphone´³lit³ speakerphone„„µ±headset´³lit³headset„„µ±handset´³lit³handset„„„„³Mapping´³rec´³lit³ alsa-mapping„´³tupleµ´³named³abstract´³refµ„³Endpoint„„´³named³concrete´³atom³String„„„„„³Endpoint´³orµµ±source´³rec´³lit³source„´³tupleµ´³named³value´³refµ„³Source„„„„„„µ±sink´³rec´³lit³sink„´³tupleµ´³named³value´³refµ„³Sink„„„„„„„„³HeadsetSpeakerPresent´³rec´³lit³headset-speaker-present„´³tupleµ„„„³HeadsetMicrophonePresent´³rec´³lit³headset-microphone-present„´³tupleµ„„„„³ embeddedType€„„µ³hayes„´³schema·³version³ definitions·³Result´³rec´³lit³result„´³tupleµ´³named³text´³atom³String„„´³named³tag´³refµ„³ MaybeString„„´³named³fields´³refµ„³ MaybeStrings„„„„„³
CommandRPC´³rec´³lit³execute-command„´³tupleµ´³named³ commandText´³atom³String„„´³named³replyTo´³embedded´³refµ„³ CommandResult„„„„„„³ MaybeString´³orµµ±present´³atom³String„„µ±absent´³lit€„„„„³ CommandEvent´³rec´³lit³execute-command„´³tupleµ´³named³ commandText´³atom³String„„„„„³ MaybeStrings´³orµµ±present´³seqof´³atom³String„„„µ±absent´³lit€„„„„³ ModemPresent´³rec´³lit³modem„´³tupleµ´³lit³hayes„´³named³ CommandRPC´³rec´³lit³execute-command„´³tupleµ´³named³ commandText´³atom³String„„´³named³replyTo´³embedded´³refµ„³ CommandResult„„„„„„³ MaybeString´³orµµ±present´³atom³String„„µ±absent´³lit€„„„„³ CommandEvent´³rec´³lit³execute-command„´³tupleµ´³named³ commandText´³atom³String„„„„„³ MaybeStrings´³orµµ±present´³seqof´³atom³String„„„µ±absent´³lit€„„„„³ ModemPresent´³rec´³lit³modem„´³tupleµ´³lit³hayes„´³named³
devicePath´³atom³String„„´³named³ dataspace´³embedded´³refµ„³InternalProtocol„„„„„„³ CommandResult´³rec´³lit³command-result„´³tupleµ´³named³ commandText´³atom³String„„´³named³results´³seqof´³refµ„³Result„„„´³named³ finalResult´³atom³String„„„„„³InternalProtocol³any³UnsolicitedResultCode´³rec´³lit³ unsolicited„´³tupleµ´³named³result´³refµ„³Result„„„„„„³ embeddedType€„„µ³network„´³schema·³version°³ definitions·³Route´³rec´³lit³route„´³tupleµ´³named³ addressFamily´³refµ„³ AddressFamily„„´³named³ destination´³refµ„³RouteDestination„„´³named³priority´³atom³ SignedInteger„„´³named³ typeOfService´³atom³ SignedInteger„„´³named³ interfaceName´³refµ„³RouteInterface„„´³named³gateway´³refµ„³Gateway„„„„„³Gateway´³orµµ±addr´³atom³String„„µ±none´³lit€„„„„³Hotspot´³rec´³lit³hotspot„´³tupleµ´³named³ interfaceName´³atom³String„„´³named³ssid´³atom³String„„´³named³authentication´³refµ„³WifiAuthentication„„„„„³ Interface´³rec´³lit³ interface„´³tupleµ´³named³name´³atom³String„„´³named³index´³atom³ SignedInteger„„´³named³type´³refµ„³ InterfaceType„„´³named³administrativeState´³refµ„³AdministrativeState„„´³named³operationalState´³refµ„³OperationalState„„´³named³carrier´³refµ„³ CarrierState„„´³named³linkAddr´³atom³String„„„„„³ CarrierState´³orµµ± noCarrier´³lit³ devicePath´³atom³String„„´³named³ dataspace´³embedded´³refµ„³InternalProtocol„„„„„„³ CommandResult´³rec´³lit³command-result„´³tupleµ´³named³ commandText´³atom³String„„´³named³results´³seqof´³refµ„³Result„„„´³named³ finalResult´³atom³String„„„„„³InternalProtocol³any³UnsolicitedResultCode´³rec´³lit³ unsolicited„´³tupleµ´³named³result´³refµ„³Result„„„„„„³ embeddedType€„„µ³network„´³schema·³version³ definitions·³Route´³rec´³lit³route„´³tupleµ´³named³ addressFamily´³refµ„³ AddressFamily„„´³named³ destination´³refµ„³RouteDestination„„´³named³priority´³atom³ SignedInteger„„´³named³ typeOfService´³atom³ SignedInteger„„´³named³ interfaceName´³refµ„³RouteInterface„„´³named³gateway´³refµ„³Gateway„„„„„³Gateway´³orµµ±addr´³atom³String„„µ±none´³lit€„„„„³Hotspot´³rec´³lit³hotspot„´³tupleµ´³named³ interfaceName´³atom³String„„´³named³ssid´³atom³String„„´³named³authentication´³refµ„³WifiAuthentication„„„„„³ Interface´³rec´³lit³ interface„´³tupleµ´³named³name´³atom³String„„´³named³index´³atom³ SignedInteger„„´³named³type´³refµ„³ InterfaceType„„´³named³administrativeState´³refµ„³AdministrativeState„„´³named³operationalState´³refµ„³OperationalState„„´³named³carrier´³refµ„³ CarrierState„„´³named³linkAddr´³atom³String„„„„„³ CarrierState´³orµµ± noCarrier´³lit³
no-carrier„„µ±carrier´³lit³carrier„„„„³ DefaultRoute´³rec´³lit³ default-route„´³tupleµ´³named³ addressFamily´³refµ„³ AddressFamily„„„„„³ HotspotState´³rec´³lit³ hotspot-state„´³tupleµ´³named³ interfaceName´³atom³String„„´³named³ssid´³atom³String„„´³named³ stationCount´³atom³ SignedInteger„„„„„³ AddressFamily´³orµµ±ipv4´³lit³ipv4„„µ±ipv6´³lit³ipv6„„µ±other´³atom³ SignedInteger„„„„³ InterfaceType´³orµµ±loopback´³lit³loopback„„µ±normal´³lit³normal„„µ±wireless´³lit³wireless„„„„³ MobileDataApn´³rec´³lit³mobile-data-apn„´³tupleµ´³named³apn´³atom³String„„„„„³RouteInterface´³orµµ±name´³atom³String„„µ±none´³lit€„„„„³WifiAssociation´³rec´³lit³wifi-association„´³tupleµ´³named³ interfaceName´³atom³String„„´³named³ssid´³atom³String„„´³named³state´³refµ„³WifiAssociationState„„„„„³OperationalState´³orµµ±unknown´³lit³unknown„„µ±down´³lit³down„„µ±lowerLayerDown´³lit³lower-layer-down„„µ±testing´³lit³testing„„µ±dormant´³lit³dormant„„µ±up´³lit³up„„„„³RouteDestination´³orµµ±default´³lit³default„„µ±prefix´³rec´³lit³prefix„´³tupleµ´³named³net´³atom³String„„´³named³bits´³atom³ SignedInteger„„„„„„„„³SavedWifiNetwork´³rec´³lit³saved-wifi-network„´³tupleµ´³named³ssid´³atom³String„„´³named³authentication´³refµ„³WifiAuthentication„„´³named³priority´³atom³Double„„„„„³MobileDataEnabled´³rec´³lit³mobile-data-enabled„´³tupleµ„„„³WifiAuthentication´³orµµ±open´³lit³open„„µ±psk´³rec´³lit³psk„´³tupleµ´³named³password´³atom³String„„„„„„µ±other³any„„„³AdministrativeState´³orµµ±unknown´³lit³unknown„„µ±down´³lit³down„„µ±up´³lit³up„„„„³SelectedWifiNetwork´³rec´³lit³selected-wifi-network„´³tupleµ´³named³ interfaceName´³atom³String„„´³named³ssid´³atom³String„„´³named³authentication´³refµ„³WifiAuthentication„„„„„³AvailableAccessPoint´³rec´³lit³ available-ap„´³tupleµ´³named³ interfaceName´³atom³String„„´³named³ssid´³atom³String„„„„„³WifiAssociationState´³orµµ± no-carrier„„µ±carrier´³lit³carrier„„„„³ DefaultRoute´³rec´³lit³ default-route„´³tupleµ´³named³ addressFamily´³refµ„³ AddressFamily„„„„„³ HotspotState´³rec´³lit³ hotspot-state„´³tupleµ´³named³ interfaceName´³atom³String„„´³named³ssid´³atom³String„„´³named³ stationCount´³atom³ SignedInteger„„„„„³ AddressFamily´³orµµ±ipv4´³lit³ipv4„„µ±ipv6´³lit³ipv6„„µ±other´³atom³ SignedInteger„„„„³ InterfaceType´³orµµ±loopback´³lit³loopback„„µ±normal´³lit³normal„„µ±wireless´³lit³wireless„„„„³ MobileDataApn´³rec´³lit³mobile-data-apn„´³tupleµ´³named³apn´³atom³String„„„„„³RouteInterface´³orµµ±name´³atom³String„„µ±none´³lit€„„„„³WifiAssociation´³rec´³lit³wifi-association„´³tupleµ´³named³ interfaceName´³atom³String„„´³named³ssid´³atom³String„„´³named³state´³refµ„³WifiAssociationState„„„„„³OperationalState´³orµµ±unknown´³lit³unknown„„µ±down´³lit³down„„µ±lowerLayerDown´³lit³lower-layer-down„„µ±testing´³lit³testing„„µ±dormant´³lit³dormant„„µ±up´³lit³up„„„„³RouteDestination´³orµµ±default´³lit³default„„µ±prefix´³rec´³lit³prefix„´³tupleµ´³named³net´³atom³String„„´³named³bits´³atom³ SignedInteger„„„„„„„„³SavedWifiNetwork´³rec´³lit³saved-wifi-network„´³tupleµ´³named³ssid´³atom³String„„´³named³authentication´³refµ„³WifiAuthentication„„´³named³priority´³atom³Double„„„„„³MobileDataEnabled´³rec´³lit³mobile-data-enabled„´³tupleµ„„„³WifiAuthentication´³orµµ±open´³lit³open„„µ±psk´³rec´³lit³psk„´³tupleµ´³named³password´³atom³String„„„„„„µ±other³any„„„³AdministrativeState´³orµµ±unknown´³lit³unknown„„µ±down´³lit³down„„µ±up´³lit³up„„„„³SelectedWifiNetwork´³rec´³lit³selected-wifi-network„´³tupleµ´³named³ interfaceName´³atom³String„„´³named³ssid´³atom³String„„´³named³authentication´³refµ„³WifiAuthentication„„„„„³AvailableAccessPoint´³rec´³lit³ available-ap„´³tupleµ´³named³ interfaceName´³atom³String„„´³named³ssid´³atom³String„„„„„³WifiAssociationState´³orµµ±
inProgress´³lit³ in-progress„„µ±ready´³lit³ready„„„„„³ embeddedType€„„µ³ telephony„´³schema·³version°³ definitions·³CallId´³atom³ SignedInteger„³Address´³rec´³lit³address„´³tupleµ´³named³ inProgress´³lit³ in-progress„„µ±ready´³lit³ready„„„„„³ embeddedType€„„µ³ telephony„´³schema·³version³ definitions·³CallId´³atom³ SignedInteger„³Address´³rec´³lit³address„´³tupleµ´³named³
numberType´³refµ„³ numberType´³refµ„³
NumberType„„´³named³number´³atom³String„„„„„³CallType´³orµµ±voice´³lit³voice„„µ±data´³lit³data„„µ±fax´³lit³fax„„„„³ CallState´³orµµ±hold´³lit³hold„„µ±original´³lit³original„„µ±connect´³lit³connect„„µ±incoming´³lit³incoming„„µ±waiting´³lit³waiting„„µ±end´³lit³end„„µ±alerting´³lit³alerting„„„„³ PlaceCall´³rec´³lit³ NumberType„„´³named³number´³atom³String„„„„„³CallType´³orµµ±voice´³lit³voice„„µ±data´³lit³data„„µ±fax´³lit³fax„„„„³ CallState´³orµµ±hold´³lit³hold„„µ±original´³lit³original„„µ±connect´³lit³connect„„µ±incoming´³lit³incoming„„µ±waiting´³lit³waiting„„µ±end´³lit³end„„µ±alerting´³lit³alerting„„„„³ PlaceCall´³rec´³lit³
place-call„´³tupleµ´³named³ place-call„´³tupleµ´³named³
@ -17,9 +17,9 @@ ActiveCall
call-state„´³tupleµ´³named³callId´³refµ„³CallId„„´³named³ direction´³refµ„³ CallDirection„„´³named³type´³refµ„³CallType„„´³named³peer´³refµ„³Address„„´³named³state´³refµ„³ CallState„„„„„³ call-state„´³tupleµ´³named³callId´³refµ„³CallId„„´³named³ direction´³refµ„³ CallDirection„„´³named³type´³refµ„³CallType„„´³named³peer´³refµ„³Address„„´³named³state´³refµ„³ CallState„„„„„³
AnswerCall´³rec´³lit³ answer-call„´³tupleµ´³named³callId´³atom³ SignedInteger„„„„„³ AnswerCall´³rec´³lit³ answer-call„´³tupleµ´³named³callId´³atom³ SignedInteger„„„„„³
NumberType´³orµµ±unknown´³lit³unknown„„µ± international´³lit³ international„„µ±national´³lit³national„„µ±gsm0338´³lit³gsm0338„„„„³ PeerRinging´³rec´³lit³ peer-ringing„´³tupleµ„„„³ SmsDelivery´³rec´³lit³ sms-delivery„´³tupleµ´³named³smsc´³refµ„³Address„„´³named³peer´³refµ„³Address„„´³named³ timestamp´³refµ³time„³Stamp„„´³named³body´³atom³String„„„„„³ ModemPresent´³rec´³lit³modem„´³tupleµ´³named³type´³atom³Symbol„„´³named³ NumberType´³orµµ±unknown´³lit³unknown„„µ± international´³lit³ international„„µ±national´³lit³national„„µ±gsm0338´³lit³gsm0338„„„„³ PeerRinging´³rec´³lit³ peer-ringing„´³tupleµ„„„³ SmsDelivery´³rec´³lit³ sms-delivery„´³tupleµ´³named³smsc´³refµ„³Address„„´³named³peer´³refµ„³Address„„´³named³ timestamp´³refµ³time„³Stamp„„´³named³body´³atom³String„„„„„³ ModemPresent´³rec´³lit³modem„´³tupleµ´³named³type´³atom³Symbol„„´³named³
devicePath´³atom³String„„´³named³ dataspace´³embedded³any„„„„„³ PhoneRinging´³rec´³lit³ phone-ringing„´³tupleµ„„„³ ReleaseCause´³orµµ±unassignedNumber´³lit³unassignedNumber„„µ±normal´³lit³normal„„µ±busy´³lit³busy„„µ±noUserResponding´³lit³noUserResponding„„µ± callRejected´³lit³ callRejected„„µ±destinationOutOfOrder´³lit³destinationOutOfOrder„„µ±normalUnspecified´³lit³normalUnspecified„„µ±incompatibleDestination´³lit³incompatibleDestination„„„„³ Speakerphone´³rec´³lit³ speakerphone„´³tupleµ„„„³ CallDirection´³orµµ±mo´³lit³mo„„µ±mt´³lit³mt„„„„³CallIdSelector´³orµµ± specificCall´³atom³ SignedInteger„„µ±allCalls´³lit³all„„„„³CallInProgress´³rec´³lit³call-in-progress„´³tupleµ„„„³DisconnectCall´³rec´³lit³disconnect-call„´³tupleµ´³named³callId´³refµ„³CallIdSelector„„´³named³cause´³refµ„³ ReleaseCause„„„„„³SmsTransmission´³rec´³lit³sms-transmission„´³tupleµ´³named³smsc´³refµ„³Address„„´³named³peer´³refµ„³Address„„´³named³body´³atom³String„„´³named³ continuation´³embedded´³lit³ok„„„„„„„³ embeddedType€„„µ³ soundEffects„´³schema·³version°³ definitions·³ devicePath´³atom³String„„´³named³ dataspace´³embedded³any„„„„„³ PhoneRinging´³rec´³lit³ phone-ringing„´³tupleµ„„„³ ReleaseCause´³orµµ±unassignedNumber´³lit³unassignedNumber„„µ±normal´³lit³normal„„µ±busy´³lit³busy„„µ±noUserResponding´³lit³noUserResponding„„µ± callRejected´³lit³ callRejected„„µ±destinationOutOfOrder´³lit³destinationOutOfOrder„„µ±normalUnspecified´³lit³normalUnspecified„„µ±incompatibleDestination´³lit³incompatibleDestination„„„„³ Speakerphone´³rec´³lit³ speakerphone„´³tupleµ„„„³ CallDirection´³orµµ±mo´³lit³mo„„µ±mt´³lit³mt„„„„³CallIdSelector´³orµµ± specificCall´³atom³ SignedInteger„„µ±allCalls´³lit³all„„„„³CallInProgress´³rec´³lit³call-in-progress„´³tupleµ„„„³DisconnectCall´³rec´³lit³disconnect-call„´³tupleµ´³named³callId´³refµ„³CallIdSelector„„´³named³cause´³refµ„³ ReleaseCause„„„„„³SmsTransmission´³rec´³lit³sms-transmission„´³tupleµ´³named³smsc´³refµ„³Address„„´³named³peer´³refµ„³Address„„´³named³body´³atom³String„„´³named³ continuation´³embedded´³lit³ok„„„„„„„³ embeddedType€„„µ³ soundEffects„´³schema·³version³ definitions·³
AlertSound´³rec´³lit³ alert-sound„´³tupleµ´³named³data´³refµ³mime„³Value„„„„„³ContinuousSound´³rec´³lit³continuous-sound„´³tupleµ´³named³data´³refµ³mime„³Value„„„„„³AlertSoundPlaying´³rec´³lit³alert-sound-playing„´³tupleµ„„„³ContinuousSoundPlaying´³rec´³lit³continuous-sound-playing„´³tupleµ„„„„³ embeddedType€„„µ³ userSettings„´³schema·³version°³ definitions·³Value´³rec´³lit³ user-setting„´³tupleµ´³named³item³any„„„„³Action´³orµµ±assert´³rec´³lit³assert„´³tupleµ´³named³item³any„„„„„µ±retract´³rec´³lit³retract„´³tupleµ´³named³item³any„„„„„„„³ AlertSound´³rec´³lit³ alert-sound„´³tupleµ´³named³data´³refµ³mime„³Value„„„„„³ContinuousSound´³rec´³lit³continuous-sound„´³tupleµ´³named³data´³refµ³mime„³Value„„„„„³AlertSoundPlaying´³rec´³lit³alert-sound-playing„´³tupleµ„„„³ContinuousSoundPlaying´³rec´³lit³continuous-sound-playing„´³tupleµ„„„„³ embeddedType€„„µ³ userSettings„´³schema·³version³ definitions·³Value´³rec´³lit³ user-setting„´³tupleµ´³named³item³any„„„„³Action´³orµµ±assert´³rec´³lit³assert„´³tupleµ´³named³item³any„„„„„µ±retract´³rec´³lit³retract„´³tupleµ´³named³item³any„„„„„„„³
CommandRPC´³rec´³lit³user-settings-command„´³tupleµ´³named³action´³refµ„³Action„„´³named³reply´³embedded´³refµ„³ CommandReply„„„„„„³ CommandEvent´³rec´³lit³user-settings-command„´³tupleµ´³named³action´³refµ„³Action„„„„„³ CommandReply´³lit³done„„³ embeddedType€„„µ³usersAndGroups„´³schema·³version°³ definitions·³Spec´³orµµ± userAccount´³lit³user„„µ± systemAccount´³lit³system„„µ±id´³atom³ SignedInteger„„„„³Group´³rec´³lit³grent„´³tupleµ´³dict·³gid´³named³gid´³atom³ SignedInteger„„³name´³named³name´³atom³String„„„„„„„³Account´³rec´³lit³pwent„´³tupleµ´³dict·³gid´³named³gid´³atom³ SignedInteger„„³uid´³named³uid´³atom³ SignedInteger„„³home´³named³home´³atom³String„„³info´³named³info´³atom³String„„³name´³named³name´³atom³String„„³shell´³named³shell´³atom³String„„„„„„„³ EnsureGroup´³rec´³lit³ ensure-group„´³tupleµ´³named³name´³atom³String„„´³named³spec´³refµ„³Spec„„„„„³ GroupMember´³rec´³lit³ group-member„´³tupleµ´³named³uid´³atom³ SignedInteger„„´³named³gid´³atom³ SignedInteger„„„„„³ EnsureAccount´³rec´³lit³ensure-account„´³tupleµ´³named³name´³atom³String„„´³named³spec´³refµ„³Spec„„„„„„³ embeddedType€„„µ³samsungGalaxyS7„´³schema·³version°³ definitions·³ FmtPacket´³rec´³lit³fmt„´³tupleµ´³named³body´³embedded³any„„„„„³ RfsPacket´³rec´³lit³rfs„´³tupleµ´³named³body´³embedded³any„„„„„³ CommandRPC´³rec´³lit³user-settings-command„´³tupleµ´³named³action´³refµ„³Action„„´³named³reply´³embedded´³refµ„³ CommandReply„„„„„„³ CommandEvent´³rec´³lit³user-settings-command„´³tupleµ´³named³action´³refµ„³Action„„„„„³ CommandReply´³lit³done„„³ embeddedType€„„µ³usersAndGroups„´³schema·³version³ definitions·³Spec´³orµµ± userAccount´³lit³user„„µ± systemAccount´³lit³system„„µ±id´³atom³ SignedInteger„„„„³Group´³rec´³lit³grent„´³tupleµ´³dict·³gid´³named³gid´³atom³ SignedInteger„„³name´³named³name´³atom³String„„„„„„„³Account´³rec´³lit³pwent„´³tupleµ´³dict·³gid´³named³gid´³atom³ SignedInteger„„³uid´³named³uid´³atom³ SignedInteger„„³home´³named³home´³atom³String„„³info´³named³info´³atom³String„„³name´³named³name´³atom³String„„³shell´³named³shell´³atom³String„„„„„„„³ EnsureGroup´³rec´³lit³ ensure-group„´³tupleµ´³named³name´³atom³String„„´³named³spec´³refµ„³Spec„„„„„³ GroupMember´³rec´³lit³ group-member„´³tupleµ´³named³uid´³atom³ SignedInteger„„´³named³gid´³atom³ SignedInteger„„„„„³ EnsureAccount´³rec´³lit³ensure-account„´³tupleµ´³named³name´³atom³String„„´³named³spec´³refµ„³Spec„„„„„„³ embeddedType€„„µ³samsungGalaxyS7„´³schema·³version³ definitions·³ FmtPacket´³rec´³lit³fmt„´³tupleµ´³named³body´³embedded³any„„„„„³ RfsPacket´³rec´³lit³rfs„´³tupleµ´³named³body´³embedded³any„„„„„³
CommandRPC´³rec´³lit³execute-command„´³tupleµ´³named³command´³refµ„³ FmtPacket„„´³named³replyTo´³embedded´³refµ„³ FmtPacket„„„„„„³ ModemPacket´³orµµ±in´³rec´³lit³ CommandRPC´³rec´³lit³execute-command„´³tupleµ´³named³command´³refµ„³ FmtPacket„„´³named³replyTo´³embedded´³refµ„³ FmtPacket„„„„„„³ ModemPacket´³orµµ±in´³rec´³lit³
from-modem„´³tupleµ´³named³packet³any„„„„„µ±out´³rec´³lit³to-modem„´³tupleµ´³named³packet³any„„„„„„„³ CommandEvent´³rec´³lit³execute-command„´³tupleµ´³named³command´³refµ„³ FmtPacket„„„„„³ ModemPresent´³rec´³lit³modem„´³tupleµ´³lit³samsung-galaxy-s7„´³named³ from-modem„´³tupleµ´³named³packet³any„„„„„µ±out´³rec´³lit³to-modem„´³tupleµ´³named³packet³any„„„„„„„³ CommandEvent´³rec´³lit³execute-command„´³tupleµ´³named³command´³refµ„³ FmtPacket„„„„„³ ModemPresent´³rec´³lit³modem„´³tupleµ´³lit³samsung-galaxy-s7„´³named³
devicePath´³atom³String„„´³named³ dataspace´³embedded´³refµ„³InternalProtocol„„„„„„³InternalProtocol³any„³ embeddedType€„„„„ devicePath´³atom³String„„´³named³ dataspace´³embedded´³refµ„³InternalProtocol„„„„„„³InternalProtocol³any„³ embeddedType€„„„„

View File

@ -1,19 +1,19 @@
version 1 . version 1 .
# If headset present: ; If headset present:
# - ringing: speaker & headset ; - ringing: speaker & headset
# - notification: speaker & headset ; - notification: speaker & headset
# - non-speakerphone call: headset ; - non-speakerphone call: headset
# - speakerphone call: speaker ; - speakerphone call: speaker
# - music: headset ; - music: headset
# ;
# If headset absent: ; If headset absent:
# - ringing: speaker ; - ringing: speaker
# - notification: speaker ; - notification: speaker
# - non-speakerphone call: earpiece ; - non-speakerphone call: earpiece
# - speakerphone call: speaker ; - speakerphone call: speaker
# - music: speaker ; - music: speaker
# ;
. .
Mapping = <alsa-mapping @abstract Endpoint @concrete string> . Mapping = <alsa-mapping @abstract Endpoint @concrete string> .

View File

@ -1,21 +1,21 @@
version 1 . version 1 .
# Definitions for the internal workings of the Hayes modem driver. ; Definitions for the internal workings of the Hayes modem driver.
# Assertion. Declares presence of a Hayes modem. ; Assertion. Declares presence of a Hayes modem.
ModemPresent = <modem =hayes @devicePath string @dataspace #:InternalProtocol> . ModemPresent = <modem =hayes @devicePath string @dataspace #!InternalProtocol> .
# TODO not yet properly specified ; TODO not yet properly specified
InternalProtocol = any . InternalProtocol = any .
# Message. Sent when the modem sends us a "URC", an Unsolicited Result Code. ; Message. Sent when the modem sends us a "URC", an Unsolicited Result Code.
UnsolicitedResultCode = <unsolicited @result Result> . UnsolicitedResultCode = <unsolicited @result Result> .
# Assertion. Asks the modem to execute the given command. ; Assertion. Asks the modem to execute the given command.
CommandRPC = <execute-command @commandText string @replyTo #:CommandResult> . CommandRPC = <execute-command @commandText string @replyTo #!CommandResult> .
# Message. Asks the modem to execute the given command, but not to send back the reply. ; Message. Asks the modem to execute the given command, but not to send back the reply.
CommandEvent = <execute-command @commandText string> . CommandEvent = <execute-command @commandText string> .
# Assertion. Describes the result of a command execution. ; Assertion. Describes the result of a command execution.
CommandResult = <command-result @commandText string @results [Result ...] @finalResult string> . CommandResult = <command-result @commandText string @results [Result ...] @finalResult string> .
@<examples [ @<examples [

View File

@ -9,15 +9,15 @@ Interface = <interface
@carrier CarrierState @carrier CarrierState
@linkAddr string> . @linkAddr string> .
# This is synthetic information, based on somewhat ad-hoc heuristics. It'd be nice if there was ; This is synthetic information, based on somewhat ad-hoc heuristics. It'd be nice if there was
# a better way to do this! Maybe someone can point me in the right direction! ; a better way to do this! Maybe someone can point me in the right direction!
# ;
InterfaceType = InterfaceType =
/ # `lo` and friends / ; `lo` and friends
=loopback =loopback
/ # `eth0`, bridges, anything that isn't loopback and isn't wireless / ; `eth0`, bridges, anything that isn't loopback and isn't wireless
=normal =normal
/ # 'wlan0' and friends / ; 'wlan0' and friends
=wireless =wireless
. .
@ -78,8 +78,8 @@ WifiAssociationState = @inProgress =in-progress / =ready .
HotspotState = <hotspot-state @interfaceName string @ssid string @stationCount int> . HotspotState = <hotspot-state @interfaceName string @ssid string @stationCount int> .
# --------------------------------------------------------------------------- ;---------------------------------------------------------------------------
# User settings ; User settings
MobileDataApn = <mobile-data-apn @apn string> . MobileDataApn = <mobile-data-apn @apn string> .
@ -90,11 +90,11 @@ SavedWifiNetwork = <saved-wifi-network
@authentication WifiAuthentication @authentication WifiAuthentication
@priority double> . @priority double> .
WifiAuthentication = WifiAuthentication =
/ # No authentication necessary: open network / ; No authentication necessary: open network
=open =open
/ # Pre-shared key (WPA2-PSK etc) / ; Pre-shared key (WPA2-PSK etc)
<psk @password string> <psk @password string>
/ # Other, not-yet-implemented / ; Other, not-yet-implemented
@other any @other any
. .

View File

@ -1,19 +1,19 @@
version 1 . version 1 .
# Definitions for the internal workings of the Samsung Galaxy S7 modem driver. ; Definitions for the internal workings of the Samsung Galaxy S7 modem driver.
# Assertion. Declares presence of a Hayes modem. ; Assertion. Declares presence of a Hayes modem.
ModemPresent = <modem =samsung-galaxy-s7 @devicePath string @dataspace #:InternalProtocol> . ModemPresent = <modem =samsung-galaxy-s7 @devicePath string @dataspace #!InternalProtocol> .
# TODO not yet properly specified ; TODO not yet properly specified
InternalProtocol = any . InternalProtocol = any .
ModemPacket = @in <from-modem @packet any> / @out <to-modem @packet any> . ModemPacket = @in <from-modem @packet any> / @out <to-modem @packet any> .
# The bodies are instances of SamsungFmtMessage and SamsungRfsMessage, respectively. ; The bodies are instances of SamsungFmtMessage and SamsungRfsMessage, respectively.
FmtPacket = <fmt @body #:any> . FmtPacket = <fmt @body #!any> .
RfsPacket = <rfs @body #:any> . RfsPacket = <rfs @body #!any> .
# Assertion. Asks the modem to execute the given command. ; Assertion. Asks the modem to execute the given command.
CommandRPC = <execute-command @command FmtPacket @replyTo #:FmtPacket> . CommandRPC = <execute-command @command FmtPacket @replyTo #!FmtPacket> .
# Message. Asks the modem to execute the given command, but not to send back the reply. ; Message. Asks the modem to execute the given command, but not to send back the reply.
CommandEvent = <execute-command @command FmtPacket> . CommandEvent = <execute-command @command FmtPacket> .

View File

@ -1,11 +1,11 @@
version 1 . version 1 .
# Assertion. ; Assertion.
ContinuousSound = <continuous-sound @data mime.Value> . ContinuousSound = <continuous-sound @data mime.Value> .
# Assertion. ; Assertion.
ContinuousSoundPlaying = <continuous-sound-playing> . ContinuousSoundPlaying = <continuous-sound-playing> .
# Message. ; Message.
AlertSound = <alert-sound @data mime.Value> . AlertSound = <alert-sound @data mime.Value> .
# Assertion. ; Assertion.
AlertSoundPlaying = <alert-sound-playing> . AlertSoundPlaying = <alert-sound-playing> .

View File

@ -1,22 +1,22 @@
version 1 . version 1 .
# Definitions for non-modem-hardware-specific telephony interactions. ; Definitions for non-modem-hardware-specific telephony interactions.
ModemPresent = <modem @type symbol @devicePath string @dataspace #:any> . ModemPresent = <modem @type symbol @devicePath string @dataspace #!any> .
Address = <address @numberType NumberType @number string> . Address = <address @numberType NumberType @number string> .
NumberType = =unknown / =international / =national / =gsm0338 . NumberType = =unknown / =international / =national / =gsm0338 .
# Assertion. Describes an ongoing call. ; Assertion. Describes an ongoing call.
ActiveCall = <call-state @callId CallId @direction CallDirection @type CallType @peer Address @state CallState> . ActiveCall = <call-state @callId CallId @direction CallDirection @type CallType @peer Address @state CallState> .
CallId = int . CallId = int .
CallDirection = =mo / =mt . CallDirection = =mo / =mt .
CallType = =voice / =data / =fax . CallType = =voice / =data / =fax .
CallState = =hold / =original / =connect / =incoming / =waiting / =end / =alerting . CallState = =hold / =original / =connect / =incoming / =waiting / =end / =alerting .
# Message. Triggers call answering. ; Message. Triggers call answering.
AnswerCall = <answer-call @callId int> . AnswerCall = <answer-call @callId int> .
# Message. Triggers call rejection or disconnection. ; Message. Triggers call rejection or disconnection.
DisconnectCall = <disconnect-call @callId CallIdSelector @cause ReleaseCause> . DisconnectCall = <disconnect-call @callId CallIdSelector @cause ReleaseCause> .
CallIdSelector = @specificCall int / @allCalls =all . CallIdSelector = @specificCall int / @allCalls =all .
ReleaseCause = ReleaseCause =
@ -30,23 +30,23 @@ ReleaseCause =
/ =incompatibleDestination / =incompatibleDestination
. .
# Message. Starts an outgoing call. ; Message. Starts an outgoing call.
PlaceCall = <place-call @devicePath string @peer Address> . PlaceCall = <place-call @devicePath string @peer Address> .
# Assertion. Some call is active - be it alerting, connected, ringing, etc. ; Assertion. Some call is active - be it alerting, connected, ringing, etc.
CallInProgress = <call-in-progress> . CallInProgress = <call-in-progress> .
# Assertion. An incoming call is signalling the user, asking for a decision about answer/reject/ignore. ; Assertion. An incoming call is signalling the user, asking for a decision about answer/reject/ignore.
PhoneRinging = <phone-ringing> . PhoneRinging = <phone-ringing> .
# Assertion. A remote party's phone should be ringing. ; Assertion. A remote party's phone should be ringing.
PeerRinging = <peer-ringing> . PeerRinging = <peer-ringing> .
# Message. An incoming SMS has been received. ; Message. An incoming SMS has been received.
SmsDelivery = <sms-delivery @smsc Address @peer Address @timestamp time.Stamp @body string> . SmsDelivery = <sms-delivery @smsc Address @peer Address @timestamp time.Stamp @body string> .
# Assertion. An outgoing SMS should be transmitted. ; Assertion. An outgoing SMS should be transmitted.
SmsTransmission = <sms-transmission @smsc Address @peer Address @body string @continuation #:=ok > . SmsTransmission = <sms-transmission @smsc Address @peer Address @body string @continuation #!=ok > .
# Assertion. Enable speakerphone mode, if available. ; Assertion. Enable speakerphone mode, if available.
Speakerphone = <speakerphone> . Speakerphone = <speakerphone> .

View File

@ -1,33 +1,33 @@
version 1 . version 1 .
# Assertion. Creates a space for Widget/Parent/Attribute assertions etc. ; Assertion. Creates a space for Widget/Parent/Attribute assertions etc.
Window = <window @id WidgetId @space #:any> . Window = <window @id WidgetId @space #!any> .
# Assertions, within the space created as part of a Window assertion. ; Assertions, within the space created as part of a Window assertion.
Widget = <widget @id WidgetId @type WidgetType> . Widget = <widget @id WidgetId @type WidgetType> .
Parent = <parent @id WidgetId @parentId WidgetId @order SortKey> . Parent = <parent @id WidgetId @parentId WidgetId @order SortKey> .
Root = <root @id WidgetId @order SortKey> . Root = <root @id WidgetId @order SortKey> .
Attribute = <attribute @id WidgetId @key symbol @value any> . Attribute = <attribute @id WidgetId @key symbol @value any> .
# Assertion ; Assertion
WidgetInstance = <widget-instance @id WidgetId @instance #:any> . WidgetInstance = <widget-instance @id WidgetId @instance #!any> .
# Assertion ; Assertion
Touch = <touch @widget WidgetId @touchId any> . Touch = <touch @widget WidgetId @touchId any> .
# Message ; Message
Click = <click @widget WidgetId> . Click = <click @widget WidgetId> .
# Assertion ; Assertion
State = <state @widget WidgetId @key any @value any> . State = <state @widget WidgetId @key any @value any> .
# Assertion. Marks the window as closeable. ; Assertion. Marks the window as closeable.
WindowCloseable = <window-closeable> . WindowCloseable = <window-closeable> .
# Assertion. ; Assertion.
WindowTitle = <window-title @title string> . WindowTitle = <window-title @title string> .
# Data types ; Data types
WidgetId = any . WidgetId = any .
SortKey = @double double / @string string . SortKey = @double double / @string string .
@ -49,12 +49,12 @@ LeafType =
Color = <rgba @red double @green double @blue double @alpha double> . Color = <rgba @red double @green double @blue double @alpha double> .
# Box-and-glue layout ; Box-and-glue layout
Fill = @fixed double / <fill @weight int @rank int> . Fill = @fixed double / <fill @weight int @rank int> .
Sizing = <sizing @ideal double @stretch Fill @shrink Fill> . Sizing = <sizing @ideal double @stretch Fill @shrink Fill> .
BoxSize = <box-size @horizontal Sizing @vertical Sizing> . BoxSize = <box-size @horizontal Sizing @vertical Sizing> .
# Scrollable panels ; Scrollable panels
VisibleScrollRange = VisibleScrollRange =
/ =none / =none
/ @visibleScrollRange <visible-scroll-range / @visibleScrollRange <visible-scroll-range

View File

@ -1,12 +1,12 @@
version 1 . version 1 .
# Assertion. ; Assertion.
CommandRPC = <user-settings-command @action Action @reply #:CommandReply> . CommandRPC = <user-settings-command @action Action @reply #!CommandReply> .
# Message. ; Message.
CommandEvent = <user-settings-command @action Action> . CommandEvent = <user-settings-command @action Action> .
CommandReply = =done . CommandReply = =done .
Action = <assert @item any> / <retract @item any> . Action = <assert @item any> / <retract @item any> .
# Assertion. ; Assertion.
Value = <user-setting @item any> . Value = <user-setting @item any> .

View File

@ -29,8 +29,7 @@ fi
echo echo
cp synit-apk-key.pub /etc/apk/keys/. cp synit-apk-key.pub /etc/apk/keys/.
[ -f /usr/share/deviceinfo/deviceinfo ] && . /usr/share/deviceinfo/deviceinfo . /etc/deviceinfo
[ -f /etc/deviceinfo ] && . /etc/deviceinfo
ls packages/$deviceinfo_arch/ ls packages/$deviceinfo_arch/
echo "Will use http_proxy=${http_proxy}" echo "Will use http_proxy=${http_proxy}"

967
synit-pid1/Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
[package] [package]
name = "synit-pid1" name = "synit-pid1"
version = "0.0.4" version = "0.0.1"
authors = ["Tony Garnock-Jones <tonyg@leastfixedpoint.com>"] authors = ["Tony Garnock-Jones <tonyg@leastfixedpoint.com>"]
edition = "2018" edition = "2018"
@ -23,10 +23,12 @@ strip = true
# syndicate-macros = { path = "localdev/syndicate-rs/syndicate-macros" } # syndicate-macros = { path = "localdev/syndicate-rs/syndicate-macros" }
[dependencies] [dependencies]
syndicate = "0.34" syndicate = "0.23"
syndicate-macros = "0.27" syndicate-macros = "0.18"
clap = { version = "4.5", features = ["derive"] } clap = "=3.0.0-beta.2"
nix = { version = "0.28", features = ["reboot", "signal", "fs"] } clap_generate = "=3.0.0-beta.2"
tokio = { version = "1.36", features = ["process", "signal"] } clap_derive = "=3.0.0-beta.2"
tracing = "0.1.40" nix = "^0.22"
tokio = { version = "1.10.0", features = ["process", "signal"] }
tracing = "0.1.14"

View File

@ -4,14 +4,18 @@ all:
x86_64-binary: x86_64-binary-release x86_64-binary: x86_64-binary-release
x86_64-binary-release: x86_64-binary-release:
CARGO_TARGET_DIR=target/target.x86_64 cross build --target=x86_64-unknown-linux-musl --release --all-targets cross build --target=x86_64-unknown-linux-musl --release --all-targets
armv7-binary: armv7-binary-release armv7-binary: armv7-binary-release
armv7-binary-release: armv7-binary-release:
CARGO_TARGET_DIR=target/target.armv7 cross build --target=armv7-unknown-linux-musleabihf --release --all-targets cross build --target=armv7-unknown-linux-musleabihf --release --all-targets
# Hack to workaround https://github.com/rust-embedded/cross/issues/598
HACK_WORKAROUND_ISSUE_598=CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_RUSTFLAGS="-C link-arg=/usr/local/aarch64-linux-musl/lib/libc.a"
aarch64-binary: aarch64-binary-release aarch64-binary: aarch64-binary-release
aarch64-binary-release: aarch64-binary-release:
CARGO_TARGET_DIR=target/target.aarch64 cross build --target=aarch64-unknown-linux-musl --release --all-targets $(HACK_WORKAROUND_ISSUE_598) \
cross build --target=aarch64-unknown-linux-musl --release --all-targets

View File

@ -1,12 +1,10 @@
use clap::Parser; use clap::Clap;
use nix::sys::reboot::{reboot, RebootMode}; use nix::sys::signal::{killpg, Signal};
use nix::sys::signal::{kill, Signal, SigHandler};
use nix::sys::wait; use nix::sys::wait;
use nix::unistd; use nix::unistd;
use std::convert::TryInto; use std::convert::TryInto;
use std::io::Write;
use std::sync::Arc; use std::sync::Arc;
use syndicate::actor::*; use syndicate::actor::*;
@ -19,13 +17,13 @@ use tokio::process;
use tokio::select; use tokio::select;
use tokio::signal::unix::{signal, SignalKind}; use tokio::signal::unix::{signal, SignalKind};
#[derive(Parser, Clone, Debug)] #[derive(Clap, Clone, Debug)]
#[command(version)] #[clap(version)]
pub struct CommandLine { pub struct CommandLine {
#[arg(long, default_value="/usr/bin/syndicate-server")] #[clap(long, default_value="/usr/bin/syndicate-server")]
server_path: String, server_path: String,
#[arg(long, default_value="/sbin/synit-log")] #[clap(long, default_value="/sbin/synit-log")]
log: String, log: String,
} }
@ -44,24 +42,13 @@ impl Pid1Listener {
impl Entity<AnyValue> for Pid1Listener { impl Entity<AnyValue> for Pid1Listener {
} }
fn ignore_signal(kind: SignalKind) -> ActorResult { async fn handle_sigchld_and_waitpid() -> Result<(), Box<dyn std::error::Error>> {
let sig: Signal = kind.as_raw_value().try_into()?;
unsafe { nix::sys::signal::signal(sig, SigHandler::SigIgn) }?;
Ok(())
}
async fn handle_sigchld_and_waitpid() -> Result<RebootMode, ActorError> {
// For now, we use Alpine's userland reboot, poweroff and halt tools.
// These send SIGTERM, SIGUSR2 and SIGUSR1, respectively.
let mut sigchlds = signal(SignalKind::child())?; let mut sigchlds = signal(SignalKind::child())?;
let mut sigints = signal(SignalKind::interrupt())?; let mut sigints = signal(SignalKind::interrupt())?;
let mut sigterms = signal(SignalKind::terminate())?; let mut sigterms = signal(SignalKind::terminate())?;
let mut sigusr2s = signal(SignalKind::user_defined2())?;
let mut sigusr1s = signal(SignalKind::user_defined1())?;
tracing::info!("Awaiting signals..."); tracing::info!("Awaiting signals...");
let next_step = loop { loop {
select! { select! {
_ = sigchlds.recv() => { _ = sigchlds.recv() => {
loop { loop {
@ -83,49 +70,26 @@ async fn handle_sigchld_and_waitpid() -> Result<RebootMode, ActorError> {
} }
_ = sigints.recv() => { _ = sigints.recv() => {
tracing::debug!("Received SIGINT"); tracing::debug!("Received SIGINT");
break RebootMode::RB_AUTOBOOT; let result = killpg(unistd::getpgrp(), Some(Signal::SIGINT));
tracing::debug!("killpg result: {:?}", result);
break;
} }
_ = sigterms.recv() => { _ = sigterms.recv() => {
tracing::debug!("Received SIGTERM"); tracing::debug!("Received SIGTERM");
break RebootMode::RB_AUTOBOOT; let result = killpg(unistd::getpgrp(), Some(Signal::SIGTERM));
} tracing::debug!("killpg result: {:?}", result);
_ = sigusr2s.recv() => { break;
tracing::debug!("Received SIGUSR2");
break RebootMode::RB_POWER_OFF;
}
_ = sigusr1s.recv() => {
tracing::debug!("Received SIGUSR1");
break RebootMode::RB_HALT_SYSTEM;
} }
} }
}; }
ignore_signal(SignalKind::interrupt())?; Ok(())
ignore_signal(SignalKind::terminate())?;
ignore_signal(SignalKind::user_defined2())?;
ignore_signal(SignalKind::user_defined1())?;
tracing::info!("Terminating, {:?}", next_step);
std::io::stdout().flush()?;
std::io::stderr().flush()?;
nix::unistd::sync();
std::thread::sleep(std::time::Duration::from_millis(100));
nix::unistd::sync();
let _ = kill(unistd::Pid::from_raw(-1), Some(Signal::SIGINT));
// ^ ignore result! We're about to reboot anyway
nix::unistd::sync();
Ok(next_step)
} }
#[tokio::main] #[tokio::main]
async fn main() -> ActorResult { async fn main() -> Result<(), Box<dyn std::error::Error>> {
syndicate::convenient_logging()?; syndicate::convenient_logging()?;
tracing::info!("Startup with PID {}", unistd::getpid());
match unistd::setsid() { match unistd::setsid() {
Ok(_pid) => tracing::info!("setsid(2): new session is {}", _pid), Ok(_pid) => tracing::info!("setsid(2): new session is {}", _pid),
Err(e) => tracing::info!("setsid(2) failed: {:?}", &e), Err(e) => tracing::info!("setsid(2) failed: {:?}", &e),
@ -177,7 +141,7 @@ async fn main() -> ActorResult {
Ok(()) Ok(())
}); });
reboot(handle_sigchld_and_waitpid().await?)?; handle_sigchld_and_waitpid().await?;
Ok(()) Ok(())
} }