blob: 23aac0a913192048c5a98281f744411af626702b [file] [log] [blame]
Kumar Thangavelbf2522d2021-11-26 12:03:10 +05301FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
2
3SRC_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
8PACKAGECONFIG:append = " json sensor-monitor"
9
10EXTRA_OECONF = "enable_host_state=yes"
11
12RDEPENDS:sensor-monitor = " bash"
13
14do_install:append:fb-withhost() {
15
16install -d ${D}${systemd_system_unitdir}
17install -m 0644 ${WORKDIR}/obmc-chassis-hard-poweroff@.target ${D}${systemd_system_unitdir}
18install -m 0644 ${WORKDIR}/obmc-chassis-poweroff@0.target ${D}${systemd_system_unitdir}
19install -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.
22sed -i -e "s,HOST_INSTANCES_SED_REPLACEMENT_VALUE,${OBMC_HOST_INSTANCES},g" ${WORKDIR}/host-poweroff
23
24install -m 0755 -d ${D}/var/lib/phosphor-fan-presence/sensor-monitor
25
26install -d ${D}/usr/libexec/phosphor-fan-sensor-monitor
27install -m 0777 ${WORKDIR}/host-poweroff ${D}/usr/libexec/phosphor-fan-sensor-monitor/
28
29}
30
31pkg_postinst:${PN}() {
32
33mkdir -p $D$systemd_system_unitdir/obmc-chassis-hard-poweroff@0.target.requires
34mkdir -p $D$systemd_system_unitdir/obmc-chassis-hard-poweroff@0.target.requires/obmc-chassis-poweroff@0.target.requires
35
36LINK="$D$systemd_system_unitdir/obmc-chassis-hard-poweroff@0.target.requires/obmc-chassis-poweroff@0.target"
37TARGET="../obmc-chassis-poweroff@0.target"
38ln -s $TARGET $LINK
39
40LINK="$D$systemd_system_unitdir/obmc-chassis-hard-poweroff@0.target.requires/obmc-chassis-poweroff@0.target.requires/obmc-poweroff.service"
41TARGET="../../obmc-poweroff.service"
42ln -s $TARGET $LINK
43
44}
45
46FILES:sensor-monitor += "/usr/libexec/phosphor-fan-sensor-monitor/host-poweroff"
47
48FILES:sensor-monitor += "${systemd_system_unitdir}/obmc-chassis-hard-poweroff@.target"
49FILES:sensor-monitor += "${systemd_system_unitdir}/obmc-chassis-poweroff@0.target "
50FILES:sensor-monitor += "${systemd_system_unitdir}/obmc-poweroff.service"
51