Skip to content
Snippets Groups Projects
Commit 5317d289 authored by Zygmunt Krynicki's avatar Zygmunt Krynicki
Browse files

service: configure reboot delay quirk


If the boot protocol supports the reboot delay API then the configured
reboot quirk is respected and applied to the boot protocol instance.

Signed-off-by: default avatarZygmunt Krynicki <zygmunt.krynicki@huawei.com>
parent 4cb025ca
No related branches found
No related tags found
No related merge requests found
...@@ -5,6 +5,7 @@ package sysotad ...@@ -5,6 +5,7 @@ package sysotad
import ( import (
"fmt" "fmt"
"time"
"github.com/godbus/dbus/v5" "github.com/godbus/dbus/v5"
"gitlab.com/zygoon/go-raspi/pimodel" "gitlab.com/zygoon/go-raspi/pimodel"
...@@ -143,6 +144,11 @@ func NewService(conn *dbus.Conn, opts ...Option) (*Service, error) { ...@@ -143,6 +144,11 @@ func NewService(conn *dbus.Conn, opts ...Option) (*Service, error) {
return nil, err return nil, err
} }
// Ask the boot protocol to delay the reboot process if this is supported.
if delayer, ok := bootProto.(boot.RebootDelayer); ok {
delayer.SetRebootDelay(time.Duration(svc.confGuard.Config().QuirkRebootDelay) * time.Second)
}
// Configure and add the boot service if the corresponding // Configure and add the boot service if the corresponding
// debug flag is enabled. // debug flag is enabled.
if svc.confGuard.Config().DebugBootAPI { if svc.confGuard.Config().DebugBootAPI {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment