build(node): ship qualified installers with CAN maintenance and rollback
Publish qualified Node and device bundles through versioned installers. Coordinate CAN maintenance, dependency closure, retained rollback and packaging provenance.
This commit is contained in:
@@ -1,6 +1,13 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
if [ -d /run/systemd/system ]; then
|
||||
if [ -S /run/mission-core-usb-can/driver.sock ]; then
|
||||
if ! /usr/bin/python3 -I -c 'import http.client,json,socket; c=http.client.HTTPConnection("usb-can",timeout=5); c.sock=socket.socket(socket.AF_UNIX); c.sock.settimeout(5); c.sock.connect("/run/mission-core-usb-can/driver.sock"); c.request("GET","/prepare-safe"); r=c.getresponse(); assert r.status==200 and json.load(r).get("safe") is True'; then
|
||||
echo "Mission Core Node: остановите CAN-каналы перед обновлением или удалением." >&2
|
||||
exit 1
|
||||
fi
|
||||
systemctl stop mission-core-usb-can.service
|
||||
fi
|
||||
if [ -S /run/mission-core-sensors/driver.sock ]; then
|
||||
if ! /usr/bin/python3 -I -c 'import http.client,json,socket; c=http.client.HTTPConnection("driver",timeout=5); c.sock=socket.socket(socket.AF_UNIX); c.sock.settimeout(5); c.sock.connect("/run/mission-core-sensors/driver.sock"); c.request("GET","/prepare-safe"); r=c.getresponse(); assert r.status==200 and json.load(r).get("safe") is True'; then
|
||||
echo "Mission Core Node: остановите захват или просмотр записи перед обновлением или удалением." >&2
|
||||
@@ -106,3 +113,21 @@ case "$1" in
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
# Retire only this profile on removal or rollback to a release without it.
|
||||
if [ "$1" = remove ] || { [ "$1" = upgrade ] && [ -n "${2:-}" ] && dpkg --compare-versions "$2" lt 0.8.49-33; }; then
|
||||
if [ -d /run/systemd/system ]; then
|
||||
systemctl disable --now mission-core-usb-can.service || true
|
||||
fi
|
||||
mc_can_rule=/etc/udev/rules.d/70-mission-core-usb-can.rules
|
||||
if [ ! -L "$mc_can_rule" ] && cmp -s /usr/share/mission-core-node/profiles/usb-can/70-mission-core-usb-can.rules "$mc_can_rule"; then
|
||||
rm "$mc_can_rule"
|
||||
fi
|
||||
fi
|
||||
|
||||
# This version owns only its WireGuard helper. Keep private identity for reinstall.
|
||||
if [ "$1" = remove ] || { [ "$1" = upgrade ] && [ -n "${2:-}" ] && dpkg --compare-versions "$2" lt 0.8.49-91; }; then
|
||||
if [ -d /run/systemd/system ]; then
|
||||
systemctl disable --now mission-core-node-wireguard.service || true
|
||||
fi
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user