1FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
2
3inherit obmc-phosphor-systemd
4
5# Add service file link
6TMPL_PRESENT = "phosphor-gpio-presence@.service"
7INSTFMT_PRESENT = "phosphor-gpio-presence@presence-sled{0}.service"
8PRESENT_TGT = "multi-user.target"
9FMT_PRESENT = "../${TMPL_PRESENT}:${PRESENT_TGT}.requires/${INSTFMT_PRESENT}"
10SYSTEMD_LINK:${PN}-presence:append = " ${@compose_list(d, 'FMT_PRESENT', 'OBMC_HOST_INSTANCES')}"
11
12# Add environment file
13SLED_PRESENT_ENV_FMT = "obmc/gpio/presence-sled{0}.conf"
14SYSTEMD_ENVIRONMENT_FILE:${PN}-presence = " ${@compose_list(d, 'SLED_PRESENT_ENV_FMT', 'OBMC_HOST_INSTANCES')}"
15
16GPIO_PRESENCE_SLED_CONF="/etc/default/obmc/gpio/%i.conf"
17
18do_install:append(){
19    # modify ConditionPathExists and EnvironmentFile to correct filepath
20    sed -i -e "s,ConditionPathExists=.*,ConditionPathExists=${GPIO_PRESENCE_SLED_CONF},g" ${D}${systemd_system_unitdir}/phosphor-gpio-presence@.service
21    sed -i -e "s,EnvironmentFile=.*,EnvironmentFile=${GPIO_PRESENCE_SLED_CONF},g" ${D}${systemd_system_unitdir}/phosphor-gpio-presence@.service
22}
23