blob: f5606cbf79419dd98bcb2287f2b3d041d92c5bbd [file] [log] [blame]
vishwabmc1bf499d2015-10-09 15:51:50 +05301SUMMARY = "Phosphor OpenBMC IPMI daemon"
2DESCRIPTION = "Phosphor OpenBMC IPMI router and plugin libraries"
vishwabmc1bf499d2015-10-09 15:51:50 +05303PR = "r1"
Patrick Venturef30b8842018-10-21 08:27:22 -07004PV = "1.0+git${SRCPV}"
Patrick Venture64329372018-11-03 09:42:59 -07005LICENSE = "Apache-2.0"
6LIC_FILES_CHKSUM = "file://LICENSE;md5=86d3f3a95c324c9479bd8986968f4327"
vishwabmc1bf499d2015-10-09 15:51:50 +05307
Brad Bishop7ee71462016-08-19 09:02:54 -05008RRECOMMENDS_${PN} += "packagegroup-obmc-ipmid-providers-libs"
Chris Austen213cd2a2015-10-24 19:34:11 -05009
Matthew Barth302592f2016-08-16 16:51:35 -050010inherit autotools pkgconfig
Patrick Ventured3dd0942017-12-22 14:36:07 -080011inherit obmc-phosphor-ipmiprovider-symlink
Patrick Williamsf7714062015-10-15 15:20:20 -050012inherit obmc-phosphor-sdbus-service
Patrick Ventured3dd0942017-12-22 14:36:07 -080013inherit obmc-phosphor-systemd
Ratan Guptab92d0ec2017-03-06 17:05:11 +053014inherit phosphor-ipmi-host
15inherit pythonnative
vishwabmc1bf499d2015-10-09 15:51:50 +053016
Brad Bishopfe88ee42019-06-07 15:21:01 -040017SRC_URI += "file://entity.yaml"
18
Brad Bishop7f2ade02018-01-26 22:11:36 -050019def ipmi_whitelists(d):
20 whitelists = d.getVar(
21 'VIRTUAL-RUNTIME_phosphor-ipmi-providers', True) or ''
22 whitelists = whitelists.split()
23 whitelists = [ '{}-whitelist-native'.format(x) for x in whitelists ]
24 return ' '.join(whitelists)
25
Patrick Ventured3dd0942017-12-22 14:36:07 -080026DEPENDS += "autoconf-archive-native"
David Cobbley1dc78fb2017-11-21 16:17:40 -080027DEPENDS += "nlohmann-json"
Patrick Ventured3dd0942017-12-22 14:36:07 -080028DEPENDS += "obmc-targets"
Brad Bishop7f2ade02018-01-26 22:11:36 -050029DEPENDS += "${@ipmi_whitelists(d)}"
Patrick Ventured3dd0942017-12-22 14:36:07 -080030DEPENDS += "phosphor-dbus-interfaces"
Adriana Kobylak17885c22017-02-17 08:21:42 -060031DEPENDS += "phosphor-logging"
Brad Bishop1122eb02016-10-05 20:10:23 -040032DEPENDS += "phosphor-mapper"
Ratan Gupta8dc22a92017-03-20 18:20:47 +053033DEPENDS += "sdbusplus"
Patrick Ventured3dd0942017-12-22 14:36:07 -080034DEPENDS += "sdbus++-native"
Tom Josephc32034f2019-02-04 03:54:06 -060035DEPENDS += "virtual/phosphor-ipmi-inventory-sel"
Marri Devender Rao5a0088c2017-07-26 02:11:32 -050036DEPENDS += "virtual/phosphor-ipmi-fru-merge-config"
Patrick Ventured3dd0942017-12-22 14:36:07 -080037DEPENDS += "virtual/phosphor-ipmi-sensor-inventory"
Andrew Geisslera561ec92018-09-25 19:50:20 +000038DEPENDS += "boost"
Patrick Venture12a94a82018-11-07 17:48:53 -080039DEPENDS += "sdeventplus"
Ratan Guptab92d0ec2017-03-06 17:05:11 +053040
Andrew Jeffery381e1e92018-04-06 14:13:14 +093041VIRTUAL-RUNTIME_ipmi-config ?= "phosphor-ipmi-config"
42
Adriana Kobylak17885c22017-02-17 08:21:42 -060043RDEPENDS_${PN}-dev += "phosphor-logging"
Brad Bishop1122eb02016-10-05 20:10:23 -040044RDEPENDS_${PN}-dev += "phosphor-mapper-dev"
Milton D. Miller II611e3ff2016-03-04 15:29:29 -060045RDEPENDS_${PN} += "clear-once"
Patrick Venture98fa9612019-03-28 09:09:13 -070046RDEPENDS_${PN} += "phosphor-network"
Vishwanatha Subbanna78bc5422016-11-10 21:52:46 +053047RDEPENDS_${PN} += "phosphor-time-manager"
Andrew Jeffery381e1e92018-04-06 14:13:14 +093048RDEPENDS_${PN} += "${VIRTUAL-RUNTIME_ipmi-config}"
Vishwanatha Subbanna55c545a2017-06-12 13:09:10 +053049RDEPENDS_${PN} += "virtual/obmc-watchdog"
Patrick Venture68f12612019-04-30 10:26:34 -070050RDEPENDS_${PN} += "${VIRTUAL-RUNTIME_obmc-bmc-state-manager}"
Patrick Venture00e88bf2019-05-03 07:51:58 -070051RDEPENDS_${PN} += "${VIRTUAL-RUNTIME_obmc-bmc-version}"
Patrick Venturef5dd0312019-05-03 07:53:57 -070052RDEPENDS_${PN} += "${VIRTUAL-RUNTIME_obmc-bmc-updater}"
Ratan Gupta8dc22a92017-03-20 18:20:47 +053053
Richard Marian Thomaiyarfe5b8d22018-08-20 20:14:16 +053054inherit useradd
55
56USERADD_PACKAGES = "${PN}"
57# add ipmi group
58GROUPADD_PARAM_${PN} = "ipmi"
Richard Marian Thomaiyar41882fb2018-12-14 09:04:40 +053059# Add root user to ipmi group
60GROUPMEMS_PARAM_${PN} = "-g ipmi -a root"
Richard Marian Thomaiyarfe5b8d22018-08-20 20:14:16 +053061
Vishwanatha Subbanna35318402017-03-31 14:41:11 +053062SYSTEMD_SERVICE_${PN} += "xyz.openbmc_project.Ipmi.Internal.SoftPowerOff.service phosphor-ipmi-host.service"
63
Andrew Geissler78e04542018-02-05 12:02:35 -080064RRECOMMENDS_${PN} += "${VIRTUAL-RUNTIME_obmc-settings-mgmt}"
65
vishwabmc1bf499d2015-10-09 15:51:50 +053066
Marri Devender Rao52a9f2d2017-06-08 00:47:54 -050067require ${PN}.inc
Chris Austen213cd2a2015-10-24 19:34:11 -050068
Tom Josephf07ae012017-02-20 12:01:43 +053069# Setup IPMI Whitelist Conf files
70WHITELIST_CONF = " \
Patrick Williamsf11f0152017-02-24 13:04:06 -060071 ${STAGING_DATADIR_NATIVE}/phosphor-ipmi-host/*.conf \
Tom Josephf07ae012017-02-20 12:01:43 +053072 ${S}/host-ipmid-whitelist.conf \
73 "
74EXTRA_OECONF = " \
Ratan Guptab92d0ec2017-03-06 17:05:11 +053075 SENSOR_YAML_GEN=${STAGING_DIR_NATIVE}${sensor_datadir}/sensor.yaml \
Tom Josephc32034f2019-02-04 03:54:06 -060076 INVSENSOR_YAML_GEN=${STAGING_DIR_NATIVE}${sensor_datadir}/invsensor.yaml \
Marri Devender Rao5a0088c2017-07-26 02:11:32 -050077 FRU_YAML_GEN=${STAGING_DIR_NATIVE}${config_datadir}/fru_config.yaml \
Tom Josephf07ae012017-02-20 12:01:43 +053078 "
Brad Bishopbb60cff2019-06-09 22:57:35 -040079EXTRA_OECONF_append = " \
80 WHITELIST_CONF="${WHITELIST_CONF}" \
81 "
Tom Josephf07ae012017-02-20 12:01:43 +053082
vishwabmc1bf499d2015-10-09 15:51:50 +053083S = "${WORKDIR}/git"
84
Andrew Jeffery381e1e92018-04-06 14:13:14 +093085SRC_URI += "file://merge_yamls.py "
Dhruvaraj Subhashchandran16d57052017-08-04 16:09:15 -050086
Vernon Mauery595c7382018-07-30 15:49:09 -070087HOSTIPMI_PROVIDER_LIBRARY += "libipmi20.so"
Tom Joseph40b4e3f2017-02-01 19:47:27 +053088HOSTIPMI_PROVIDER_LIBRARY += "libsysintfcmds.so"
William A. Kennington IIIc426a982018-12-19 14:53:22 -080089HOSTIPMI_PROVIDER_LIBRARY += "libusercmds.so"
Tom Joseph40b4e3f2017-02-01 19:47:27 +053090
Vernon Mauery595c7382018-07-30 15:49:09 -070091NETIPMI_PROVIDER_LIBRARY += "libipmi20.so"
William A. Kennington IIIc426a982018-12-19 14:53:22 -080092NETIPMI_PROVIDER_LIBRARY += "libusercmds.so"
Tom Joseph40b4e3f2017-02-01 19:47:27 +053093
Matthew Barth302592f2016-08-16 16:51:35 -050094FILES_${PN}_append = " ${libdir}/host-ipmid/lib*${SOLIBS}"
Patrick Ventured3dd0942017-12-22 14:36:07 -080095FILES_${PN}_append = " ${libdir}/ipmid-providers/lib*${SOLIBS}"
Tom Joseph40b4e3f2017-02-01 19:47:27 +053096FILES_${PN}_append = " ${libdir}/net-ipmid/lib*${SOLIBS}"
97FILES_${PN}-dev_append = " ${libdir}/ipmid-providers/lib*${SOLIBSDEV} ${libdir}/ipmid-providers/*.la"
Brad Bishop3b524cf2016-09-06 13:03:39 -040098
Andrew Geisslerafc510f2017-01-04 11:11:50 -060099# Soft Power Off
Andrew Geisslerd40db752017-05-11 16:16:27 -0500100# install the soft power off service in the host shutdown target
101SOFT_SVC = "xyz.openbmc_project.Ipmi.Internal.SoftPowerOff.service"
102SOFT_TGTFMT = "obmc-host-shutdown@{0}.target"
103SOFT_FMT = "../${SOFT_SVC}:${SOFT_TGTFMT}.requires/${SOFT_SVC}"
104SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'SOFT_FMT', 'OBMC_HOST_INSTANCES')}"
Dhruvaraj Subhashchandran16d57052017-08-04 16:09:15 -0500105
Brad Bishopfe88ee42019-06-07 15:21:01 -0400106do_replace_entity_default() {
107 # The in-repo provided default is tailored to testing the ipmid code.
108 # Replace it with a reasonable default for users.
109 cp entity.yaml ${S}/scripts/entity-example.yaml
110}
111
112do_patch_append() {
113 bb.build.exec_func('do_replace_entity_default', d)
114}
115
Dhruvaraj Subhashchandran16d57052017-08-04 16:09:15 -0500116#Collect all hardcoded sensor yamls from different recipes and
117#merge all of them with sensor.yaml.
118python do_merge_sensors () {
119 import subprocess
120
121 # TODO: Perform the merge in a temporary directory?
122 workdir = d.getVar('WORKDIR', True)
123 nativedir = d.getVar('STAGING_DIR_NATIVE', True)
124 sensorsdir = d.getVar('sensor_datadir', True)
125 sensorsdir = sensorsdir[1:]
126 sensorsdir = os.path.join(nativedir, sensorsdir)
127 cmd = []
128 cmd.append(os.path.join(workdir, 'merge_yamls.py'))
129 cmd.append(os.path.join(sensorsdir, 'sensor.yaml'))
130
131 if os.stat(os.path.join(sensorsdir, 'sensor.yaml')).st_size == 0:
132 return
133 fetch = bb.fetch2.Fetch([], d)
Kun Yie6bd58c2017-10-09 23:17:08 -0700134 override_urls = [url for url in fetch.urls if url.endswith('.hardcoded.yaml')]
Dhruvaraj Subhashchandran16d57052017-08-04 16:09:15 -0500135 for url in override_urls:
136 bb.debug(2, 'Overriding with source: ' + url)
137 local_base = os.path.basename(fetch.localpath(url))
138 filename = os.path.join(workdir, local_base)
139 cmd.append(filename)
140
141 # Invoke the script and don't catch any resulting exception.
142 subprocess.check_call(cmd)
143}
Andrew Jeffery381e1e92018-04-06 14:13:14 +0930144
Dhruvaraj Subhashchandran16d57052017-08-04 16:09:15 -0500145# python-pyyaml-native is installed by do_configure, so put this task after
146addtask merge_sensors after do_configure before do_compile