discover: support 3 options to run APR when BMC is rebooted
As defined in the PDIs [1], the RebootCause can be
Power-On-Reset, Watchdog, Pinhole, Software or Unknown. When BMC is
rebooted due to Power-On-Reset, BMC always runs APR feature. But other
RebootCause values, we don't have a clear specification to indicate the
behavior of BMC in those cases. This commit adds 3 more options to
support running APR when BMC rebooted or not.
- 'run-apr-on-pinhole-reset': Run APR when BMC is rebooted due to
pinhole action.
- 'run-apr-on-watchdog-reset': Run APR when BMC is rebooted due to
watchdog.
- 'run-apr-on-software-reset': Run APR when BMC is rebooted due to
software.
[1] https://github.com/openbmc/phosphor-dbus-interfaces/blob/master/yaml/xyz/openbmc_project/State/BMC.interface.yaml#L72
Tested:
Test case 1:
1. Enable run-apr-on-watchdog-reset option
2. Trigger watchdog to reboot BMC
3. BMC runs APR when booting done
4. Disable run-apr-on-watchdog-reset option
5. Trigger watchdog to reboot BMC
6. BMC does not run APR when booting done
Test case 2:
1. Enable run-apr-on-software-reset option
2. Call "reboot" command to reboot BMC
3. BMC runs APR when booting done
4. Disable run-apr-on-software-reset option
5. Trigger watchdog to reboot BMC
6. BMC does not run APR when booting done
Change-Id: I255f52a4008ae1dbf3db69e33471f9d23e0552a0
Signed-off-by: Thang Tran <thuutran@amperecomputing.com>
diff --git a/meson.build b/meson.build
index 02c13dd..fee3005 100644
--- a/meson.build
+++ b/meson.build
@@ -41,6 +41,12 @@
get_option('only-run-apr-on-power-loss'),
)
+conf.set10('RUN_APR_ON_PINHOLE_RESET', get_option('run-apr-on-pinhole-reset'))
+
+conf.set10('RUN_APR_ON_WATCHDOG_RESET', get_option('run-apr-on-watchdog-reset'))
+
+conf.set10('RUN_APR_ON_SOFTWARE_RESET', get_option('run-apr-on-software-reset'))
+
conf.set_quoted('SYSFS_TPM_DEVICE_PATH', get_option('sysfs-tpm-device-path'))
conf.set_quoted(