Bump to latest OS Agent version to support Device Wipe (#1292)
The latest version of OS Agent sets haos.wipe=1 as kernel argument to trigger a device wipe. Let systemd pickup this kernel command line argument and start haos-wipe.service. This rather complex architecture allows to add other triggers in the future, e.g. a button read in the boot loader.
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
[Unit]
|
||||
Description=Home Assistant OS Device Wipe Service
|
||||
DefaultDependencies=no
|
||||
RefuseManualStart=true
|
||||
RefuseManualStop=true
|
||||
Wants=mnt-boot.mount
|
||||
Requires=haos-agent.service
|
||||
After=haos-agent.service mnt-boot.mount
|
||||
Before=mnt-data.mount mnt-overlay.mount
|
||||
ConditionKernelCommandLine=haos.wipe=1
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=/usr/bin/busctl --verbose --timeout=1h call io.homeassistant.os /io/homeassistant/os/System io.homeassistant.os.System WipeDevice
|
||||
ExecStartPost=/usr/bin/sed -i 's/\s*haos.wipe=1//g' /mnt/boot/cmdline.txt
|
||||
|
||||
[Install]
|
||||
WantedBy=sysinit.target
|
||||
Reference in New Issue
Block a user