Change rauc mark handling

This commit is contained in:
Pascal Vizeli 2018-06-16 09:06:07 +00:00
parent c657f6f3e7
commit 49df049f2c
11 changed files with 36 additions and 15 deletions

View File

@ -1,2 +0,0 @@
[Unit]
OnFailure=rauc-bad.service

View File

@ -1 +0,0 @@
/usr/lib/systemd/system/rauc-good.timer

View File

@ -0,0 +1 @@
/usr/lib/systemd/system/rauc-mark.timer

View File

@ -2,6 +2,8 @@
Description=HassOS data resizing
DefaultDependencies=no
Before=mnt-data.mount
RefuseManualStart=true
RefuseManualStop=true
[Service]
Type=oneshot

View File

@ -1,10 +0,0 @@
[Unit]
Description=HassOS rauc bad
Requires=rauc.service
RefuseManualStart=true
RefuseManualStop=true
[Service]
Type=oneshot
ExecStart=/usr/bin/rauc status mark-bad
ExecStartPost=/usr/bin/systemctl reboot

View File

@ -1,10 +1,9 @@
[Unit]
Description=HassOS rauc good
Requires=hassos-supervisor.service rauc.service
RefuseManualStart=true
RefuseManualStop=true
[Service]
Type=oneshot
ExecStart=/usr/bin/rauc status mark-good
ExecStart=/usr/sbin/hassos-rate
RemainAfterExit=true

View File

@ -2,6 +2,8 @@
Description=HassOS ZRAM swap
DefaultDependencies=no
Before=dev-zram0.swap
RefuseManualStart=true
RefuseManualStop=true
[Service]
Type=oneshot

View File

@ -2,6 +2,8 @@
Description=HassOS ZRAM tmp
DefaultDependencies=no
Before=tmp.mount
RefuseManualStart=true
RefuseManualStop=true
[Service]
Type=oneshot

View File

@ -2,6 +2,8 @@
Description=HassOS ZRAM var
DefaultDependencies=no
Before=var.mount
RefuseManualStart=true
RefuseManualStop=true
[Service]
Type=oneshot

View File

@ -0,0 +1,26 @@
#!/bin/sh
set -e
function mark_good() {
rauc status mark-good
exit 0
}
function mark_bad() {
rauc status mark-bad
exit 0
}
# Docker state
if ! systemctl -q is-active docker; then
mark_bad
fi
# Docker state
if ! systemctl -q is-active hassos-supervisor; then
mark_bad
fi
mark_good