blob: 583c0b12c0f1b33722e22f29c2872b0747d07eb3 [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"
4
Brad Bishop8fffc162016-08-19 09:02:54 -05005RRECOMMENDS_${PN} += "packagegroup-obmc-ipmid-providers-libs"
Chris Austen9d3325a2015-10-24 19:34:11 -05006
Matthew Barth6b136a42016-08-16 16:51:35 -05007inherit autotools pkgconfig
Patrick Venturecb675692017-12-22 14:36:07 -08008inherit obmc-phosphor-ipmiprovider-symlink
vishwabmc2ac6f932015-10-09 15:51:50 +05309inherit obmc-phosphor-license
Patrick Williams89b11a12015-10-15 15:20:20 -050010inherit obmc-phosphor-sdbus-service
Patrick Venturecb675692017-12-22 14:36:07 -080011inherit obmc-phosphor-systemd
Ratan Gupta3aa591f2017-03-06 17:05:11 +053012inherit phosphor-ipmi-host
13inherit pythonnative
vishwabmc2ac6f932015-10-09 15:51:50 +053014
Patrick Venturecb675692017-12-22 14:36:07 -080015DEPENDS += "autoconf-archive-native"
David Cobbleyf9236522017-11-21 16:17:40 -080016DEPENDS += "nlohmann-json"
Patrick Venturecb675692017-12-22 14:36:07 -080017DEPENDS += "obmc-targets"
18DEPENDS += "packagegroup-obmc-ipmid-providers"
19DEPENDS += "phosphor-dbus-interfaces"
Adriana Kobylakc009f892017-02-17 08:21:42 -060020DEPENDS += "phosphor-logging"
Brad Bishop12e3d602016-10-05 20:10:23 -040021DEPENDS += "phosphor-mapper"
Ratan Guptaca8fd9d2017-03-20 18:20:47 +053022DEPENDS += "sdbusplus"
Patrick Venturecb675692017-12-22 14:36:07 -080023DEPENDS += "sdbus++-native"
Tom Josephcf7e8492017-05-08 11:49:10 +053024DEPENDS += "virtual/phosphor-ipmi-inventory-sel"
Marri Devender Rao53c55032017-07-26 02:11:32 -050025DEPENDS += "virtual/phosphor-ipmi-fru-merge-config"
Patrick Venturecb675692017-12-22 14:36:07 -080026DEPENDS += "virtual/phosphor-ipmi-sensor-inventory"
Ratan Gupta3aa591f2017-03-06 17:05:11 +053027
Adriana Kobylakc009f892017-02-17 08:21:42 -060028RDEPENDS_${PN}-dev += "phosphor-logging"
Brad Bishop12e3d602016-10-05 20:10:23 -040029RDEPENDS_${PN}-dev += "phosphor-mapper-dev"
Milton D. Miller IIb8c51742016-03-04 15:29:29 -060030RDEPENDS_${PN} += "clear-once"
Brad Bishopea4022a2016-07-26 15:52:01 -040031RDEPENDS_${PN} += "libmapper"
Patrick Venturecb675692017-12-22 14:36:07 -080032RDEPENDS_${PN} += "network"
33RDEPENDS_${PN} += "phosphor-dbus-interfaces"
34RDEPENDS_${PN} += "phosphor-mapper"
Vishwanatha Subbannab1c39e02016-11-10 21:52:46 +053035RDEPENDS_${PN} += "phosphor-time-manager"
Patrick Venturecb675692017-12-22 14:36:07 -080036RDEPENDS_${PN} += "sdbusplus"
Vishwanatha Subbanna2d78dd02017-06-12 13:09:10 +053037RDEPENDS_${PN} += "virtual/obmc-watchdog"
Ratan Guptaca8fd9d2017-03-20 18:20:47 +053038
Vishwanatha Subbannacaff3fa2017-03-31 14:41:11 +053039SYSTEMD_SERVICE_${PN} += "xyz.openbmc_project.Ipmi.Internal.SoftPowerOff.service phosphor-ipmi-host.service"
40
Adriana Kobylak1ffadd92016-08-25 10:07:34 -050041RRECOMMENDS_${PN} += "virtual-obmc-settings-mgmt"
vishwabmc2ac6f932015-10-09 15:51:50 +053042
Marri Devender Rao2ba514e2017-06-08 00:47:54 -050043require ${PN}.inc
Chris Austen9d3325a2015-10-24 19:34:11 -050044
Tom Joseph1562bbc2017-02-20 12:01:43 +053045# Setup IPMI Whitelist Conf files
46WHITELIST_CONF = " \
Patrick Williams43b61b72017-02-24 13:04:06 -060047 ${STAGING_DATADIR_NATIVE}/phosphor-ipmi-host/*.conf \
Tom Joseph1562bbc2017-02-20 12:01:43 +053048 ${S}/host-ipmid-whitelist.conf \
49 "
50EXTRA_OECONF = " \
51 WHITELIST_CONF="${WHITELIST_CONF}" \
Ratan Gupta3aa591f2017-03-06 17:05:11 +053052 SENSOR_YAML_GEN=${STAGING_DIR_NATIVE}${sensor_datadir}/sensor.yaml \
Tom Josephcf7e8492017-05-08 11:49:10 +053053 INVSENSOR_YAML_GEN=${STAGING_DIR_NATIVE}${sensor_datadir}/invsensor.yaml \
Marri Devender Rao53c55032017-07-26 02:11:32 -050054 FRU_YAML_GEN=${STAGING_DIR_NATIVE}${config_datadir}/fru_config.yaml \
Tom Joseph1562bbc2017-02-20 12:01:43 +053055 "
56
vishwabmc2ac6f932015-10-09 15:51:50 +053057S = "${WORKDIR}/git"
58
David Cobbleyf9236522017-11-21 16:17:40 -080059SRC_URI += "file://merge_yamls.py \
60 file://dev_id.json \
61 "
Dhruvaraj Subhashchandran12352762017-08-04 16:09:15 -050062
Tom Josephdcdc8ea2017-02-01 19:47:27 +053063HOSTIPMI_PROVIDER_LIBRARY += "libapphandler.so"
Tom Josephdcdc8ea2017-02-01 19:47:27 +053064HOSTIPMI_PROVIDER_LIBRARY += "libsysintfcmds.so"
65
66NETIPMI_PROVIDER_LIBRARY += "libapphandler.so"
67
Matthew Barth6b136a42016-08-16 16:51:35 -050068FILES_${PN}_append = " ${libdir}/host-ipmid/lib*${SOLIBS}"
Patrick Venturecb675692017-12-22 14:36:07 -080069FILES_${PN}_append = " ${libdir}/ipmid-providers/lib*${SOLIBS}"
Tom Josephdcdc8ea2017-02-01 19:47:27 +053070FILES_${PN}_append = " ${libdir}/net-ipmid/lib*${SOLIBS}"
David Cobbleyf9236522017-11-21 16:17:40 -080071FILES_${PN}_append = " ${datadir}/ipmi-providers/dev_id.json"
Tom Josephdcdc8ea2017-02-01 19:47:27 +053072FILES_${PN}-dev_append = " ${libdir}/ipmid-providers/lib*${SOLIBSDEV} ${libdir}/ipmid-providers/*.la"
Brad Bishop6371e702016-09-06 13:03:39 -040073
Andrew Geissler41e3cb32017-01-04 11:11:50 -060074# Soft Power Off
Andrew Geisslerecfa6622017-05-11 16:16:27 -050075# install the soft power off service in the host shutdown target
76SOFT_SVC = "xyz.openbmc_project.Ipmi.Internal.SoftPowerOff.service"
77SOFT_TGTFMT = "obmc-host-shutdown@{0}.target"
78SOFT_FMT = "../${SOFT_SVC}:${SOFT_TGTFMT}.requires/${SOFT_SVC}"
79SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'SOFT_FMT', 'OBMC_HOST_INSTANCES')}"
Dhruvaraj Subhashchandran12352762017-08-04 16:09:15 -050080
81#Collect all hardcoded sensor yamls from different recipes and
82#merge all of them with sensor.yaml.
83python do_merge_sensors () {
84 import subprocess
85
86 # TODO: Perform the merge in a temporary directory?
87 workdir = d.getVar('WORKDIR', True)
88 nativedir = d.getVar('STAGING_DIR_NATIVE', True)
89 sensorsdir = d.getVar('sensor_datadir', True)
90 sensorsdir = sensorsdir[1:]
91 sensorsdir = os.path.join(nativedir, sensorsdir)
92 cmd = []
93 cmd.append(os.path.join(workdir, 'merge_yamls.py'))
94 cmd.append(os.path.join(sensorsdir, 'sensor.yaml'))
95
96 if os.stat(os.path.join(sensorsdir, 'sensor.yaml')).st_size == 0:
97 return
98 fetch = bb.fetch2.Fetch([], d)
Kun Yicdc3b232017-10-09 23:17:08 -070099 override_urls = [url for url in fetch.urls if url.endswith('.hardcoded.yaml')]
Dhruvaraj Subhashchandran12352762017-08-04 16:09:15 -0500100 for url in override_urls:
101 bb.debug(2, 'Overriding with source: ' + url)
102 local_base = os.path.basename(fetch.localpath(url))
103 filename = os.path.join(workdir, local_base)
104 cmd.append(filename)
105
106 # Invoke the script and don't catch any resulting exception.
107 subprocess.check_call(cmd)
108}
David Cobbleyf9236522017-11-21 16:17:40 -0800109do_install_append(){
110 install -d ${D}${datadir}/ipmi-providers
111 install -m 0644 -D ${WORKDIR}/dev_id.json \
112 ${D}${datadir}/ipmi-providers/dev_id.json
113}
Dhruvaraj Subhashchandran12352762017-08-04 16:09:15 -0500114# python-pyyaml-native is installed by do_configure, so put this task after
115addtask merge_sensors after do_configure before do_compile