blob: c65e729bcb9e9e378c0f688ebb7e6de0ae35bfde [file] [log] [blame]
Potin Lai6d57a882022-05-24 19:22:23 +08001FILESEXTRAPATHS: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:bletchley = " ${@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:bletchley = " ${@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:bletchley(){
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}