meta-bletchley: use BootMode property to select host boot mode.
Use BootMode to decide whether host should boot to Normal, Recovery
or DFU mode.
- xyz.openbmc_project.Control.Boot.Mode.Modes.Regular: Normal mode
- xyz.openbmc_project.Control.Boot.Mode.Modes.Safe: Recovery mode
- xyz.openbmc_project.Control.Boot.Mode.Modes.Setup: DFU mode
Tested results:
- Host normal on (xyz.openbmc_project.Control.Boot.Mode.Modes.Regular)
root@bletchley:~# busctl set-property xyz.openbmc_project.Settings \
> /xyz/openbmc_project/control/host6/boot \
> xyz.openbmc_project.Control.Boot.Mode BootMode s \
> xyz.openbmc_project.Control.Boot.Mode.Modes.Regular
root@bletchley:~# obmcutil -i=6 poweron
root@bletchley:~# power-ctrl sled6 status
On
- Host boot recovery (xyz.openbmc_project.Control.Boot.Mode.Modes.Safe)
root@bletchley:~# busctl set-property xyz.openbmc_project.Settings \
> /xyz/openbmc_project/control/host6/boot \
> xyz.openbmc_project.Control.Boot.Mode BootMode s \
> xyz.openbmc_project.Control.Boot.Mode.Modes.Safe
root@bletchley:~# obmcutil -i=6 poweron
root@bletchley:~# power-ctrl sled6 status
Recovery
- Host boot DFU (xyz.openbmc_project.Control.Boot.Mode.Modes.Setup)
root@bletchley:~# busctl set-property xyz.openbmc_project.Settings \
> /xyz/openbmc_project/control/host6/boot \
> xyz.openbmc_project.Control.Boot.Mode BootMode s \
> xyz.openbmc_project.Control.Boot.Mode.Modes.Setup
root@bletchley:~# obmcutil -i=6 poweron
root@bletchley:~# power-ctrl sled6 status
DFU
Signed-off-by: Potin Lai <potin.lai@quantatw.com>
Change-Id: I1eac8fb74f3702d9ce0ab9180b9d7e2e26df81f7
diff --git a/meta-facebook/meta-bletchley/recipes-bletchley/motor-ctrl/files/host-poweron@.service b/meta-facebook/meta-bletchley/recipes-bletchley/motor-ctrl/files/host-poweron@.service
index c9f15a6..fd0cbd9 100644
--- a/meta-facebook/meta-bletchley/recipes-bletchley/motor-ctrl/files/host-poweron@.service
+++ b/meta-facebook/meta-bletchley/recipes-bletchley/motor-ctrl/files/host-poweron@.service
@@ -8,6 +8,6 @@
[Service]
Type=oneshot
-ExecStart=/usr/sbin/power-ctrl sled%i on
+ExecStart=/usr/sbin/power-ctrl sled%i boot-from-bootmode
SyslogIdentifier=power-ctrl