From 1d3e2bff7d612bbbc41ae5a2c48101f19fec35fb Mon Sep 17 00:00:00 2001 From: Raptor Engineering Development Team Date: Sat, 20 Jan 2018 06:25:48 -0600 Subject: Add systemd trigger on IPL completion --- pyiplobserver/ipl_status_observer.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pyiplobserver/ipl_status_observer.py b/pyiplobserver/ipl_status_observer.py index 34e8f34..3d08b13 100644 --- a/pyiplobserver/ipl_status_observer.py +++ b/pyiplobserver/ipl_status_observer.py @@ -177,6 +177,16 @@ class IPLStatus(DbusProperties, DbusObjectManager): if (self.prev_access_fail_count < 255): self.prev_access_fail_count += 1 + if ((current_status == "IPL_COMPLETE") and (self.last_status != current_status)): + # Signal systemd that IPL is complete + try: + systemd_emit_dev = self.bus.get_object("org.freedesktop.systemd1", u"/org/freedesktop/systemd1") + systemd_emit_iface = dbus.Interface(systemd_emit_dev, 'org.freedesktop.systemd1.Manager') + systemd_emit_function = getattr(systemd_emit_iface, 'StartUnit') + systemd_emit_function.call_async('obmc-host-ipl-complete@0.target', 'replace') + except Exception as e: + pass + # Since it is extremely unlikely that both fetches will fail unless the host is offline, simply check that both fetches passed or failed before continuing if (sbe_fetch_failed == hostboot_fetch_failed): # Check error results multiple times before signalling unexpected offline status -- cgit v1.2.1