From ee12600186bed70bba59fbf0b8d9651093bdbdc0 Mon Sep 17 00:00:00 2001 From: Andrew Geissler Date: Mon, 1 Feb 2021 16:17:23 -0600 Subject: mpreboot: separate out systemd target work The OpenBMC community has been moving away from the use of the SYSTEMD_LINK macro and going towards more explicit commands to create the needed wants/requires relationships for systemd. This commit does that in preparation for some other work in this area utilizing the new mpreboot distro feature. No functional changes were done with this commit. Signed-off-by: Andrew Geissler Change-Id: I01086e51400cf94498c62d9bc6cbcc75813b20f6 --- .../openpower-debug-collector-systemd-links.inc | 25 ++++++++++++++++++++++ .../debug/openpower-debug-collector_git.bb | 21 +----------------- 2 files changed, 26 insertions(+), 20 deletions(-) create mode 100644 meta-openpower/recipes-phosphor/debug/openpower-debug-collector-systemd-links.inc (limited to 'meta-openpower') diff --git a/meta-openpower/recipes-phosphor/debug/openpower-debug-collector-systemd-links.inc b/meta-openpower/recipes-phosphor/debug/openpower-debug-collector-systemd-links.inc new file mode 100644 index 000000000..7b2bb59cd --- /dev/null +++ b/meta-openpower/recipes-phosphor/debug/openpower-debug-collector-systemd-links.inc @@ -0,0 +1,25 @@ +pkg_postinst_${PN}_append() { + mkdir -p $D$systemd_system_unitdir/obmc-host-crash@0.target.wants + mkdir -p $D$systemd_system_unitdir/obmc-host-timeout@0.target.wants + + LINK="$D$systemd_system_unitdir/obmc-host-crash@0.target.wants/openpower-debug-collector-checkstop@0.service" + TARGET="../openpower-debug-collector-checkstop@.service" + ln -s $TARGET $LINK + + LINK="$D$systemd_system_unitdir/obmc-host-timeout@0.target.wants/openpower-debug-collector-watchdog@0.service" + TARGET="../openpower-debug-collector-watchdog@.service" + ln -s $TARGET $LINK + + LINK="$D$systemd_system_unitdir/obmc-host-timeout@0.target.wants/openpower-debug-collector-watchdog-timeout@0.service" + TARGET="../openpower-debug-collector-watchdog-timeout.service" + ln -s $TARGET $LINK +} + +pkg_prerm_${PN}_append() { + LINK="$D$systemd_system_unitdir/obmc-host-crash@0.target.wants/openpower-debug-collector-checkstop@0.service" + rm $LINK + LINK="$D$systemd_system_unitdir/obmc-host-timeout@0.target.wants/openpower-debug-collector-watchdog@0.service" + rm $LINK + LINK="$D$systemd_system_unitdir/obmc-host-timeout@0.target.wants/openpower-debug-collector-watchdog-timeout@0.service" + rm $LINK +} diff --git a/meta-openpower/recipes-phosphor/debug/openpower-debug-collector_git.bb b/meta-openpower/recipes-phosphor/debug/openpower-debug-collector_git.bb index 08b58ea7c..505e23255 100644 --- a/meta-openpower/recipes-phosphor/debug/openpower-debug-collector_git.bb +++ b/meta-openpower/recipes-phosphor/debug/openpower-debug-collector_git.bb @@ -11,6 +11,7 @@ inherit autotools \ phosphor-dbus-yaml require ${BPN}.inc +require ${BPN}-systemd-links.inc DEPENDS += " \ phosphor-logging \ @@ -26,26 +27,6 @@ APPS = "checkstop watchdog" DEBUG_TMPL = "openpower-debug-collector-{0}@.service" SYSTEMD_SERVICE_${PN} += "${@compose_list(d, 'DEBUG_TMPL', 'APPS')}" -# This needs to be executed as part of host crash -CHECKSTOP_TMPL = "openpower-debug-collector-checkstop@.service" -CRASH_TGTFMT = "obmc-host-crash@{0}.target" -CHECKSTOP_INSTFMT = "openpower-debug-collector-checkstop@{0}.service" -CRASH_CHECKSTOP_FMT = "../${CHECKSTOP_TMPL}:${CRASH_TGTFMT}.wants/${CHECKSTOP_INSTFMT}" - -# Make watchdog part of obmc-host-timeout target -WDOG_TMPL = "openpower-debug-collector-watchdog@.service" -TIMEOUT_TGTFMT = "obmc-host-timeout@{0}.target" -WDOG_INSTFMT = "openpower-debug-collector-watchdog@{0}.service" -TIMEOUT_WDOG_FMT = "../${WDOG_TMPL}:${TIMEOUT_TGTFMT}.wants/${WDOG_INSTFMT}" - -# Capture debug information on watchdog timeout -DEBUG_WD_TIMEOUT_TMPL = "openpower-debug-collector-watchdog-timeout@.service" -DEBUG_WD_TIMEOUT_INSTFMT = "openpower-debug-collector-watchdog-timeout@{0}.service" -DEBUG_WD_TIMEOUT_FMT = "../${DEBUG_WD_TIMEOUT_TMPL}:${TIMEOUT_TGTFMT}.wants/${DEBUG_WD_TIMEOUT_INSTFMT}" - -SYSTEMD_LINK_${PN} += "${@compose_list(d, 'CRASH_CHECKSTOP_FMT', 'OBMC_HOST_INSTANCES')}" -SYSTEMD_LINK_${PN} += "${@compose_list(d, 'TIMEOUT_WDOG_FMT', 'OBMC_HOST_INSTANCES')}" -SYSTEMD_LINK_${PN} += "${@compose_list(d, 'DEBUG_WD_TIMEOUT_FMT', 'OBMC_HOST_INSTANCES')}" # Do not depend on phosphor-logging for native build DEPENDS_remove_class-native = "phosphor-logging" -- cgit v1.2.3