Replace idle network poller with event-driven dispatcher
A/B measure and reject additional VM/sysctl/mount tweaks that did not improve idle without trade-offs. Remove sxmo_networkmonitor's long-lived nmcli device monitor, replace it with NetworkManager dispatcher hooks that run Sxmo network/statusbar hooks as the X session user, disable the superd unit in both start hooks, guard it in check-rebuild.sh, update docs, rebuild the image, and verify live Wi-Fi reconnect and idle context switches.
This commit is contained in:
1 parent
3543556735
commit
608a8ac71b
11 files changed
+236
-7
No files matched your search
@@ -116,14 +116,18 @@ chmod 640 "$TARGET_ROOTFS/etc/doas.d/50-sxmo.conf" 2>/dev/null || true
|
||||
chown 0:0 "$TARGET_ROOTFS/etc/chrony/chrony.conf" \
|
||||
"$TARGET_ROOTFS/usr/bin/bananarchy-time-sync.sh" \
|
||||
"$TARGET_ROOTFS/usr/bin/bananarchy-sync-net-time.sh" \
|
||||
"$TARGET_ROOTFS/usr/bin/bananarchy-network-event.sh" \
|
||||
"$TARGET_ROOTFS/etc/init.d/bananarchy-time-sync" \
|
||||
"$TARGET_ROOTFS/etc/NetworkManager/dispatcher.d/20-bananarchy-time-sync.sh" \
|
||||
"$TARGET_ROOTFS/etc/NetworkManager/dispatcher.d/30-bananarchy-network-status.sh" \
|
||||
2>/dev/null || true
|
||||
chmod 0644 "$TARGET_ROOTFS/etc/chrony/chrony.conf" 2>/dev/null || true
|
||||
chmod 0755 "$TARGET_ROOTFS/usr/bin/bananarchy-time-sync.sh" \
|
||||
"$TARGET_ROOTFS/usr/bin/bananarchy-sync-net-time.sh" \
|
||||
"$TARGET_ROOTFS/usr/bin/bananarchy-network-event.sh" \
|
||||
"$TARGET_ROOTFS/etc/init.d/bananarchy-time-sync" \
|
||||
"$TARGET_ROOTFS/etc/NetworkManager/dispatcher.d/20-bananarchy-time-sync.sh" \
|
||||
"$TARGET_ROOTFS/etc/NetworkManager/dispatcher.d/30-bananarchy-network-status.sh" \
|
||||
2>/dev/null || true
|
||||
CHRONY_UID="$(awk -F: '/^chrony:/ {print $3}' "$TARGET_ROOTFS/etc/passwd" 2>/dev/null || true)"
|
||||
CHRONY_GID="$(awk -F: '/^chrony:/ {print $4}' "$TARGET_ROOTFS/etc/passwd" 2>/dev/null || true)"
|
||||
|
||||
@@ -254,6 +254,32 @@ for f in "$UNLOCK_HOOK" "$STATUS_HOOK"; do
|
||||
fi
|
||||
done
|
||||
|
||||
echo "[check] Event-driven network status..."
|
||||
NET_EVENT="$BASE_DIR/overlay/rootfs/usr/bin/bananarchy-network-event.sh"
|
||||
NET_DISPATCH="$BASE_DIR/overlay/rootfs/etc/NetworkManager/dispatcher.d/30-bananarchy-network-status.sh"
|
||||
for f in "$NET_EVENT" "$NET_DISPATCH"; do
|
||||
if [ ! -f "$f" ]; then
|
||||
fail "missing ${f#$BASE_DIR/}"
|
||||
elif ! sh -n "$f" 2>/dev/null; then
|
||||
fail "shell syntax: ${f#$BASE_DIR/}"
|
||||
fi
|
||||
done
|
||||
for hook in "$BASE_DIR/overlay/rootfs/usr/share/sxmo/default_hooks/sxmo_hook_start.sh" \
|
||||
"$BASE_DIR/overlay/rootfs/etc/skel/.config/sxmo/hooks/sxmo_hook_start.sh"; do
|
||||
if grep -q 'superctl start sxmo_networkmonitor' "$hook"; then
|
||||
fail "${hook#$BASE_DIR/} still starts the nmcli device monitor poller"
|
||||
fi
|
||||
if ! grep -q '30-bananarchy-network-status.sh' "$hook"; then
|
||||
fail "${hook#$BASE_DIR/} no longer documents the dispatcher replacement"
|
||||
fi
|
||||
if ! grep -q 'superctl disable sxmo_networkmonitor' "$hook"; then
|
||||
fail "${hook#$BASE_DIR/} no longer disables the sxmo_networkmonitor superd unit"
|
||||
fi
|
||||
done
|
||||
if ! grep -q 'bananarchy-network-event.sh' "$BASE_DIR/scripts/apply-bananarchy-overlay.sh"; then
|
||||
fail "apply-bananarchy-overlay.sh no longer installs the network event helper"
|
||||
fi
|
||||
|
||||
echo "[check] Battery longevity settings..."
|
||||
for f in "$BASE_DIR"/devices/*/deviceinfo "$BASE_DIR"/devices/*/deviceinfo.nokia-leo; do
|
||||
[ -f "$f" ] || continue
|
||||
|
||||
Reference in new issue
Block a user