From 70b38d67003e9c013f8769a7a2427697b28656d1 Mon Sep 17 00:00:00 2001 From: Andrew Geissler Date: Mon, 22 Jun 2020 15:14:30 -0500 Subject: clear host volatile section on chassis poweron When using istep to boot a openpower based system, the flow is to issue a "obmcutil chassison" and then boot the system using the istep tool. istep does not use the host-start targets so therefore the host volatile data is not cleared. To ensure the data is always cleared, add the services to the chassis-poweron target. The services need to remain within the host start targets to handle warm reboot scenarios. A normal "obmcutil poweron" will run both the host and chassis targets but due to them being started at the same time (and letting systemd figure out the ordering), the volatiles services will each only be run once so there is no extra execution due to this commit. If a user were to just issue a "obmcutil chassison" and then follow that with a "obmcutil poweron" then the services would be run a second time. This scenario is a debug only type situation and the extra second to re-run the services would have very minimal impact. There is a desire to move services from requires to wants relationships. That was not done here because of the undefined behavior seen by the host when this data is not cleared. The required behaviors is to fail the power on or host start if these services fail. Tested: - Verified services were in obmc-chassis-poweron@0.target.requires - Verified services were run as expected issuing a chassison - Verified boot of system worked as expected and services were only executed once during "obmcutil poweron" (From meta-openpower rev: 9a967ec383a6f0d0a7e3d7a61d48b35c8aaf8f1c) Signed-off-by: Andrew Geissler Change-Id: I5ea6ef27cd29d488fa3b7b3bf93a73f1112d1120 Signed-off-by: Andrew Geissler --- .../classes/openpower-software-manager-ubi.bbclass | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'meta-openpower/classes/openpower-software-manager-ubi.bbclass') diff --git a/meta-openpower/classes/openpower-software-manager-ubi.bbclass b/meta-openpower/classes/openpower-software-manager-ubi.bbclass index 7167b88c3..dc20d5d09 100644 --- a/meta-openpower/classes/openpower-software-manager-ubi.bbclass +++ b/meta-openpower/classes/openpower-software-manager-ubi.bbclass @@ -12,6 +12,12 @@ SYSTEMD_SERVICE_${PN} += " \ obmc-flash-bios-check-clearvolatile@.service \ " +# To handle warm reboot scenarios, the checking and clearing of +# the volatile section must occur in both the chassis and host +# targets + +# Host target installation - only clear if going through +# full host start target ENABLE_CLEAR_VOLATILE_TMPL = "obmc-flash-bios-enable-clearvolatile@.service" HOST_START_TGTFMT = "obmc-host-start@{0}.target" ENABLE_CLEAR_VOLATILE_INSTFMT = "obmc-flash-bios-enable-clearvolatile@{0}.service" @@ -24,3 +30,13 @@ CHECK_CLEAR_VOLATILE_START_FMT = "../${CHECK_CLEAR_VOLATILE_TMPL}:${HOST_STARTMI SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'ENABLE_CLEAR_VOLATILE_START_FMT', 'OBMC_HOST_INSTANCES')}" SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'CHECK_CLEAR_VOLATILE_START_FMT', 'OBMC_HOST_INSTANCES')}" + +# Chassis target installation - always enable and clear in chassis +# power on +CHASSIS_PON_TGTFMT = "obmc-chassis-poweron@{0}.target" +ENABLE_CLEAR_VOLATILE_PON_FMT = "../${ENABLE_CLEAR_VOLATILE_TMPL}:${CHASSIS_PON_TGTFMT}.requires/${ENABLE_CLEAR_VOLATILE_INSTFMT}" + +CHECK_CLEAR_VOLATILE_PON_FMT = "../${CHECK_CLEAR_VOLATILE_TMPL}:${CHASSIS_PON_TGTFMT}.requires/${CHECK_CLEAR_VOLATILE_INSTFMT}" + +SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'ENABLE_CLEAR_VOLATILE_PON_FMT', 'OBMC_CHASSIS_INSTANCES')}" +SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'CHECK_CLEAR_VOLATILE_PON_FMT', 'OBMC_CHASSIS_INSTANCES')}" -- cgit v1.2.3