blob: f79974acef3bda9104b294a59a069fa4913a7a3d [file] [log] [blame]
vishwabmc2ac6f932015-10-09 15:51:50 +05301SUMMARY = "Phosphor OpenBMC IPMI daemon"
2DESCRIPTION = "Phosphor OpenBMC IPMI router and plugin libraries"
vishwabmc2ac6f932015-10-09 15:51:50 +05303PR = "r1"
4
Brad Bishop8fffc162016-08-19 09:02:54 -05005RRECOMMENDS_${PN} += "packagegroup-obmc-ipmid-providers-libs"
Chris Austen9d3325a2015-10-24 19:34:11 -05006
Matthew Barth6b136a42016-08-16 16:51:35 -05007inherit autotools pkgconfig
Patrick Venturecb675692017-12-22 14:36:07 -08008inherit obmc-phosphor-ipmiprovider-symlink
vishwabmc2ac6f932015-10-09 15:51:50 +05309inherit obmc-phosphor-license
Patrick Williams89b11a12015-10-15 15:20:20 -050010inherit obmc-phosphor-sdbus-service
Patrick Venturecb675692017-12-22 14:36:07 -080011inherit obmc-phosphor-systemd
Ratan Gupta3aa591f2017-03-06 17:05:11 +053012inherit phosphor-ipmi-host
13inherit pythonnative
vishwabmc2ac6f932015-10-09 15:51:50 +053014
Brad Bishop01e6b172018-01-26 22:11:36 -050015def ipmi_whitelists(d):
16 whitelists = d.getVar(
17 'VIRTUAL-RUNTIME_phosphor-ipmi-providers', True) or ''
18 whitelists = whitelists.split()
19 whitelists = [ '{}-whitelist-native'.format(x) for x in whitelists ]
20 return ' '.join(whitelists)
21
Patrick Venturecb675692017-12-22 14:36:07 -080022DEPENDS += "autoconf-archive-native"
David Cobbleyf9236522017-11-21 16:17:40 -080023DEPENDS += "nlohmann-json"
Patrick Venturecb675692017-12-22 14:36:07 -080024DEPENDS += "obmc-targets"
Brad Bishop01e6b172018-01-26 22:11:36 -050025DEPENDS += "${@ipmi_whitelists(d)}"
Patrick Venturecb675692017-12-22 14:36:07 -080026DEPENDS += "phosphor-dbus-interfaces"
Adriana Kobylakc009f892017-02-17 08:21:42 -060027DEPENDS += "phosphor-logging"
Brad Bishop12e3d602016-10-05 20:10:23 -040028DEPENDS += "phosphor-mapper"
Ratan Guptaca8fd9d2017-03-20 18:20:47 +053029DEPENDS += "sdbusplus"
Patrick Venturecb675692017-12-22 14:36:07 -080030DEPENDS += "sdbus++-native"
Tom Josephcf7e8492017-05-08 11:49:10 +053031DEPENDS += "virtual/phosphor-ipmi-inventory-sel"
Marri Devender Rao53c55032017-07-26 02:11:32 -050032DEPENDS += "virtual/phosphor-ipmi-fru-merge-config"
Patrick Venturecb675692017-12-22 14:36:07 -080033DEPENDS += "virtual/phosphor-ipmi-sensor-inventory"
Patrick Venture0b2b1652018-01-18 18:01:29 -080034DEPENDS += "virtual/phosphor-ipmi-channel-config"
Ratan Gupta3aa591f2017-03-06 17:05:11 +053035
Andrew Jeffery1b77f28e2018-04-06 14:13:14 +093036VIRTUAL-RUNTIME_ipmi-config ?= "phosphor-ipmi-config"
37
Adriana Kobylakc009f892017-02-17 08:21:42 -060038RDEPENDS_${PN}-dev += "phosphor-logging"
Brad Bishop12e3d602016-10-05 20:10:23 -040039RDEPENDS_${PN}-dev += "phosphor-mapper-dev"
Milton D. Miller IIb8c51742016-03-04 15:29:29 -060040RDEPENDS_${PN} += "clear-once"
Brad Bishopea4022a2016-07-26 15:52:01 -040041RDEPENDS_${PN} += "libmapper"
Patrick Venturecb675692017-12-22 14:36:07 -080042RDEPENDS_${PN} += "network"
43RDEPENDS_${PN} += "phosphor-dbus-interfaces"
44RDEPENDS_${PN} += "phosphor-mapper"
Vishwanatha Subbannab1c39e02016-11-10 21:52:46 +053045RDEPENDS_${PN} += "phosphor-time-manager"
Patrick Venturecb675692017-12-22 14:36:07 -080046RDEPENDS_${PN} += "sdbusplus"
Andrew Jeffery1b77f28e2018-04-06 14:13:14 +093047RDEPENDS_${PN} += "${VIRTUAL-RUNTIME_ipmi-config}"
Vishwanatha Subbanna2d78dd02017-06-12 13:09:10 +053048RDEPENDS_${PN} += "virtual/obmc-watchdog"
Ratan Guptaca8fd9d2017-03-20 18:20:47 +053049
Vishwanatha Subbannacaff3fa2017-03-31 14:41:11 +053050SYSTEMD_SERVICE_${PN} += "xyz.openbmc_project.Ipmi.Internal.SoftPowerOff.service phosphor-ipmi-host.service"
51
Andrew Geisslera36894f2018-02-05 12:02:35 -080052RRECOMMENDS_${PN} += "${VIRTUAL-RUNTIME_obmc-settings-mgmt}"
53
vishwabmc2ac6f932015-10-09 15:51:50 +053054
Marri Devender Rao2ba514e2017-06-08 00:47:54 -050055require ${PN}.inc
Chris Austen9d3325a2015-10-24 19:34:11 -050056
Tom Joseph1562bbc2017-02-20 12:01:43 +053057# Setup IPMI Whitelist Conf files
58WHITELIST_CONF = " \
Patrick Williams43b61b72017-02-24 13:04:06 -060059 ${STAGING_DATADIR_NATIVE}/phosphor-ipmi-host/*.conf \
Tom Joseph1562bbc2017-02-20 12:01:43 +053060 ${S}/host-ipmid-whitelist.conf \
61 "
62EXTRA_OECONF = " \
63 WHITELIST_CONF="${WHITELIST_CONF}" \
Ratan Gupta3aa591f2017-03-06 17:05:11 +053064 SENSOR_YAML_GEN=${STAGING_DIR_NATIVE}${sensor_datadir}/sensor.yaml \
Tom Josephcf7e8492017-05-08 11:49:10 +053065 INVSENSOR_YAML_GEN=${STAGING_DIR_NATIVE}${sensor_datadir}/invsensor.yaml \
Marri Devender Rao53c55032017-07-26 02:11:32 -050066 FRU_YAML_GEN=${STAGING_DIR_NATIVE}${config_datadir}/fru_config.yaml \
Patrick Venture0b2b1652018-01-18 18:01:29 -080067 CHANNEL_YAML_GEN=${STAGING_DIR_NATIVE}${sensor_datadir}/channel.yaml \
Marri Devender Rao95eaf492018-01-18 11:21:19 -060068 POWER_READING_SENSOR=${datadir}/ipmi-providers/power_reading.json\
Tom Joseph1562bbc2017-02-20 12:01:43 +053069 "
70
vishwabmc2ac6f932015-10-09 15:51:50 +053071S = "${WORKDIR}/git"
72
Andrew Jeffery1b77f28e2018-04-06 14:13:14 +093073SRC_URI += "file://merge_yamls.py "
Dhruvaraj Subhashchandran12352762017-08-04 16:09:15 -050074
Tom Josephdcdc8ea2017-02-01 19:47:27 +053075HOSTIPMI_PROVIDER_LIBRARY += "libapphandler.so"
Tom Josephdcdc8ea2017-02-01 19:47:27 +053076HOSTIPMI_PROVIDER_LIBRARY += "libsysintfcmds.so"
77
78NETIPMI_PROVIDER_LIBRARY += "libapphandler.so"
79
Matthew Barth6b136a42016-08-16 16:51:35 -050080FILES_${PN}_append = " ${libdir}/host-ipmid/lib*${SOLIBS}"
Patrick Venturecb675692017-12-22 14:36:07 -080081FILES_${PN}_append = " ${libdir}/ipmid-providers/lib*${SOLIBS}"
Tom Josephdcdc8ea2017-02-01 19:47:27 +053082FILES_${PN}_append = " ${libdir}/net-ipmid/lib*${SOLIBS}"
83FILES_${PN}-dev_append = " ${libdir}/ipmid-providers/lib*${SOLIBSDEV} ${libdir}/ipmid-providers/*.la"
Brad Bishop6371e702016-09-06 13:03:39 -040084
Andrew Geissler41e3cb32017-01-04 11:11:50 -060085# Soft Power Off
Andrew Geisslerecfa6622017-05-11 16:16:27 -050086# install the soft power off service in the host shutdown target
87SOFT_SVC = "xyz.openbmc_project.Ipmi.Internal.SoftPowerOff.service"
88SOFT_TGTFMT = "obmc-host-shutdown@{0}.target"
89SOFT_FMT = "../${SOFT_SVC}:${SOFT_TGTFMT}.requires/${SOFT_SVC}"
90SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'SOFT_FMT', 'OBMC_HOST_INSTANCES')}"
Dhruvaraj Subhashchandran12352762017-08-04 16:09:15 -050091
92#Collect all hardcoded sensor yamls from different recipes and
93#merge all of them with sensor.yaml.
94python do_merge_sensors () {
95 import subprocess
96
97 # TODO: Perform the merge in a temporary directory?
98 workdir = d.getVar('WORKDIR', True)
99 nativedir = d.getVar('STAGING_DIR_NATIVE', True)
100 sensorsdir = d.getVar('sensor_datadir', True)
101 sensorsdir = sensorsdir[1:]
102 sensorsdir = os.path.join(nativedir, sensorsdir)
103 cmd = []
104 cmd.append(os.path.join(workdir, 'merge_yamls.py'))
105 cmd.append(os.path.join(sensorsdir, 'sensor.yaml'))
106
107 if os.stat(os.path.join(sensorsdir, 'sensor.yaml')).st_size == 0:
108 return
109 fetch = bb.fetch2.Fetch([], d)
Kun Yicdc3b232017-10-09 23:17:08 -0700110 override_urls = [url for url in fetch.urls if url.endswith('.hardcoded.yaml')]
Dhruvaraj Subhashchandran12352762017-08-04 16:09:15 -0500111 for url in override_urls:
112 bb.debug(2, 'Overriding with source: ' + url)
113 local_base = os.path.basename(fetch.localpath(url))
114 filename = os.path.join(workdir, local_base)
115 cmd.append(filename)
116
117 # Invoke the script and don't catch any resulting exception.
118 subprocess.check_call(cmd)
119}
Andrew Jeffery1b77f28e2018-04-06 14:13:14 +0930120
Dhruvaraj Subhashchandran12352762017-08-04 16:09:15 -0500121# python-pyyaml-native is installed by do_configure, so put this task after
122addtask merge_sensors after do_configure before do_compile