Potin Lai | 6d57a88 | 2022-05-24 19:22:23 +0800 | [diff] [blame^] | 1 | FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" |
| 2 | |
| 3 | inherit obmc-phosphor-systemd |
| 4 | |
| 5 | # Add service file link |
| 6 | TMPL_PRESENT = "phosphor-gpio-presence@.service" |
| 7 | INSTFMT_PRESENT = "phosphor-gpio-presence@presence-sled{0}.service" |
| 8 | PRESENT_TGT = "multi-user.target" |
| 9 | FMT_PRESENT = "../${TMPL_PRESENT}:${PRESENT_TGT}.requires/${INSTFMT_PRESENT}" |
| 10 | SYSTEMD_LINK:${PN}-presence:append:bletchley = " ${@compose_list(d, 'FMT_PRESENT', 'OBMC_HOST_INSTANCES')}" |
| 11 | |
| 12 | # Add environment file |
| 13 | SLED_PRESENT_ENV_FMT = "obmc/gpio/presence-sled{0}.conf" |
| 14 | SYSTEMD_ENVIRONMENT_FILE:${PN}-presence:bletchley = " ${@compose_list(d, 'SLED_PRESENT_ENV_FMT', 'OBMC_HOST_INSTANCES')}" |
| 15 | |
| 16 | GPIO_PRESENCE_SLED_CONF="/etc/default/obmc/gpio/%i.conf" |
| 17 | |
| 18 | do_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 | } |