blob: 667ea1c8b1dca4370fbd96e84a5f33ce3ed1eb12 [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"
4
Brad Bishop7ee71462016-08-19 09:02:54 -05005RRECOMMENDS_${PN} += "packagegroup-obmc-ipmid-providers-libs"
Chris Austen213cd2a2015-10-24 19:34:11 -05006
Matthew Barth302592f2016-08-16 16:51:35 -05007inherit autotools pkgconfig
Patrick Ventured3dd0942017-12-22 14:36:07 -08008inherit obmc-phosphor-ipmiprovider-symlink
vishwabmc1bf499d2015-10-09 15:51:50 +05309inherit obmc-phosphor-license
Patrick Williamsf7714062015-10-15 15:20:20 -050010inherit obmc-phosphor-sdbus-service
Patrick Ventured3dd0942017-12-22 14:36:07 -080011inherit obmc-phosphor-systemd
Ratan Guptab92d0ec2017-03-06 17:05:11 +053012inherit phosphor-ipmi-host
13inherit pythonnative
vishwabmc1bf499d2015-10-09 15:51:50 +053014
Brad Bishop7f2ade02018-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 Ventured3dd0942017-12-22 14:36:07 -080022DEPENDS += "autoconf-archive-native"
David Cobbley1dc78fb2017-11-21 16:17:40 -080023DEPENDS += "nlohmann-json"
Patrick Ventured3dd0942017-12-22 14:36:07 -080024DEPENDS += "obmc-targets"
Brad Bishop7f2ade02018-01-26 22:11:36 -050025DEPENDS += "${@ipmi_whitelists(d)}"
Patrick Ventured3dd0942017-12-22 14:36:07 -080026DEPENDS += "phosphor-dbus-interfaces"
Adriana Kobylak17885c22017-02-17 08:21:42 -060027DEPENDS += "phosphor-logging"
Brad Bishop1122eb02016-10-05 20:10:23 -040028DEPENDS += "phosphor-mapper"
Ratan Gupta8dc22a92017-03-20 18:20:47 +053029DEPENDS += "sdbusplus"
Patrick Ventured3dd0942017-12-22 14:36:07 -080030DEPENDS += "sdbus++-native"
Tom Josephf2614f92017-05-08 11:49:10 +053031DEPENDS += "virtual/phosphor-ipmi-inventory-sel"
Marri Devender Rao5a0088c2017-07-26 02:11:32 -050032DEPENDS += "virtual/phosphor-ipmi-fru-merge-config"
Patrick Ventured3dd0942017-12-22 14:36:07 -080033DEPENDS += "virtual/phosphor-ipmi-sensor-inventory"
Patrick Ventureafdf9842018-01-18 18:01:29 -080034DEPENDS += "virtual/phosphor-ipmi-channel-config"
Ratan Guptab92d0ec2017-03-06 17:05:11 +053035
Andrew Jeffery381e1e92018-04-06 14:13:14 +093036VIRTUAL-RUNTIME_ipmi-config ?= "phosphor-ipmi-config"
37
Adriana Kobylak17885c22017-02-17 08:21:42 -060038RDEPENDS_${PN}-dev += "phosphor-logging"
Brad Bishop1122eb02016-10-05 20:10:23 -040039RDEPENDS_${PN}-dev += "phosphor-mapper-dev"
Milton D. Miller II611e3ff2016-03-04 15:29:29 -060040RDEPENDS_${PN} += "clear-once"
Brad Bishop9a701b42016-07-26 15:52:01 -040041RDEPENDS_${PN} += "libmapper"
Patrick Ventured3dd0942017-12-22 14:36:07 -080042RDEPENDS_${PN} += "network"
43RDEPENDS_${PN} += "phosphor-dbus-interfaces"
44RDEPENDS_${PN} += "phosphor-mapper"
Vishwanatha Subbanna78bc5422016-11-10 21:52:46 +053045RDEPENDS_${PN} += "phosphor-time-manager"
Patrick Ventured3dd0942017-12-22 14:36:07 -080046RDEPENDS_${PN} += "sdbusplus"
Andrew Jeffery381e1e92018-04-06 14:13:14 +093047RDEPENDS_${PN} += "${VIRTUAL-RUNTIME_ipmi-config}"
Vishwanatha Subbanna55c545a2017-06-12 13:09:10 +053048RDEPENDS_${PN} += "virtual/obmc-watchdog"
Ratan Gupta8dc22a92017-03-20 18:20:47 +053049
Richard Marian Thomaiyarfe5b8d22018-08-20 20:14:16 +053050inherit useradd
51
52USERADD_PACKAGES = "${PN}"
53# add ipmi group
54GROUPADD_PARAM_${PN} = "ipmi"
55
Vishwanatha Subbanna35318402017-03-31 14:41:11 +053056SYSTEMD_SERVICE_${PN} += "xyz.openbmc_project.Ipmi.Internal.SoftPowerOff.service phosphor-ipmi-host.service"
57
Andrew Geissler78e04542018-02-05 12:02:35 -080058RRECOMMENDS_${PN} += "${VIRTUAL-RUNTIME_obmc-settings-mgmt}"
59
vishwabmc1bf499d2015-10-09 15:51:50 +053060
Marri Devender Rao52a9f2d2017-06-08 00:47:54 -050061require ${PN}.inc
Chris Austen213cd2a2015-10-24 19:34:11 -050062
Tom Josephf07ae012017-02-20 12:01:43 +053063# Setup IPMI Whitelist Conf files
64WHITELIST_CONF = " \
Patrick Williamsf11f0152017-02-24 13:04:06 -060065 ${STAGING_DATADIR_NATIVE}/phosphor-ipmi-host/*.conf \
Tom Josephf07ae012017-02-20 12:01:43 +053066 ${S}/host-ipmid-whitelist.conf \
67 "
68EXTRA_OECONF = " \
69 WHITELIST_CONF="${WHITELIST_CONF}" \
Ratan Guptab92d0ec2017-03-06 17:05:11 +053070 SENSOR_YAML_GEN=${STAGING_DIR_NATIVE}${sensor_datadir}/sensor.yaml \
Tom Josephf2614f92017-05-08 11:49:10 +053071 INVSENSOR_YAML_GEN=${STAGING_DIR_NATIVE}${sensor_datadir}/invsensor.yaml \
Marri Devender Rao5a0088c2017-07-26 02:11:32 -050072 FRU_YAML_GEN=${STAGING_DIR_NATIVE}${config_datadir}/fru_config.yaml \
Patrick Ventureafdf9842018-01-18 18:01:29 -080073 CHANNEL_YAML_GEN=${STAGING_DIR_NATIVE}${sensor_datadir}/channel.yaml \
Marri Devender Rao9f32d172018-01-18 11:21:19 -060074 POWER_READING_SENSOR=${datadir}/ipmi-providers/power_reading.json\
Tom Josephf07ae012017-02-20 12:01:43 +053075 "
76
vishwabmc1bf499d2015-10-09 15:51:50 +053077S = "${WORKDIR}/git"
78
Andrew Jeffery381e1e92018-04-06 14:13:14 +093079SRC_URI += "file://merge_yamls.py "
Dhruvaraj Subhashchandran16d57052017-08-04 16:09:15 -050080
Vernon Mauery595c7382018-07-30 15:49:09 -070081HOSTIPMI_PROVIDER_LIBRARY += "libipmi20.so"
Tom Joseph40b4e3f2017-02-01 19:47:27 +053082HOSTIPMI_PROVIDER_LIBRARY += "libsysintfcmds.so"
83
Vernon Mauery595c7382018-07-30 15:49:09 -070084NETIPMI_PROVIDER_LIBRARY += "libipmi20.so"
Tom Joseph40b4e3f2017-02-01 19:47:27 +053085
Matthew Barth302592f2016-08-16 16:51:35 -050086FILES_${PN}_append = " ${libdir}/host-ipmid/lib*${SOLIBS}"
Patrick Ventured3dd0942017-12-22 14:36:07 -080087FILES_${PN}_append = " ${libdir}/ipmid-providers/lib*${SOLIBS}"
Tom Joseph40b4e3f2017-02-01 19:47:27 +053088FILES_${PN}_append = " ${libdir}/net-ipmid/lib*${SOLIBS}"
89FILES_${PN}-dev_append = " ${libdir}/ipmid-providers/lib*${SOLIBSDEV} ${libdir}/ipmid-providers/*.la"
Brad Bishop3b524cf2016-09-06 13:03:39 -040090
Andrew Geisslerafc510f2017-01-04 11:11:50 -060091# Soft Power Off
Andrew Geisslerd40db752017-05-11 16:16:27 -050092# install the soft power off service in the host shutdown target
93SOFT_SVC = "xyz.openbmc_project.Ipmi.Internal.SoftPowerOff.service"
94SOFT_TGTFMT = "obmc-host-shutdown@{0}.target"
95SOFT_FMT = "../${SOFT_SVC}:${SOFT_TGTFMT}.requires/${SOFT_SVC}"
96SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'SOFT_FMT', 'OBMC_HOST_INSTANCES')}"
Dhruvaraj Subhashchandran16d57052017-08-04 16:09:15 -050097
98#Collect all hardcoded sensor yamls from different recipes and
99#merge all of them with sensor.yaml.
100python do_merge_sensors () {
101 import subprocess
102
103 # TODO: Perform the merge in a temporary directory?
104 workdir = d.getVar('WORKDIR', True)
105 nativedir = d.getVar('STAGING_DIR_NATIVE', True)
106 sensorsdir = d.getVar('sensor_datadir', True)
107 sensorsdir = sensorsdir[1:]
108 sensorsdir = os.path.join(nativedir, sensorsdir)
109 cmd = []
110 cmd.append(os.path.join(workdir, 'merge_yamls.py'))
111 cmd.append(os.path.join(sensorsdir, 'sensor.yaml'))
112
113 if os.stat(os.path.join(sensorsdir, 'sensor.yaml')).st_size == 0:
114 return
115 fetch = bb.fetch2.Fetch([], d)
Kun Yie6bd58c2017-10-09 23:17:08 -0700116 override_urls = [url for url in fetch.urls if url.endswith('.hardcoded.yaml')]
Dhruvaraj Subhashchandran16d57052017-08-04 16:09:15 -0500117 for url in override_urls:
118 bb.debug(2, 'Overriding with source: ' + url)
119 local_base = os.path.basename(fetch.localpath(url))
120 filename = os.path.join(workdir, local_base)
121 cmd.append(filename)
122
123 # Invoke the script and don't catch any resulting exception.
124 subprocess.check_call(cmd)
125}
Andrew Jeffery381e1e92018-04-06 14:13:14 +0930126
Dhruvaraj Subhashchandran16d57052017-08-04 16:09:15 -0500127# python-pyyaml-native is installed by do_configure, so put this task after
128addtask merge_sensors after do_configure before do_compile