blob: 6bd95e86f55b599938f047a8f8db84cee427b825 [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}"
Brad Bishop75f03872018-11-03 09:41:57 -07005LICENSE = "Apache-2.0"
6LIC_FILES_CHKSUM = "file://LICENSE;md5=86d3f3a95c324c9479bd8986968f4327"
vishwabmc2ac6f932015-10-09 15:51:50 +05307
Brad Bishop8fffc162016-08-19 09:02:54 -05008RRECOMMENDS_${PN} += "packagegroup-obmc-ipmid-providers-libs"
Chris Austen9d3325a2015-10-24 19:34:11 -05009
Matthew Barth6b136a42016-08-16 16:51:35 -050010inherit autotools pkgconfig
Patrick Venturecb675692017-12-22 14:36:07 -080011inherit obmc-phosphor-ipmiprovider-symlink
Patrick Williams89b11a12015-10-15 15:20:20 -050012inherit obmc-phosphor-sdbus-service
Patrick Venturecb675692017-12-22 14:36:07 -080013inherit obmc-phosphor-systemd
Ratan Gupta3aa591f2017-03-06 17:05:11 +053014inherit phosphor-ipmi-host
15inherit pythonnative
vishwabmc2ac6f932015-10-09 15:51:50 +053016
Brad Bishop01e6b172018-01-26 22:11:36 -050017def ipmi_whitelists(d):
18 whitelists = d.getVar(
19 'VIRTUAL-RUNTIME_phosphor-ipmi-providers', True) or ''
20 whitelists = whitelists.split()
21 whitelists = [ '{}-whitelist-native'.format(x) for x in whitelists ]
22 return ' '.join(whitelists)
23
Patrick Venturecb675692017-12-22 14:36:07 -080024DEPENDS += "autoconf-archive-native"
David Cobbleyf9236522017-11-21 16:17:40 -080025DEPENDS += "nlohmann-json"
Andrew Geissler024c25d2020-01-14 14:21:24 -060026DEPENDS += "phosphor-state-manager"
Brad Bishop01e6b172018-01-26 22:11:36 -050027DEPENDS += "${@ipmi_whitelists(d)}"
Patrick Venturecb675692017-12-22 14:36:07 -080028DEPENDS += "phosphor-dbus-interfaces"
Adriana Kobylakc009f892017-02-17 08:21:42 -060029DEPENDS += "phosphor-logging"
Brad Bishop12e3d602016-10-05 20:10:23 -040030DEPENDS += "phosphor-mapper"
Ratan Guptaca8fd9d2017-03-20 18:20:47 +053031DEPENDS += "sdbusplus"
Patrick Venturecb675692017-12-22 14:36:07 -080032DEPENDS += "sdbus++-native"
Tom Joseph4d4c8492019-02-04 03:54:06 -060033DEPENDS += "virtual/phosphor-ipmi-inventory-sel"
Marri Devender Rao53c55032017-07-26 02:11:32 -050034DEPENDS += "virtual/phosphor-ipmi-fru-merge-config"
Patrick Venturecb675692017-12-22 14:36:07 -080035DEPENDS += "virtual/phosphor-ipmi-sensor-inventory"
Andrew Geissler126e7842018-09-25 19:50:20 +000036DEPENDS += "boost"
Patrick Venture34bc61e2018-11-07 17:48:53 -080037DEPENDS += "sdeventplus"
Ratan Gupta3aa591f2017-03-06 17:05:11 +053038
Andrew Jeffery1b77f28e2018-04-06 14:13:14 +093039VIRTUAL-RUNTIME_ipmi-config ?= "phosphor-ipmi-config"
40
Adriana Kobylakc009f892017-02-17 08:21:42 -060041RDEPENDS_${PN}-dev += "phosphor-logging"
Brad Bishop12e3d602016-10-05 20:10:23 -040042RDEPENDS_${PN}-dev += "phosphor-mapper-dev"
Milton D. Miller IIb8c51742016-03-04 15:29:29 -060043RDEPENDS_${PN} += "clear-once"
Patrick Venture0995aac2019-03-28 09:09:13 -070044RDEPENDS_${PN} += "phosphor-network"
Vishwanatha Subbannab1c39e02016-11-10 21:52:46 +053045RDEPENDS_${PN} += "phosphor-time-manager"
Andrew Jeffery1b77f28e2018-04-06 14:13:14 +093046RDEPENDS_${PN} += "${VIRTUAL-RUNTIME_ipmi-config}"
Vishwanatha Subbanna2d78dd02017-06-12 13:09:10 +053047RDEPENDS_${PN} += "virtual/obmc-watchdog"
Patrick Venturef2f4fb22019-04-30 10:26:34 -070048RDEPENDS_${PN} += "${VIRTUAL-RUNTIME_obmc-bmc-state-manager}"
Patrick Ventureebece09d2019-05-03 07:51:58 -070049RDEPENDS_${PN} += "${VIRTUAL-RUNTIME_obmc-bmc-version}"
Patrick Ventureadf1a332019-05-03 07:53:57 -070050RDEPENDS_${PN} += "${VIRTUAL-RUNTIME_obmc-bmc-updater}"
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 = " \
Ratan Gupta3aa591f2017-03-06 17:05:11 +053071 SENSOR_YAML_GEN=${STAGING_DIR_NATIVE}${sensor_datadir}/sensor.yaml \
Tom Joseph4d4c8492019-02-04 03:54:06 -060072 INVSENSOR_YAML_GEN=${STAGING_DIR_NATIVE}${sensor_datadir}/invsensor.yaml \
Marri Devender Rao53c55032017-07-26 02:11:32 -050073 FRU_YAML_GEN=${STAGING_DIR_NATIVE}${config_datadir}/fru_config.yaml \
Tom Joseph1562bbc2017-02-20 12:01:43 +053074 "
Brad Bishopfee41872019-06-09 22:57:35 -040075EXTRA_OECONF_append = " \
76 WHITELIST_CONF="${WHITELIST_CONF}" \
77 "
Tom Joseph1562bbc2017-02-20 12:01:43 +053078
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"
William A. Kennington III4b04e1f2018-12-19 14:53:22 -080085HOSTIPMI_PROVIDER_LIBRARY += "libusercmds.so"
Tom Josephdcdc8ea2017-02-01 19:47:27 +053086
Vernon Mauery91944682018-07-30 15:49:09 -070087NETIPMI_PROVIDER_LIBRARY += "libipmi20.so"
William A. Kennington III4b04e1f2018-12-19 14:53:22 -080088NETIPMI_PROVIDER_LIBRARY += "libusercmds.so"
Tom Josephdcdc8ea2017-02-01 19:47:27 +053089
Matthew Barth6b136a42016-08-16 16:51:35 -050090FILES_${PN}_append = " ${libdir}/host-ipmid/lib*${SOLIBS}"
Patrick Venturecb675692017-12-22 14:36:07 -080091FILES_${PN}_append = " ${libdir}/ipmid-providers/lib*${SOLIBS}"
Tom Josephdcdc8ea2017-02-01 19:47:27 +053092FILES_${PN}_append = " ${libdir}/net-ipmid/lib*${SOLIBS}"
93FILES_${PN}-dev_append = " ${libdir}/ipmid-providers/lib*${SOLIBSDEV} ${libdir}/ipmid-providers/*.la"
Brad Bishop6371e702016-09-06 13:03:39 -040094
Andrew Geissler41e3cb32017-01-04 11:11:50 -060095# Soft Power Off
Andrew Geisslerecfa6622017-05-11 16:16:27 -050096# install the soft power off service in the host shutdown target
97SOFT_SVC = "xyz.openbmc_project.Ipmi.Internal.SoftPowerOff.service"
98SOFT_TGTFMT = "obmc-host-shutdown@{0}.target"
99SOFT_FMT = "../${SOFT_SVC}:${SOFT_TGTFMT}.requires/${SOFT_SVC}"
100SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'SOFT_FMT', 'OBMC_HOST_INSTANCES')}"
Dhruvaraj Subhashchandran12352762017-08-04 16:09:15 -0500101
102#Collect all hardcoded sensor yamls from different recipes and
103#merge all of them with sensor.yaml.
104python do_merge_sensors () {
105 import subprocess
106
107 # TODO: Perform the merge in a temporary directory?
108 workdir = d.getVar('WORKDIR', True)
109 nativedir = d.getVar('STAGING_DIR_NATIVE', True)
110 sensorsdir = d.getVar('sensor_datadir', True)
111 sensorsdir = sensorsdir[1:]
112 sensorsdir = os.path.join(nativedir, sensorsdir)
113 cmd = []
114 cmd.append(os.path.join(workdir, 'merge_yamls.py'))
115 cmd.append(os.path.join(sensorsdir, 'sensor.yaml'))
116
117 if os.stat(os.path.join(sensorsdir, 'sensor.yaml')).st_size == 0:
118 return
119 fetch = bb.fetch2.Fetch([], d)
Kun Yicdc3b232017-10-09 23:17:08 -0700120 override_urls = [url for url in fetch.urls if url.endswith('.hardcoded.yaml')]
Dhruvaraj Subhashchandran12352762017-08-04 16:09:15 -0500121 for url in override_urls:
122 bb.debug(2, 'Overriding with source: ' + url)
123 local_base = os.path.basename(fetch.localpath(url))
124 filename = os.path.join(workdir, local_base)
125 cmd.append(filename)
126
127 # Invoke the script and don't catch any resulting exception.
128 subprocess.check_call(cmd)
129}
Andrew Jeffery1b77f28e2018-04-06 14:13:14 +0930130
Dhruvaraj Subhashchandran12352762017-08-04 16:09:15 -0500131# python-pyyaml-native is installed by do_configure, so put this task after
132addtask merge_sensors after do_configure before do_compile