blob: da061d16ec26040ceb25290329f3f9e4d1a9214a [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"
Patrick Ventured3728702018-10-21 08:27:22 -07004PV = "1.0+git${SRCPV}"
vishwabmc2ac6f932015-10-09 15:51:50 +05305
Brad Bishop8fffc162016-08-19 09:02:54 -05006RRECOMMENDS_${PN} += "packagegroup-obmc-ipmid-providers-libs"
Chris Austen9d3325a2015-10-24 19:34:11 -05007
Matthew Barth6b136a42016-08-16 16:51:35 -05008inherit autotools pkgconfig
Patrick Venturecb675692017-12-22 14:36:07 -08009inherit obmc-phosphor-ipmiprovider-symlink
vishwabmc2ac6f932015-10-09 15:51:50 +053010inherit obmc-phosphor-license
Patrick Williams89b11a12015-10-15 15:20:20 -050011inherit obmc-phosphor-sdbus-service
Patrick Venturecb675692017-12-22 14:36:07 -080012inherit obmc-phosphor-systemd
Ratan Gupta3aa591f2017-03-06 17:05:11 +053013inherit phosphor-ipmi-host
14inherit pythonnative
vishwabmc2ac6f932015-10-09 15:51:50 +053015
Brad Bishop01e6b172018-01-26 22:11:36 -050016def ipmi_whitelists(d):
17 whitelists = d.getVar(
18 'VIRTUAL-RUNTIME_phosphor-ipmi-providers', True) or ''
19 whitelists = whitelists.split()
20 whitelists = [ '{}-whitelist-native'.format(x) for x in whitelists ]
21 return ' '.join(whitelists)
22
Patrick Venturecb675692017-12-22 14:36:07 -080023DEPENDS += "autoconf-archive-native"
David Cobbleyf9236522017-11-21 16:17:40 -080024DEPENDS += "nlohmann-json"
Patrick Venturecb675692017-12-22 14:36:07 -080025DEPENDS += "obmc-targets"
Brad Bishop01e6b172018-01-26 22:11:36 -050026DEPENDS += "${@ipmi_whitelists(d)}"
Patrick Venturecb675692017-12-22 14:36:07 -080027DEPENDS += "phosphor-dbus-interfaces"
Adriana Kobylakc009f892017-02-17 08:21:42 -060028DEPENDS += "phosphor-logging"
Brad Bishop12e3d602016-10-05 20:10:23 -040029DEPENDS += "phosphor-mapper"
Ratan Guptaca8fd9d2017-03-20 18:20:47 +053030DEPENDS += "sdbusplus"
Patrick Venturecb675692017-12-22 14:36:07 -080031DEPENDS += "sdbus++-native"
Tom Josephcf7e8492017-05-08 11:49:10 +053032DEPENDS += "virtual/phosphor-ipmi-inventory-sel"
Marri Devender Rao53c55032017-07-26 02:11:32 -050033DEPENDS += "virtual/phosphor-ipmi-fru-merge-config"
Patrick Venturecb675692017-12-22 14:36:07 -080034DEPENDS += "virtual/phosphor-ipmi-sensor-inventory"
Patrick Venture0b2b1652018-01-18 18:01:29 -080035DEPENDS += "virtual/phosphor-ipmi-channel-config"
Andrew Geissler126e7842018-09-25 19:50:20 +000036DEPENDS += "boost"
Ratan Gupta3aa591f2017-03-06 17:05:11 +053037
Andrew Jeffery1b77f28e2018-04-06 14:13:14 +093038VIRTUAL-RUNTIME_ipmi-config ?= "phosphor-ipmi-config"
39
Adriana Kobylakc009f892017-02-17 08:21:42 -060040RDEPENDS_${PN}-dev += "phosphor-logging"
Brad Bishop12e3d602016-10-05 20:10:23 -040041RDEPENDS_${PN}-dev += "phosphor-mapper-dev"
Milton D. Miller IIb8c51742016-03-04 15:29:29 -060042RDEPENDS_${PN} += "clear-once"
Brad Bishopea4022a2016-07-26 15:52:01 -040043RDEPENDS_${PN} += "libmapper"
Patrick Venturecb675692017-12-22 14:36:07 -080044RDEPENDS_${PN} += "network"
45RDEPENDS_${PN} += "phosphor-dbus-interfaces"
46RDEPENDS_${PN} += "phosphor-mapper"
Vishwanatha Subbannab1c39e02016-11-10 21:52:46 +053047RDEPENDS_${PN} += "phosphor-time-manager"
Patrick Venturecb675692017-12-22 14:36:07 -080048RDEPENDS_${PN} += "sdbusplus"
Andrew Jeffery1b77f28e2018-04-06 14:13:14 +093049RDEPENDS_${PN} += "${VIRTUAL-RUNTIME_ipmi-config}"
Vishwanatha Subbanna2d78dd02017-06-12 13:09:10 +053050RDEPENDS_${PN} += "virtual/obmc-watchdog"
Ratan Guptaca8fd9d2017-03-20 18:20:47 +053051
Richard Marian Thomaiyar8ac94ce2018-08-20 20:14:16 +053052inherit useradd
53
54USERADD_PACKAGES = "${PN}"
55# add ipmi group
56GROUPADD_PARAM_${PN} = "ipmi"
57
Vishwanatha Subbannacaff3fa2017-03-31 14:41:11 +053058SYSTEMD_SERVICE_${PN} += "xyz.openbmc_project.Ipmi.Internal.SoftPowerOff.service phosphor-ipmi-host.service"
59
Andrew Geisslera36894f2018-02-05 12:02:35 -080060RRECOMMENDS_${PN} += "${VIRTUAL-RUNTIME_obmc-settings-mgmt}"
61
vishwabmc2ac6f932015-10-09 15:51:50 +053062
Marri Devender Rao2ba514e2017-06-08 00:47:54 -050063require ${PN}.inc
Chris Austen9d3325a2015-10-24 19:34:11 -050064
Tom Joseph1562bbc2017-02-20 12:01:43 +053065# Setup IPMI Whitelist Conf files
66WHITELIST_CONF = " \
Patrick Williams43b61b72017-02-24 13:04:06 -060067 ${STAGING_DATADIR_NATIVE}/phosphor-ipmi-host/*.conf \
Tom Joseph1562bbc2017-02-20 12:01:43 +053068 ${S}/host-ipmid-whitelist.conf \
69 "
70EXTRA_OECONF = " \
71 WHITELIST_CONF="${WHITELIST_CONF}" \
Ratan Gupta3aa591f2017-03-06 17:05:11 +053072 SENSOR_YAML_GEN=${STAGING_DIR_NATIVE}${sensor_datadir}/sensor.yaml \
Tom Josephcf7e8492017-05-08 11:49:10 +053073 INVSENSOR_YAML_GEN=${STAGING_DIR_NATIVE}${sensor_datadir}/invsensor.yaml \
Marri Devender Rao53c55032017-07-26 02:11:32 -050074 FRU_YAML_GEN=${STAGING_DIR_NATIVE}${config_datadir}/fru_config.yaml \
Patrick Venture0b2b1652018-01-18 18:01:29 -080075 CHANNEL_YAML_GEN=${STAGING_DIR_NATIVE}${sensor_datadir}/channel.yaml \
Marri Devender Rao95eaf492018-01-18 11:21:19 -060076 POWER_READING_SENSOR=${datadir}/ipmi-providers/power_reading.json\
Tom Joseph1562bbc2017-02-20 12:01:43 +053077 "
78
vishwabmc2ac6f932015-10-09 15:51:50 +053079S = "${WORKDIR}/git"
80
Andrew Jeffery1b77f28e2018-04-06 14:13:14 +093081SRC_URI += "file://merge_yamls.py "
Dhruvaraj Subhashchandran12352762017-08-04 16:09:15 -050082
Vernon Mauery91944682018-07-30 15:49:09 -070083HOSTIPMI_PROVIDER_LIBRARY += "libipmi20.so"
Tom Josephdcdc8ea2017-02-01 19:47:27 +053084HOSTIPMI_PROVIDER_LIBRARY += "libsysintfcmds.so"
85
Vernon Mauery91944682018-07-30 15:49:09 -070086NETIPMI_PROVIDER_LIBRARY += "libipmi20.so"
Tom Josephdcdc8ea2017-02-01 19:47:27 +053087
Matthew Barth6b136a42016-08-16 16:51:35 -050088FILES_${PN}_append = " ${libdir}/host-ipmid/lib*${SOLIBS}"
Patrick Venturecb675692017-12-22 14:36:07 -080089FILES_${PN}_append = " ${libdir}/ipmid-providers/lib*${SOLIBS}"
Tom Josephdcdc8ea2017-02-01 19:47:27 +053090FILES_${PN}_append = " ${libdir}/net-ipmid/lib*${SOLIBS}"
91FILES_${PN}-dev_append = " ${libdir}/ipmid-providers/lib*${SOLIBSDEV} ${libdir}/ipmid-providers/*.la"
Brad Bishop6371e702016-09-06 13:03:39 -040092
Andrew Geissler41e3cb32017-01-04 11:11:50 -060093# Soft Power Off
Andrew Geisslerecfa6622017-05-11 16:16:27 -050094# install the soft power off service in the host shutdown target
95SOFT_SVC = "xyz.openbmc_project.Ipmi.Internal.SoftPowerOff.service"
96SOFT_TGTFMT = "obmc-host-shutdown@{0}.target"
97SOFT_FMT = "../${SOFT_SVC}:${SOFT_TGTFMT}.requires/${SOFT_SVC}"
98SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'SOFT_FMT', 'OBMC_HOST_INSTANCES')}"
Dhruvaraj Subhashchandran12352762017-08-04 16:09:15 -050099
100#Collect all hardcoded sensor yamls from different recipes and
101#merge all of them with sensor.yaml.
102python do_merge_sensors () {
103 import subprocess
104
105 # TODO: Perform the merge in a temporary directory?
106 workdir = d.getVar('WORKDIR', True)
107 nativedir = d.getVar('STAGING_DIR_NATIVE', True)
108 sensorsdir = d.getVar('sensor_datadir', True)
109 sensorsdir = sensorsdir[1:]
110 sensorsdir = os.path.join(nativedir, sensorsdir)
111 cmd = []
112 cmd.append(os.path.join(workdir, 'merge_yamls.py'))
113 cmd.append(os.path.join(sensorsdir, 'sensor.yaml'))
114
115 if os.stat(os.path.join(sensorsdir, 'sensor.yaml')).st_size == 0:
116 return
117 fetch = bb.fetch2.Fetch([], d)
Kun Yicdc3b232017-10-09 23:17:08 -0700118 override_urls = [url for url in fetch.urls if url.endswith('.hardcoded.yaml')]
Dhruvaraj Subhashchandran12352762017-08-04 16:09:15 -0500119 for url in override_urls:
120 bb.debug(2, 'Overriding with source: ' + url)
121 local_base = os.path.basename(fetch.localpath(url))
122 filename = os.path.join(workdir, local_base)
123 cmd.append(filename)
124
125 # Invoke the script and don't catch any resulting exception.
126 subprocess.check_call(cmd)
127}
Andrew Jeffery1b77f28e2018-04-06 14:13:14 +0930128
Dhruvaraj Subhashchandran12352762017-08-04 16:09:15 -0500129# python-pyyaml-native is installed by do_configure, so put this task after
130addtask merge_sensors after do_configure before do_compile