blob: 1a1199f7352678f8bc83fb52400ef20a11279ea6 [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
Patrick Williams12fc9392021-08-06 09:16:53 -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
Andrew Geissler04b85e92020-03-30 14:31:19 +000015inherit python3native
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
William A. Kennington III10f19dc2021-04-29 13:59:48 -070024PACKAGECONFIG ??= ""
25PACKAGECONFIG[dynamic-sensors] = "--enable-dynamic-sensors,--disable-dynamic-sensors"
26
Patrick Venturecb675692017-12-22 14:36:07 -080027DEPENDS += "autoconf-archive-native"
David Cobbleyf9236522017-11-21 16:17:40 -080028DEPENDS += "nlohmann-json"
Andrew Geissler024c25d2020-01-14 14:21:24 -060029DEPENDS += "phosphor-state-manager"
Brad Bishop01e6b172018-01-26 22:11:36 -050030DEPENDS += "${@ipmi_whitelists(d)}"
Patrick Venturecb675692017-12-22 14:36:07 -080031DEPENDS += "phosphor-dbus-interfaces"
Adriana Kobylakc009f892017-02-17 08:21:42 -060032DEPENDS += "phosphor-logging"
Brad Bishop12e3d602016-10-05 20:10:23 -040033DEPENDS += "phosphor-mapper"
Ratan Guptaca8fd9d2017-03-20 18:20:47 +053034DEPENDS += "sdbusplus"
Patrick Williams4b32c9a2020-03-31 16:43:15 -050035DEPENDS += "${PYTHON_PN}-sdbus++-native"
Tom Joseph4d4c8492019-02-04 03:54:06 -060036DEPENDS += "virtual/phosphor-ipmi-inventory-sel"
Marri Devender Rao53c55032017-07-26 02:11:32 -050037DEPENDS += "virtual/phosphor-ipmi-fru-merge-config"
Patrick Venturecb675692017-12-22 14:36:07 -080038DEPENDS += "virtual/phosphor-ipmi-sensor-inventory"
Andrew Geissler126e7842018-09-25 19:50:20 +000039DEPENDS += "boost"
Patrick Venture34bc61e2018-11-07 17:48:53 -080040DEPENDS += "sdeventplus"
Tom Josephf4db3792020-03-05 10:08:45 -060041DEPENDS += "${PYTHON_PN}-native"
42DEPENDS += "${PYTHON_PN}-pyyaml-native"
43DEPENDS += "${PYTHON_PN}-mako-native"
Ratan Gupta3aa591f2017-03-06 17:05:11 +053044
Andrew Jeffery1b77f28e2018-04-06 14:13:14 +093045VIRTUAL-RUNTIME_ipmi-config ?= "phosphor-ipmi-config"
46
Patrick Williams12fc9392021-08-06 09:16:53 -050047RDEPENDS:${PN}-dev += "phosphor-logging"
48RDEPENDS:${PN}-dev += "phosphor-mapper-dev"
49RDEPENDS:${PN} += "clear-once"
50RDEPENDS:${PN} += "phosphor-network"
51RDEPENDS:${PN} += "phosphor-time-manager"
52RDEPENDS:${PN} += "${VIRTUAL-RUNTIME_ipmi-config}"
53RDEPENDS:${PN} += "virtual/obmc-watchdog"
54RDEPENDS:${PN} += "${VIRTUAL-RUNTIME_obmc-bmc-state-manager}"
55RDEPENDS:${PN} += "${VIRTUAL-RUNTIME_obmc-bmc-version}"
56RDEPENDS:${PN} += "${VIRTUAL-RUNTIME_obmc-bmc-updater}"
Ratan Guptaca8fd9d2017-03-20 18:20:47 +053057
Richard Marian Thomaiyar8ac94ce2018-08-20 20:14:16 +053058inherit useradd
59
60USERADD_PACKAGES = "${PN}"
61# add ipmi group
Patrick Williams12fc9392021-08-06 09:16:53 -050062GROUPADD_PARAM:${PN} = "ipmi"
Richard Marian Thomaiyar8ac94ce2018-08-20 20:14:16 +053063
Patrick Williams12fc9392021-08-06 09:16:53 -050064SYSTEMD_SERVICE:${PN} += "xyz.openbmc_project.Ipmi.Internal.SoftPowerOff.service phosphor-ipmi-host.service"
Vishwanatha Subbannacaff3fa2017-03-31 14:41:11 +053065
Patrick Williams12fc9392021-08-06 09:16:53 -050066RRECOMMENDS:${PN} += "phosphor-settings-manager"
Andrew Geisslera36894f2018-02-05 12:02:35 -080067
vishwabmc2ac6f932015-10-09 15:51:50 +053068
Patrick Williamsfb700fd2020-04-03 15:48:30 -050069require ${BPN}.inc
Chris Austen9d3325a2015-10-24 19:34:11 -050070
Tom Joseph1562bbc2017-02-20 12:01:43 +053071# Setup IPMI Whitelist Conf files
72WHITELIST_CONF = " \
Patrick Williams43b61b72017-02-24 13:04:06 -060073 ${STAGING_DATADIR_NATIVE}/phosphor-ipmi-host/*.conf \
Tom Joseph1562bbc2017-02-20 12:01:43 +053074 ${S}/host-ipmid-whitelist.conf \
75 "
76EXTRA_OECONF = " \
Ratan Gupta3aa591f2017-03-06 17:05:11 +053077 SENSOR_YAML_GEN=${STAGING_DIR_NATIVE}${sensor_datadir}/sensor.yaml \
Tom Joseph4d4c8492019-02-04 03:54:06 -060078 INVSENSOR_YAML_GEN=${STAGING_DIR_NATIVE}${sensor_datadir}/invsensor.yaml \
Marri Devender Rao53c55032017-07-26 02:11:32 -050079 FRU_YAML_GEN=${STAGING_DIR_NATIVE}${config_datadir}/fru_config.yaml \
Tom Joseph1562bbc2017-02-20 12:01:43 +053080 "
Patrick Williams12fc9392021-08-06 09:16:53 -050081EXTRA_OECONF:append = " \
Brad Bishopfee41872019-06-09 22:57:35 -040082 WHITELIST_CONF="${WHITELIST_CONF}" \
83 "
Tom Joseph1562bbc2017-02-20 12:01:43 +053084
vishwabmc2ac6f932015-10-09 15:51:50 +053085S = "${WORKDIR}/git"
86
Andrew Jeffery1b77f28e2018-04-06 14:13:14 +093087SRC_URI += "file://merge_yamls.py "
Dhruvaraj Subhashchandran12352762017-08-04 16:09:15 -050088
Vernon Mauery91944682018-07-30 15:49:09 -070089HOSTIPMI_PROVIDER_LIBRARY += "libipmi20.so"
Tom Josephdcdc8ea2017-02-01 19:47:27 +053090HOSTIPMI_PROVIDER_LIBRARY += "libsysintfcmds.so"
William A. Kennington III4b04e1f2018-12-19 14:53:22 -080091HOSTIPMI_PROVIDER_LIBRARY += "libusercmds.so"
Tom Josephdcdc8ea2017-02-01 19:47:27 +053092
Vernon Mauery91944682018-07-30 15:49:09 -070093NETIPMI_PROVIDER_LIBRARY += "libipmi20.so"
William A. Kennington III4b04e1f2018-12-19 14:53:22 -080094NETIPMI_PROVIDER_LIBRARY += "libusercmds.so"
Tom Josephdcdc8ea2017-02-01 19:47:27 +053095
Patrick Williams12fc9392021-08-06 09:16:53 -050096FILES:${PN}:append = " ${libdir}/host-ipmid/lib*${SOLIBS}"
97FILES:${PN}:append = " ${libdir}/ipmid-providers/lib*${SOLIBS}"
98FILES:${PN}:append = " ${libdir}/net-ipmid/lib*${SOLIBS}"
99FILES:${PN}-dev:append = " ${libdir}/ipmid-providers/lib*${SOLIBSDEV} ${libdir}/ipmid-providers/*.la"
Brad Bishop6371e702016-09-06 13:03:39 -0400100
Andrew Geissler41e3cb32017-01-04 11:11:50 -0600101# Soft Power Off
Andrew Geisslerecfa6622017-05-11 16:16:27 -0500102# install the soft power off service in the host shutdown target
103SOFT_SVC = "xyz.openbmc_project.Ipmi.Internal.SoftPowerOff.service"
104SOFT_TGTFMT = "obmc-host-shutdown@{0}.target"
105SOFT_FMT = "../${SOFT_SVC}:${SOFT_TGTFMT}.requires/${SOFT_SVC}"
106SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'SOFT_FMT', 'OBMC_HOST_INSTANCES')}"
Dhruvaraj Subhashchandran12352762017-08-04 16:09:15 -0500107
108#Collect all hardcoded sensor yamls from different recipes and
109#merge all of them with sensor.yaml.
110python do_merge_sensors () {
111 import subprocess
112
113 # TODO: Perform the merge in a temporary directory?
114 workdir = d.getVar('WORKDIR', True)
115 nativedir = d.getVar('STAGING_DIR_NATIVE', True)
116 sensorsdir = d.getVar('sensor_datadir', True)
117 sensorsdir = sensorsdir[1:]
118 sensorsdir = os.path.join(nativedir, sensorsdir)
119 cmd = []
120 cmd.append(os.path.join(workdir, 'merge_yamls.py'))
121 cmd.append(os.path.join(sensorsdir, 'sensor.yaml'))
122
123 if os.stat(os.path.join(sensorsdir, 'sensor.yaml')).st_size == 0:
124 return
125 fetch = bb.fetch2.Fetch([], d)
Kun Yicdc3b232017-10-09 23:17:08 -0700126 override_urls = [url for url in fetch.urls if url.endswith('.hardcoded.yaml')]
Dhruvaraj Subhashchandran12352762017-08-04 16:09:15 -0500127 for url in override_urls:
128 bb.debug(2, 'Overriding with source: ' + url)
129 local_base = os.path.basename(fetch.localpath(url))
130 filename = os.path.join(workdir, local_base)
131 cmd.append(filename)
132
133 # Invoke the script and don't catch any resulting exception.
134 subprocess.check_call(cmd)
135}
Andrew Jeffery1b77f28e2018-04-06 14:13:14 +0930136
Dhruvaraj Subhashchandran12352762017-08-04 16:09:15 -0500137# python-pyyaml-native is installed by do_configure, so put this task after
138addtask merge_sensors after do_configure before do_compile