vishwabmc | 1bf499d | 2015-10-09 15:51:50 +0530 | [diff] [blame] | 1 | SUMMARY = "Phosphor OpenBMC IPMI daemon" |
| 2 | DESCRIPTION = "Phosphor OpenBMC IPMI router and plugin libraries" |
vishwabmc | 1bf499d | 2015-10-09 15:51:50 +0530 | [diff] [blame] | 3 | PR = "r1" |
| 4 | |
Brad Bishop | 7ee7146 | 2016-08-19 09:02:54 -0500 | [diff] [blame] | 5 | RRECOMMENDS_${PN} += "packagegroup-obmc-ipmid-providers-libs" |
Chris Austen | 213cd2a | 2015-10-24 19:34:11 -0500 | [diff] [blame] | 6 | |
Matthew Barth | 302592f | 2016-08-16 16:51:35 -0500 | [diff] [blame] | 7 | inherit autotools pkgconfig |
Patrick Venture | d3dd094 | 2017-12-22 14:36:07 -0800 | [diff] [blame] | 8 | inherit obmc-phosphor-ipmiprovider-symlink |
vishwabmc | 1bf499d | 2015-10-09 15:51:50 +0530 | [diff] [blame] | 9 | inherit obmc-phosphor-license |
Patrick Williams | f771406 | 2015-10-15 15:20:20 -0500 | [diff] [blame] | 10 | inherit obmc-phosphor-sdbus-service |
Patrick Venture | d3dd094 | 2017-12-22 14:36:07 -0800 | [diff] [blame] | 11 | inherit obmc-phosphor-systemd |
Ratan Gupta | b92d0ec | 2017-03-06 17:05:11 +0530 | [diff] [blame] | 12 | inherit phosphor-ipmi-host |
| 13 | inherit pythonnative |
vishwabmc | 1bf499d | 2015-10-09 15:51:50 +0530 | [diff] [blame] | 14 | |
Brad Bishop | 7f2ade0 | 2018-01-26 22:11:36 -0500 | [diff] [blame] | 15 | def 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 | |
| 22 | |
Patrick Venture | d3dd094 | 2017-12-22 14:36:07 -0800 | [diff] [blame] | 23 | DEPENDS += "autoconf-archive-native" |
David Cobbley | 1dc78fb | 2017-11-21 16:17:40 -0800 | [diff] [blame] | 24 | DEPENDS += "nlohmann-json" |
Patrick Venture | d3dd094 | 2017-12-22 14:36:07 -0800 | [diff] [blame] | 25 | DEPENDS += "obmc-targets" |
Brad Bishop | 7f2ade0 | 2018-01-26 22:11:36 -0500 | [diff] [blame] | 26 | DEPENDS += "${@ipmi_whitelists(d)}" |
Patrick Venture | d3dd094 | 2017-12-22 14:36:07 -0800 | [diff] [blame] | 27 | DEPENDS += "phosphor-dbus-interfaces" |
Adriana Kobylak | 17885c2 | 2017-02-17 08:21:42 -0600 | [diff] [blame] | 28 | DEPENDS += "phosphor-logging" |
Brad Bishop | 1122eb0 | 2016-10-05 20:10:23 -0400 | [diff] [blame] | 29 | DEPENDS += "phosphor-mapper" |
Ratan Gupta | 8dc22a9 | 2017-03-20 18:20:47 +0530 | [diff] [blame] | 30 | DEPENDS += "sdbusplus" |
Patrick Venture | d3dd094 | 2017-12-22 14:36:07 -0800 | [diff] [blame] | 31 | DEPENDS += "sdbus++-native" |
Tom Joseph | f2614f9 | 2017-05-08 11:49:10 +0530 | [diff] [blame] | 32 | DEPENDS += "virtual/phosphor-ipmi-inventory-sel" |
Marri Devender Rao | 5a0088c | 2017-07-26 02:11:32 -0500 | [diff] [blame] | 33 | DEPENDS += "virtual/phosphor-ipmi-fru-merge-config" |
Patrick Venture | d3dd094 | 2017-12-22 14:36:07 -0800 | [diff] [blame] | 34 | DEPENDS += "virtual/phosphor-ipmi-sensor-inventory" |
Patrick Venture | afdf984 | 2018-01-18 18:01:29 -0800 | [diff] [blame] | 35 | DEPENDS += "virtual/phosphor-ipmi-channel-config" |
Ratan Gupta | b92d0ec | 2017-03-06 17:05:11 +0530 | [diff] [blame] | 36 | |
Adriana Kobylak | 17885c2 | 2017-02-17 08:21:42 -0600 | [diff] [blame] | 37 | RDEPENDS_${PN}-dev += "phosphor-logging" |
Brad Bishop | 1122eb0 | 2016-10-05 20:10:23 -0400 | [diff] [blame] | 38 | RDEPENDS_${PN}-dev += "phosphor-mapper-dev" |
Milton D. Miller II | 611e3ff | 2016-03-04 15:29:29 -0600 | [diff] [blame] | 39 | RDEPENDS_${PN} += "clear-once" |
Brad Bishop | 9a701b4 | 2016-07-26 15:52:01 -0400 | [diff] [blame] | 40 | RDEPENDS_${PN} += "libmapper" |
Patrick Venture | d3dd094 | 2017-12-22 14:36:07 -0800 | [diff] [blame] | 41 | RDEPENDS_${PN} += "network" |
| 42 | RDEPENDS_${PN} += "phosphor-dbus-interfaces" |
| 43 | RDEPENDS_${PN} += "phosphor-mapper" |
Vishwanatha Subbanna | 78bc542 | 2016-11-10 21:52:46 +0530 | [diff] [blame] | 44 | RDEPENDS_${PN} += "phosphor-time-manager" |
Patrick Venture | d3dd094 | 2017-12-22 14:36:07 -0800 | [diff] [blame] | 45 | RDEPENDS_${PN} += "sdbusplus" |
Vishwanatha Subbanna | 55c545a | 2017-06-12 13:09:10 +0530 | [diff] [blame] | 46 | RDEPENDS_${PN} += "virtual/obmc-watchdog" |
Ratan Gupta | 8dc22a9 | 2017-03-20 18:20:47 +0530 | [diff] [blame] | 47 | |
Vishwanatha Subbanna | 3531840 | 2017-03-31 14:41:11 +0530 | [diff] [blame] | 48 | SYSTEMD_SERVICE_${PN} += "xyz.openbmc_project.Ipmi.Internal.SoftPowerOff.service phosphor-ipmi-host.service" |
| 49 | |
Adriana Kobylak | 79841ae | 2016-08-25 10:07:34 -0500 | [diff] [blame] | 50 | RRECOMMENDS_${PN} += "virtual-obmc-settings-mgmt" |
vishwabmc | 1bf499d | 2015-10-09 15:51:50 +0530 | [diff] [blame] | 51 | |
Marri Devender Rao | 52a9f2d | 2017-06-08 00:47:54 -0500 | [diff] [blame] | 52 | require ${PN}.inc |
Chris Austen | 213cd2a | 2015-10-24 19:34:11 -0500 | [diff] [blame] | 53 | |
Tom Joseph | f07ae01 | 2017-02-20 12:01:43 +0530 | [diff] [blame] | 54 | # Setup IPMI Whitelist Conf files |
| 55 | WHITELIST_CONF = " \ |
Patrick Williams | f11f015 | 2017-02-24 13:04:06 -0600 | [diff] [blame] | 56 | ${STAGING_DATADIR_NATIVE}/phosphor-ipmi-host/*.conf \ |
Tom Joseph | f07ae01 | 2017-02-20 12:01:43 +0530 | [diff] [blame] | 57 | ${S}/host-ipmid-whitelist.conf \ |
| 58 | " |
| 59 | EXTRA_OECONF = " \ |
| 60 | WHITELIST_CONF="${WHITELIST_CONF}" \ |
Ratan Gupta | b92d0ec | 2017-03-06 17:05:11 +0530 | [diff] [blame] | 61 | SENSOR_YAML_GEN=${STAGING_DIR_NATIVE}${sensor_datadir}/sensor.yaml \ |
Tom Joseph | f2614f9 | 2017-05-08 11:49:10 +0530 | [diff] [blame] | 62 | INVSENSOR_YAML_GEN=${STAGING_DIR_NATIVE}${sensor_datadir}/invsensor.yaml \ |
Marri Devender Rao | 5a0088c | 2017-07-26 02:11:32 -0500 | [diff] [blame] | 63 | FRU_YAML_GEN=${STAGING_DIR_NATIVE}${config_datadir}/fru_config.yaml \ |
Patrick Venture | afdf984 | 2018-01-18 18:01:29 -0800 | [diff] [blame] | 64 | CHANNEL_YAML_GEN=${STAGING_DIR_NATIVE}${sensor_datadir}/channel.yaml \ |
Marri Devender Rao | 9f32d17 | 2018-01-18 11:21:19 -0600 | [diff] [blame] | 65 | POWER_READING_SENSOR=${datadir}/ipmi-providers/power_reading.json\ |
Tom Joseph | f07ae01 | 2017-02-20 12:01:43 +0530 | [diff] [blame] | 66 | " |
| 67 | |
vishwabmc | 1bf499d | 2015-10-09 15:51:50 +0530 | [diff] [blame] | 68 | S = "${WORKDIR}/git" |
| 69 | |
David Cobbley | 1dc78fb | 2017-11-21 16:17:40 -0800 | [diff] [blame] | 70 | SRC_URI += "file://merge_yamls.py \ |
| 71 | file://dev_id.json \ |
Dhruvaraj Subhashchandran | 93c0322 | 2018-01-09 03:44:39 -0600 | [diff] [blame] | 72 | file://dcmi_cap.json \ |
Marri Devender Rao | 9f32d17 | 2018-01-18 11:21:19 -0600 | [diff] [blame] | 73 | file://power_reading.json \ |
Deepak Kodihalli | e349047 | 2018-02-06 06:58:06 -0600 | [diff] [blame] | 74 | file://dcmi_sensors.json \ |
David Cobbley | 1dc78fb | 2017-11-21 16:17:40 -0800 | [diff] [blame] | 75 | " |
Dhruvaraj Subhashchandran | 16d5705 | 2017-08-04 16:09:15 -0500 | [diff] [blame] | 76 | |
Tom Joseph | 40b4e3f | 2017-02-01 19:47:27 +0530 | [diff] [blame] | 77 | HOSTIPMI_PROVIDER_LIBRARY += "libapphandler.so" |
Tom Joseph | 40b4e3f | 2017-02-01 19:47:27 +0530 | [diff] [blame] | 78 | HOSTIPMI_PROVIDER_LIBRARY += "libsysintfcmds.so" |
| 79 | |
| 80 | NETIPMI_PROVIDER_LIBRARY += "libapphandler.so" |
| 81 | |
Matthew Barth | 302592f | 2016-08-16 16:51:35 -0500 | [diff] [blame] | 82 | FILES_${PN}_append = " ${libdir}/host-ipmid/lib*${SOLIBS}" |
Patrick Venture | d3dd094 | 2017-12-22 14:36:07 -0800 | [diff] [blame] | 83 | FILES_${PN}_append = " ${libdir}/ipmid-providers/lib*${SOLIBS}" |
Tom Joseph | 40b4e3f | 2017-02-01 19:47:27 +0530 | [diff] [blame] | 84 | FILES_${PN}_append = " ${libdir}/net-ipmid/lib*${SOLIBS}" |
David Cobbley | 1dc78fb | 2017-11-21 16:17:40 -0800 | [diff] [blame] | 85 | FILES_${PN}_append = " ${datadir}/ipmi-providers/dev_id.json" |
Dhruvaraj Subhashchandran | 93c0322 | 2018-01-09 03:44:39 -0600 | [diff] [blame] | 86 | FILES_${PN}_append = " ${datadir}/ipmi-providers/dcmi_cap.json" |
Marri Devender Rao | 9f32d17 | 2018-01-18 11:21:19 -0600 | [diff] [blame] | 87 | FILES_${PN}_append = " ${datadir}/ipmi-providers/power_reading.json" |
Deepak Kodihalli | e349047 | 2018-02-06 06:58:06 -0600 | [diff] [blame] | 88 | FILES_${PN}_append = " ${datadir}/ipmi-providers/dcmi_sensors.json" |
Tom Joseph | 40b4e3f | 2017-02-01 19:47:27 +0530 | [diff] [blame] | 89 | FILES_${PN}-dev_append = " ${libdir}/ipmid-providers/lib*${SOLIBSDEV} ${libdir}/ipmid-providers/*.la" |
Brad Bishop | 3b524cf | 2016-09-06 13:03:39 -0400 | [diff] [blame] | 90 | |
Andrew Geissler | afc510f | 2017-01-04 11:11:50 -0600 | [diff] [blame] | 91 | # Soft Power Off |
Andrew Geissler | d40db75 | 2017-05-11 16:16:27 -0500 | [diff] [blame] | 92 | # install the soft power off service in the host shutdown target |
| 93 | SOFT_SVC = "xyz.openbmc_project.Ipmi.Internal.SoftPowerOff.service" |
| 94 | SOFT_TGTFMT = "obmc-host-shutdown@{0}.target" |
| 95 | SOFT_FMT = "../${SOFT_SVC}:${SOFT_TGTFMT}.requires/${SOFT_SVC}" |
| 96 | SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'SOFT_FMT', 'OBMC_HOST_INSTANCES')}" |
Dhruvaraj Subhashchandran | 16d5705 | 2017-08-04 16:09:15 -0500 | [diff] [blame] | 97 | |
| 98 | #Collect all hardcoded sensor yamls from different recipes and |
| 99 | #merge all of them with sensor.yaml. |
| 100 | python 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 Yi | e6bd58c | 2017-10-09 23:17:08 -0700 | [diff] [blame] | 116 | override_urls = [url for url in fetch.urls if url.endswith('.hardcoded.yaml')] |
Dhruvaraj Subhashchandran | 16d5705 | 2017-08-04 16:09:15 -0500 | [diff] [blame] | 117 | 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 | } |
David Cobbley | 1dc78fb | 2017-11-21 16:17:40 -0800 | [diff] [blame] | 126 | do_install_append(){ |
| 127 | install -d ${D}${datadir}/ipmi-providers |
| 128 | install -m 0644 -D ${WORKDIR}/dev_id.json \ |
| 129 | ${D}${datadir}/ipmi-providers/dev_id.json |
Dhruvaraj Subhashchandran | 93c0322 | 2018-01-09 03:44:39 -0600 | [diff] [blame] | 130 | install -m 0644 -D ${WORKDIR}/dcmi_cap.json \ |
| 131 | ${D}${datadir}/ipmi-providers/dcmi_cap.json |
Marri Devender Rao | 9f32d17 | 2018-01-18 11:21:19 -0600 | [diff] [blame] | 132 | install -m 0644 -D ${WORKDIR}/power_reading.json \ |
| 133 | ${D}${datadir}/ipmi-providers/power_reading.json |
Deepak Kodihalli | e349047 | 2018-02-06 06:58:06 -0600 | [diff] [blame] | 134 | install -m 0644 -D ${WORKDIR}/dcmi_sensors.json \ |
| 135 | ${D}${datadir}/ipmi-providers/dcmi_sensors.json |
David Cobbley | 1dc78fb | 2017-11-21 16:17:40 -0800 | [diff] [blame] | 136 | } |
Dhruvaraj Subhashchandran | 16d5705 | 2017-08-04 16:09:15 -0500 | [diff] [blame] | 137 | # python-pyyaml-native is installed by do_configure, so put this task after |
| 138 | addtask merge_sensors after do_configure before do_compile |