Install obmc-mapper.target from obmc-targets package
The obmc-mapper.target was installed by phosphor-state-manager package.
It works fine if phosphor-state-manager is installed.
Unfortunately, x86 systems typically uses x86-power-control instead of
phosphor-state-manager to implement the state manager, and the
obmc-mapper.target is missing there. So a system with x86-power-control
does not have a valid obmc-mapper.target, and the services depdend on
the target will be started in unexpected order.
The obmc-mapper.target is really a common target, let obmc-targets.bb
install it.
Tested: Verify the g220a build has a valid obmc-mapper.target and the
phosphor-virtual-sensor service starts after the target.
Also verify the targets in phosphor-state-manager are not
installed.
Signed-off-by: Lei YU <yulei.sh@bytedance.com>
Change-Id: Idb069385a6c6c7add5331a1bf3efc0babc005d62
diff --git a/meta-phosphor/recipes-core/systemd/obmc-targets.bb b/meta-phosphor/recipes-core/systemd/obmc-targets.bb
index 2ab0c22..a95535e 100644
--- a/meta-phosphor/recipes-core/systemd/obmc-targets.bb
+++ b/meta-phosphor/recipes-core/systemd/obmc-targets.bb
@@ -5,5 +5,12 @@
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
-# TODO Will be removed once dependencies in other layers on this recipe are moved
-DEPENDS += "phosphor-state-manager"
+inherit allarch obmc-phosphor-systemd
+
+SRC_URI += "\
+ file://obmc-mapper.target \
+"
+
+SYSTEMD_SERVICE_${PN} += " \
+ obmc-mapper.target \
+"