blob: 6236116c21f2de317c5195ef8adada1d7a5d7f04 [file] [log] [blame]
Lei YUb3cb3812016-12-22 16:15:03 +08001SUMMARY = "Romulus CPLD Trigger"
2DESCRIPTION = "Romulus power on workaround to trigger CPLD to continue power sequence"
3PR = "r0"
4
5inherit obmc-phosphor-systemd
6inherit obmc-phosphor-license
7
8RDEPENDS_${PN} += "obmc-pydevtools"
9
10PROVIDES += 'virtual/p9-vcs-workaround'
11RPROVIDES_${PN} += 'virtual-p9-vcs-workaround'
12
13S = "${WORKDIR}"
Lei YU65725b22017-02-14 20:41:35 +080014SRC_URI += "file://cpld_trigger.sh \
15 file://cpld_reset.sh"
Lei YUb3cb3812016-12-22 16:15:03 +080016
17do_install() {
18 install -d ${D}${bindir}
19 install -m 0755 ${WORKDIR}/cpld_trigger.sh ${D}${bindir}/cpld_trigger.sh
Lei YU65725b22017-02-14 20:41:35 +080020 install -m 0755 ${WORKDIR}/cpld_reset.sh ${D}${bindir}/cpld_reset.sh
Lei YUb3cb3812016-12-22 16:15:03 +080021}
22
23TMPL = "cpld_trigger@.service"
Lei YU65725b22017-02-14 20:41:35 +080024TMPL_RESET = "cpld_reset@.service"
Lei YUb3cb3812016-12-22 16:15:03 +080025INSTFMT = "cpld_trigger@{0}.service"
Lei YU65725b22017-02-14 20:41:35 +080026INSTFMT_RESET = "cpld_reset@{0}.service"
Josh D. King5df2fe92017-04-06 14:43:46 -050027TGTFMT = "obmc-chassis-poweron@{0}.target"
28TGTFMT_RESET = "obmc-chassis-poweroff@{0}.target"
Lei YUf2e12312017-02-20 10:22:27 +080029FMT = "../${TMPL}:${TGTFMT}.requires/${INSTFMT}"
30FMT_RESET = "../${TMPL_RESET}:${TGTFMT_RESET}.requires/${INSTFMT_RESET}"
Lei YUb3cb3812016-12-22 16:15:03 +080031
32SYSTEMD_SERVICE_${PN} += "${TMPL}"
33SYSTEMD_LINK_${PN} += "${@compose_list(d, 'FMT', 'OBMC_CHASSIS_INSTANCES')}"
34
Lei YU65725b22017-02-14 20:41:35 +080035SYSTEMD_SERVICE_${PN} += "${TMPL_RESET}"
36SYSTEMD_LINK_${PN} += "${@compose_list(d, 'FMT_RESET', 'OBMC_CHASSIS_INSTANCES')}"