blob: fe32be20ded390d99e6b89239d4b051dfacee485 [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
Patrick Ventured3dd0942017-12-22 14:36:07 -080015DEPENDS += "autoconf-archive-native"
David Cobbley1dc78fb2017-11-21 16:17:40 -080016DEPENDS += "nlohmann-json"
Patrick Ventured3dd0942017-12-22 14:36:07 -080017DEPENDS += "obmc-targets"
18DEPENDS += "packagegroup-obmc-ipmid-providers"
19DEPENDS += "phosphor-dbus-interfaces"
Adriana Kobylak17885c22017-02-17 08:21:42 -060020DEPENDS += "phosphor-logging"
Brad Bishop1122eb02016-10-05 20:10:23 -040021DEPENDS += "phosphor-mapper"
Ratan Gupta8dc22a92017-03-20 18:20:47 +053022DEPENDS += "sdbusplus"
Patrick Ventured3dd0942017-12-22 14:36:07 -080023DEPENDS += "sdbus++-native"
Tom Josephf2614f92017-05-08 11:49:10 +053024DEPENDS += "virtual/phosphor-ipmi-inventory-sel"
Marri Devender Rao5a0088c2017-07-26 02:11:32 -050025DEPENDS += "virtual/phosphor-ipmi-fru-merge-config"
Patrick Ventured3dd0942017-12-22 14:36:07 -080026DEPENDS += "virtual/phosphor-ipmi-sensor-inventory"
Patrick Ventureafdf9842018-01-18 18:01:29 -080027DEPENDS += "virtual/phosphor-ipmi-channel-config"
Ratan Guptab92d0ec2017-03-06 17:05:11 +053028
Adriana Kobylak17885c22017-02-17 08:21:42 -060029RDEPENDS_${PN}-dev += "phosphor-logging"
Brad Bishop1122eb02016-10-05 20:10:23 -040030RDEPENDS_${PN}-dev += "phosphor-mapper-dev"
Milton D. Miller II611e3ff2016-03-04 15:29:29 -060031RDEPENDS_${PN} += "clear-once"
Brad Bishop9a701b42016-07-26 15:52:01 -040032RDEPENDS_${PN} += "libmapper"
Patrick Ventured3dd0942017-12-22 14:36:07 -080033RDEPENDS_${PN} += "network"
34RDEPENDS_${PN} += "phosphor-dbus-interfaces"
35RDEPENDS_${PN} += "phosphor-mapper"
Vishwanatha Subbanna78bc5422016-11-10 21:52:46 +053036RDEPENDS_${PN} += "phosphor-time-manager"
Patrick Ventured3dd0942017-12-22 14:36:07 -080037RDEPENDS_${PN} += "sdbusplus"
Vishwanatha Subbanna55c545a2017-06-12 13:09:10 +053038RDEPENDS_${PN} += "virtual/obmc-watchdog"
Ratan Gupta8dc22a92017-03-20 18:20:47 +053039
Vishwanatha Subbanna35318402017-03-31 14:41:11 +053040SYSTEMD_SERVICE_${PN} += "xyz.openbmc_project.Ipmi.Internal.SoftPowerOff.service phosphor-ipmi-host.service"
41
Adriana Kobylak79841ae2016-08-25 10:07:34 -050042RRECOMMENDS_${PN} += "virtual-obmc-settings-mgmt"
vishwabmc1bf499d2015-10-09 15:51:50 +053043
Marri Devender Rao52a9f2d2017-06-08 00:47:54 -050044require ${PN}.inc
Chris Austen213cd2a2015-10-24 19:34:11 -050045
Tom Josephf07ae012017-02-20 12:01:43 +053046# Setup IPMI Whitelist Conf files
47WHITELIST_CONF = " \
Patrick Williamsf11f0152017-02-24 13:04:06 -060048 ${STAGING_DATADIR_NATIVE}/phosphor-ipmi-host/*.conf \
Tom Josephf07ae012017-02-20 12:01:43 +053049 ${S}/host-ipmid-whitelist.conf \
50 "
51EXTRA_OECONF = " \
52 WHITELIST_CONF="${WHITELIST_CONF}" \
Ratan Guptab92d0ec2017-03-06 17:05:11 +053053 SENSOR_YAML_GEN=${STAGING_DIR_NATIVE}${sensor_datadir}/sensor.yaml \
Tom Josephf2614f92017-05-08 11:49:10 +053054 INVSENSOR_YAML_GEN=${STAGING_DIR_NATIVE}${sensor_datadir}/invsensor.yaml \
Marri Devender Rao5a0088c2017-07-26 02:11:32 -050055 FRU_YAML_GEN=${STAGING_DIR_NATIVE}${config_datadir}/fru_config.yaml \
Patrick Ventureafdf9842018-01-18 18:01:29 -080056 CHANNEL_YAML_GEN=${STAGING_DIR_NATIVE}${sensor_datadir}/channel.yaml \
Marri Devender Rao9f32d172018-01-18 11:21:19 -060057 POWER_READING_SENSOR=${datadir}/ipmi-providers/power_reading.json\
Tom Josephf07ae012017-02-20 12:01:43 +053058 "
59
vishwabmc1bf499d2015-10-09 15:51:50 +053060S = "${WORKDIR}/git"
61
David Cobbley1dc78fb2017-11-21 16:17:40 -080062SRC_URI += "file://merge_yamls.py \
63 file://dev_id.json \
Dhruvaraj Subhashchandran93c03222018-01-09 03:44:39 -060064 file://dcmi_cap.json \
Marri Devender Rao9f32d172018-01-18 11:21:19 -060065 file://power_reading.json \
Deepak Kodihallide4bb832018-01-24 05:35:11 -060066 file://dcmi_temp_readings.json \
David Cobbley1dc78fb2017-11-21 16:17:40 -080067 "
Dhruvaraj Subhashchandran16d57052017-08-04 16:09:15 -050068
Tom Joseph40b4e3f2017-02-01 19:47:27 +053069HOSTIPMI_PROVIDER_LIBRARY += "libapphandler.so"
Tom Joseph40b4e3f2017-02-01 19:47:27 +053070HOSTIPMI_PROVIDER_LIBRARY += "libsysintfcmds.so"
71
72NETIPMI_PROVIDER_LIBRARY += "libapphandler.so"
73
Matthew Barth302592f2016-08-16 16:51:35 -050074FILES_${PN}_append = " ${libdir}/host-ipmid/lib*${SOLIBS}"
Patrick Ventured3dd0942017-12-22 14:36:07 -080075FILES_${PN}_append = " ${libdir}/ipmid-providers/lib*${SOLIBS}"
Tom Joseph40b4e3f2017-02-01 19:47:27 +053076FILES_${PN}_append = " ${libdir}/net-ipmid/lib*${SOLIBS}"
David Cobbley1dc78fb2017-11-21 16:17:40 -080077FILES_${PN}_append = " ${datadir}/ipmi-providers/dev_id.json"
Dhruvaraj Subhashchandran93c03222018-01-09 03:44:39 -060078FILES_${PN}_append = " ${datadir}/ipmi-providers/dcmi_cap.json"
Marri Devender Rao9f32d172018-01-18 11:21:19 -060079FILES_${PN}_append = " ${datadir}/ipmi-providers/power_reading.json"
Deepak Kodihallide4bb832018-01-24 05:35:11 -060080FILES_${PN}_append = " ${datadir}/ipmi-providers/dcmi_temp_readings.json"
Tom Joseph40b4e3f2017-02-01 19:47:27 +053081FILES_${PN}-dev_append = " ${libdir}/ipmid-providers/lib*${SOLIBSDEV} ${libdir}/ipmid-providers/*.la"
Brad Bishop3b524cf2016-09-06 13:03:39 -040082
Andrew Geisslerafc510f2017-01-04 11:11:50 -060083# Soft Power Off
Andrew Geisslerd40db752017-05-11 16:16:27 -050084# install the soft power off service in the host shutdown target
85SOFT_SVC = "xyz.openbmc_project.Ipmi.Internal.SoftPowerOff.service"
86SOFT_TGTFMT = "obmc-host-shutdown@{0}.target"
87SOFT_FMT = "../${SOFT_SVC}:${SOFT_TGTFMT}.requires/${SOFT_SVC}"
88SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'SOFT_FMT', 'OBMC_HOST_INSTANCES')}"
Dhruvaraj Subhashchandran16d57052017-08-04 16:09:15 -050089
90#Collect all hardcoded sensor yamls from different recipes and
91#merge all of them with sensor.yaml.
92python do_merge_sensors () {
93 import subprocess
94
95 # TODO: Perform the merge in a temporary directory?
96 workdir = d.getVar('WORKDIR', True)
97 nativedir = d.getVar('STAGING_DIR_NATIVE', True)
98 sensorsdir = d.getVar('sensor_datadir', True)
99 sensorsdir = sensorsdir[1:]
100 sensorsdir = os.path.join(nativedir, sensorsdir)
101 cmd = []
102 cmd.append(os.path.join(workdir, 'merge_yamls.py'))
103 cmd.append(os.path.join(sensorsdir, 'sensor.yaml'))
104
105 if os.stat(os.path.join(sensorsdir, 'sensor.yaml')).st_size == 0:
106 return
107 fetch = bb.fetch2.Fetch([], d)
Kun Yie6bd58c2017-10-09 23:17:08 -0700108 override_urls = [url for url in fetch.urls if url.endswith('.hardcoded.yaml')]
Dhruvaraj Subhashchandran16d57052017-08-04 16:09:15 -0500109 for url in override_urls:
110 bb.debug(2, 'Overriding with source: ' + url)
111 local_base = os.path.basename(fetch.localpath(url))
112 filename = os.path.join(workdir, local_base)
113 cmd.append(filename)
114
115 # Invoke the script and don't catch any resulting exception.
116 subprocess.check_call(cmd)
117}
David Cobbley1dc78fb2017-11-21 16:17:40 -0800118do_install_append(){
119 install -d ${D}${datadir}/ipmi-providers
120 install -m 0644 -D ${WORKDIR}/dev_id.json \
121 ${D}${datadir}/ipmi-providers/dev_id.json
Dhruvaraj Subhashchandran93c03222018-01-09 03:44:39 -0600122 install -m 0644 -D ${WORKDIR}/dcmi_cap.json \
123 ${D}${datadir}/ipmi-providers/dcmi_cap.json
Marri Devender Rao9f32d172018-01-18 11:21:19 -0600124 install -m 0644 -D ${WORKDIR}/power_reading.json \
125 ${D}${datadir}/ipmi-providers/power_reading.json
Deepak Kodihallide4bb832018-01-24 05:35:11 -0600126 install -m 0644 -D ${WORKDIR}/dcmi_temp_readings.json \
127 ${D}${datadir}/ipmi-providers/dcmi_temp_readings.json
David Cobbley1dc78fb2017-11-21 16:17:40 -0800128}
Dhruvaraj Subhashchandran16d57052017-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