Kumar Thangavel | bf2522d | 2021-11-26 12:03:10 +0530 | [diff] [blame^] | 1 | FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" |
| 2 | |
| 3 | SRC_URI:append:fb-withhost = " file://obmc-chassis-hard-poweroff@.target \ |
| 4 | file://obmc-chassis-poweroff@0.target \ |
| 5 | file://obmc-poweroff.service \ |
| 6 | file://host-poweroff" |
| 7 | |
| 8 | PACKAGECONFIG:append = " json sensor-monitor" |
| 9 | |
| 10 | EXTRA_OECONF = "enable_host_state=yes" |
| 11 | |
| 12 | RDEPENDS:sensor-monitor = " bash" |
| 13 | |
| 14 | do_install:append:fb-withhost() { |
| 15 | |
| 16 | install -d ${D}${systemd_system_unitdir} |
| 17 | install -m 0644 ${WORKDIR}/obmc-chassis-hard-poweroff@.target ${D}${systemd_system_unitdir} |
| 18 | install -m 0644 ${WORKDIR}/obmc-chassis-poweroff@0.target ${D}${systemd_system_unitdir} |
| 19 | install -m 0644 ${WORKDIR}/obmc-poweroff.service ${D}${systemd_system_unitdir} |
| 20 | |
| 21 | # Store the bitbake variable OBMC_HOST_INSTANCES inside the script as HOST_INSTANCES variable using sed. |
| 22 | sed -i -e "s,HOST_INSTANCES_SED_REPLACEMENT_VALUE,${OBMC_HOST_INSTANCES},g" ${WORKDIR}/host-poweroff |
| 23 | |
| 24 | install -m 0755 -d ${D}/var/lib/phosphor-fan-presence/sensor-monitor |
| 25 | |
| 26 | install -d ${D}/usr/libexec/phosphor-fan-sensor-monitor |
| 27 | install -m 0777 ${WORKDIR}/host-poweroff ${D}/usr/libexec/phosphor-fan-sensor-monitor/ |
| 28 | |
| 29 | } |
| 30 | |
| 31 | pkg_postinst:${PN}() { |
| 32 | |
| 33 | mkdir -p $D$systemd_system_unitdir/obmc-chassis-hard-poweroff@0.target.requires |
| 34 | mkdir -p $D$systemd_system_unitdir/obmc-chassis-hard-poweroff@0.target.requires/obmc-chassis-poweroff@0.target.requires |
| 35 | |
| 36 | LINK="$D$systemd_system_unitdir/obmc-chassis-hard-poweroff@0.target.requires/obmc-chassis-poweroff@0.target" |
| 37 | TARGET="../obmc-chassis-poweroff@0.target" |
| 38 | ln -s $TARGET $LINK |
| 39 | |
| 40 | LINK="$D$systemd_system_unitdir/obmc-chassis-hard-poweroff@0.target.requires/obmc-chassis-poweroff@0.target.requires/obmc-poweroff.service" |
| 41 | TARGET="../../obmc-poweroff.service" |
| 42 | ln -s $TARGET $LINK |
| 43 | |
| 44 | } |
| 45 | |
| 46 | FILES:sensor-monitor += "/usr/libexec/phosphor-fan-sensor-monitor/host-poweroff" |
| 47 | |
| 48 | FILES:sensor-monitor += "${systemd_system_unitdir}/obmc-chassis-hard-poweroff@.target" |
| 49 | FILES:sensor-monitor += "${systemd_system_unitdir}/obmc-chassis-poweroff@0.target " |
| 50 | FILES:sensor-monitor += "${systemd_system_unitdir}/obmc-poweroff.service" |
| 51 | |