blob: 4ee74375cb9832619e22ceff8327579b6a3560c5 [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}"
Patrick Williamsa2fb20c2024-02-05 14:11:29 -060010SYSTEMD_LINK:${PN}-presence:append = " ${@compose_list(d, 'FMT_PRESENT', 'OBMC_HOST_INSTANCES')}"
Potin Lai6d57a882022-05-24 19:22:23 +080011
12# Add environment file
13SLED_PRESENT_ENV_FMT = "obmc/gpio/presence-sled{0}.conf"
Patrick Williamsa2fb20c2024-02-05 14:11:29 -060014SYSTEMD_ENVIRONMENT_FILE:${PN}-presence = " ${@compose_list(d, 'SLED_PRESENT_ENV_FMT', 'OBMC_HOST_INSTANCES')}"
Potin Lai6d57a882022-05-24 19:22:23 +080015
16GPIO_PRESENCE_SLED_CONF="/etc/default/obmc/gpio/%i.conf"
17
Patrick Williamsa2fb20c2024-02-05 14:11:29 -060018do_install:append(){
Potin Lai6d57a882022-05-24 19:22:23 +080019 # 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}