Skip to content

Commit c433444

Browse files
authored
Disable auto update on reenable/install (#641)
- Disable `update-engine.service` on install/reenable - Decouple `sync.service` and `xochitl.service` as this means that either sync doesn't work, or xochitl starts when it is disabled. - Accomplished by adding a `manual-sync.service` and masking `sync.service` - `/opt/bin/xochitl` will also run `sync --service` in the background manually if running from a chroot and there is no sync service running - Add `kill-xochitl` command as oxide stop events do not allow arguments
1 parent a862392 commit c433444

10 files changed

Lines changed: 100 additions & 14 deletions

File tree

package/kernelctl/force_reinstall_on_toltecctl_reenable

Whitespace-only changes.

package/kernelctl/package

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,24 @@
55
pkgnames=(kernelctl)
66
pkgdesc="Manage aftermarket kernels"
77
url=https://toltec-dev.org/
8-
pkgver=0.1-3
8+
pkgver=0.1-4
99
timestamp=2022-03-14T00:00Z
1010
section="utils"
1111
maintainer="Salvatore Stella <etn45p4m@gmail.com>"
1212
license=MIT
1313

1414
source=(
1515
kernelctl
16-
force_reinstall_on_toltecctl_reenable
1716
)
1817
sha256sums=(
1918
SKIP
20-
SKIP
2119
)
2220

2321
package() {
22+
touch "$srcdir"/emptyfile
2423
install -D -m 744 -t "$pkgdir"/opt/bin "$srcdir"/kernelctl
2524
install -d "$pkgdir"/opt/usr/share/kernelctl
26-
install -D -m 666 -t "$pkgdir"/usr/share/kernelctl/ "$srcdir"/force_reinstall_on_toltecctl_reenable
25+
install -D -m 666 -t "$pkgdir"/usr/share/toltec/reenable.d/kernelctl "$srcdir"/emptyfile
2726
}
2827

2928
configure() {

package/oxide/package

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,22 @@
33
# SPDX-License-Identifier: MIT
44

55
pkgnames=(erode fret oxide rot tarnish decay corrupt anxiety liboxide libsentry)
6-
pkgver=2.4-1
6+
pkgver=2.4-2
77
_sentryver=0.4.17
88
timestamp=2022-05-22T03:18:32Z
99
maintainer="Eeems <eeems@eeems.email>"
1010
url=https://oxide.eeems.codes
1111
license=MIT
1212
flags=(patch_rm2fb)
1313
image=qt:v2.3
14-
source=("https://github.com/Eeems-Org/oxide/archive/e6c62a6860b52cd1cbd47e21377f8d1ecf72bb0a.tar.gz")
15-
sha256sums=(a29cf455d5f66fee4ee67722c6f1d20627930920286398932c3d5c813d58ebee)
14+
source=(
15+
"https://github.com/Eeems-Org/oxide/archive/e6c62a6860b52cd1cbd47e21377f8d1ecf72bb0a.tar.gz"
16+
toltec-override.conf
17+
)
18+
sha256sums=(
19+
a29cf455d5f66fee4ee67722c6f1d20627930920286398932c3d5c813d58ebee
20+
SKIP
21+
)
1622

1723
build() {
1824
find . -name "*.pro" -type f -print0 \
@@ -84,6 +90,8 @@ tarnish() {
8490
install -D -m 644 -t "$pkgdir"/etc/dbus-1/system.d "$srcdir"/release/etc/dbus-1/system.d/codes.eeems.oxide.conf
8591
install -D -m 644 -t "$pkgdir"/lib/systemd/system "$srcdir"/release/etc/systemd/system/tarnish.service
8692
install -D -m 755 -t "$pkgdir"/opt/bin "$srcdir"/release/opt/bin/tarnish
93+
install -D -m 644 -t "$pkgdir"/etc/systemd/system/tarnish.service.d \
94+
"$srcdir"/toltec-override.conf
8795
}
8896
configure() {
8997
systemctl daemon-reload

package/oxide/toltec-override.conf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Copyright (c) 2021 The Toltec Contributors
2+
# SPDX-License-Identifier: MIT
3+
4+
[Unit]
5+
Conflicts=xochitl.service
6+
Conflicts=sync.service

package/toltec-base/package

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ archs=(rm1 rm2)
66
pkgnames=(toltec-base)
77
pkgdesc="Metapackage defining the base set of packages in a Toltec install"
88
url=https://toltec-dev.org/
9-
pkgver=1.0-1
10-
timestamp=2022-02-28T00:12Z
9+
pkgver=1.1-1
10+
timestamp=2022-11-07T20:19:57Z
1111
section="utils"
1212
maintainer="Eeems <eeems@eeems.email>"
1313
license=MIT
@@ -19,5 +19,15 @@ source=()
1919
sha256sums=()
2020

2121
package() {
22-
true
22+
touch "$srcdir"/emptyfile
23+
install -D -m 666 -t "$pkgdir"/usr/share/toltec/reenable.d/toltec-base "$srcdir"/emptyfile
24+
}
25+
26+
configure() {
27+
if is-enabled "update-engine.service"; then
28+
echo "Disabling automatic update"
29+
systemctl disable --now update-engine
30+
fi
31+
echo "Disabling usb1 network device to avoid long boots"
32+
systemctl mask sys-subsystem-net-devices-usb1.device
2333
}

package/xochitl/kill-xochitl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/usr/bin/env bash
2+
# Copyright (c) 2021 The Toltec Contributors
3+
# SPDX-License-Identifier: MIT
4+
5+
killall xochitl
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Copyright (c) 2021 The Toltec Contributors
2+
# SPDX-License-Identifier: MIT
3+
4+
[Unit]
5+
Description=reMarkable Document Sync without the xochitl.service dependency
6+
After=dbus.socket
7+
StartLimitIntervalSec=60
8+
StartLimitBurst=4
9+
Conflicts=sync.service
10+
11+
[Service]
12+
# Do NOT make this dbus, systemd will kill the service when it should be
13+
# running otherwise.
14+
Type=simple
15+
BusName=no.remarkable.sync
16+
ExecStart=/usr/bin/sync --service
17+
Restart=on-failure
18+
RestartForceExitStatus=SIGHUP SIGINT SIGTERM SIGPIPE
19+
20+
[Install]
21+
WantedBy=multi-user.target

package/xochitl/package

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
pkgnames=(xochitl)
66
pkgdesc="Read documents and take notes"
77
url=https://remarkable.com
8-
pkgver=0.0.0-13
9-
timestamp=2022-03-05T23:26Z
8+
pkgver=0.0.0-14
9+
timestamp=2022-11-07T20:19:57Z
1010
section="readers"
1111
maintainer="Mattéo Delabre <spam@delab.re>"
1212
license=MIT
@@ -24,6 +24,7 @@ source=(
2424
toltec-after-launcher.conf
2525
toltec-wrapper.conf
2626
env-readme
27+
manual-sync.service
2728
)
2829
sha256sums=(
2930
SKIP
@@ -33,6 +34,7 @@ sha256sums=(
3334
SKIP
3435
SKIP
3536
SKIP
37+
SKIP
3638
)
3739

3840
package() {
@@ -56,11 +58,22 @@ package() {
5658
"$srcdir"/toltec-after-launcher.conf
5759
install -D -m 644 -t "$pkgdir"/etc/systemd/system/remarkable-reboot.service.d \
5860
"$srcdir"/toltec-after-launcher.conf
61+
install -D -m 644 -t "$pkgdir"/etc/systemd/system \
62+
"$srcdir"/manual-sync.service
5963
}
6064

6165
configure() {
6266
systemctl daemon-reload
6367

68+
# sync.service interferes with launchers
69+
# we use manual-sync.service instead
70+
if [[ "x$(systemctl is-enabled sync.service)" != "xmasked" ]]; then
71+
systemctl mask sync.service
72+
fi
73+
if ! is-active manual-sync.service; then
74+
systemctl enable --now manual-sync.service
75+
fi
76+
6477
if is-enabled xochitl.service && ! is-enabled launcher.service; then
6578
# This package changes xochitl.service to alias it to launcher.service
6679
# when enabled. If xochitl was previously enabled, force the creation
@@ -69,9 +82,19 @@ configure() {
6982
fi
7083
}
7184

85+
preremove() {
86+
if is-active manual-sync.service; then
87+
systemctl disable --now manual-sync.service
88+
fi
89+
}
90+
7291
postremove() {
7392
systemctl daemon-reload
7493

94+
if [[ "x$(systemctl is-enabled sync.service)" == "xmasked" ]]; then
95+
systemctl unmask sync.service 2> /dev/null
96+
fi
97+
7598
if is-enabled xochitl.service && is-enabled launcher.service; then
7699
# If xochitl is currently the active launcher, make sure the
77100
# launcher.service alias is removed

package/xochitl/xochitl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,13 @@ for file in /opt/etc/xochitl.env.d/*.env; do
99
source "$file"
1010
fi
1111
done
12+
# If for some reason, sync.service is no longer masked, re-mask it
13+
# The package install should have handled this, but something may
14+
# have changed it.
15+
if [[ "x$(systemctl is-enabled sync.service)" != "xmasked" ]]; then
16+
systemctl mask sync.service
17+
fi
18+
if ! systemctl is-active --quiet manual-sync.service; then
19+
systemctl enable --now manual-sync.service
20+
fi
1221
exec /usr/bin/xochitl "$@"

package/xochitl/xochitl.oxide

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,24 @@
1111
"/home/root",
1212
"/opt/etc",
1313
"/run/dbus",
14+
"/run/lock",
15+
"/run/systemd",
1416
"/run/systemd/resolve",
1517
"/run/udev",
1618
"/tmp/runtime-root",
1719
"/usr/share",
1820
"/usr/share/remarkable/templates",
21+
"/usr/local/share/ca-certificates",
1922
"/var/cache/fontconfig",
2023
"/var/lib/dbus",
24+
"/var/volatile/tmp"
2125
],
2226
"environment": {
27+
"HOME": "/home/root",
2328
"QMLSCENE_DEVICE": "epaper",
24-
"QT_QPA_PLATFORM": "epaper",
2529
"QT_QPA_EVDEV_TOUCHSCREEN_PARAMETERS": "rotate=180",
26-
"HOME": "/home/root",
30+
"QT_QPA_PLATFORM": "epaper",
31+
"SYSTEMD_IGNORE_CHROOT": "true",
2732
"XDG_RUNTIME_DIR": "/tmp/runtime-root"
2833
}
2934
}

0 commit comments

Comments
 (0)