side-switch: set power restore policy to always-on

Utilize the one-time feature of the automatic power restore
functionality to ensure a one-time automatic boot of the system occurs
after the BMC reboot.

This makes the whole process seamless to the user. They start a boot,
this function detects a bmc reboot is needed to pick up the priority 0
image, and this ensures the boot starts back up after the bmc reboot.

Tested:
- Verify policy set correctly
<6> Checking for side switch reboot
<6> Running firmware version path is /xyz/openbmc_project/software/74575136
<6> Running firmware version priority is 1
<6> Running image is at priority 1, execute side switch
<6> chassis power is off
<6> RestorePolicy set to AlwaysOn

busctl get-property xyz.openbmc_project.Settings
  /xyz/openbmc_project/control/host0/power_restore_policy/one_time
  xyz.openbmc_project.Control.Power.RestorePolicy PowerRestorePolicy
s "xyz.openbmc_project.Control.Power.RestorePolicy.Policy.AlwaysOn"

Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
Change-Id: I126283386c577fd9ec899a1402ae36e6111f1780
2 files changed