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" |
Patrick Venture | f30b884 | 2018-10-21 08:27:22 -0700 | [diff] [blame] | 4 | PV = "1.0+git${SRCPV}" |
Patrick Venture | 6432937 | 2018-11-03 09:42:59 -0700 | [diff] [blame] | 5 | LICENSE = "Apache-2.0" |
| 6 | LIC_FILES_CHKSUM = "file://LICENSE;md5=86d3f3a95c324c9479bd8986968f4327" |
vishwabmc | 1bf499d | 2015-10-09 15:51:50 +0530 | [diff] [blame] | 7 | |
Brad Bishop | 7ee7146 | 2016-08-19 09:02:54 -0500 | [diff] [blame] | 8 | RRECOMMENDS_${PN} += "packagegroup-obmc-ipmid-providers-libs" |
Chris Austen | 213cd2a | 2015-10-24 19:34:11 -0500 | [diff] [blame] | 9 | |
Matthew Barth | 302592f | 2016-08-16 16:51:35 -0500 | [diff] [blame] | 10 | inherit autotools pkgconfig |
Patrick Venture | d3dd094 | 2017-12-22 14:36:07 -0800 | [diff] [blame] | 11 | inherit obmc-phosphor-ipmiprovider-symlink |
Patrick Williams | f771406 | 2015-10-15 15:20:20 -0500 | [diff] [blame] | 12 | inherit obmc-phosphor-sdbus-service |
Patrick Venture | d3dd094 | 2017-12-22 14:36:07 -0800 | [diff] [blame] | 13 | inherit obmc-phosphor-systemd |
Ratan Gupta | b92d0ec | 2017-03-06 17:05:11 +0530 | [diff] [blame] | 14 | inherit phosphor-ipmi-host |
| 15 | inherit pythonnative |
vishwabmc | 1bf499d | 2015-10-09 15:51:50 +0530 | [diff] [blame] | 16 | |
Brad Bishop | fe88ee4 | 2019-06-07 15:21:01 -0400 | [diff] [blame^] | 17 | SRC_URI += "file://entity.yaml" |
| 18 | |
Brad Bishop | 7f2ade0 | 2018-01-26 22:11:36 -0500 | [diff] [blame] | 19 | def ipmi_whitelists(d): |
| 20 | whitelists = d.getVar( |
| 21 | 'VIRTUAL-RUNTIME_phosphor-ipmi-providers', True) or '' |
| 22 | whitelists = whitelists.split() |
| 23 | whitelists = [ '{}-whitelist-native'.format(x) for x in whitelists ] |
| 24 | return ' '.join(whitelists) |
| 25 | |
Patrick Venture | d3dd094 | 2017-12-22 14:36:07 -0800 | [diff] [blame] | 26 | DEPENDS += "autoconf-archive-native" |
David Cobbley | 1dc78fb | 2017-11-21 16:17:40 -0800 | [diff] [blame] | 27 | DEPENDS += "nlohmann-json" |
Patrick Venture | d3dd094 | 2017-12-22 14:36:07 -0800 | [diff] [blame] | 28 | DEPENDS += "obmc-targets" |
Brad Bishop | 7f2ade0 | 2018-01-26 22:11:36 -0500 | [diff] [blame] | 29 | DEPENDS += "${@ipmi_whitelists(d)}" |
Patrick Venture | d3dd094 | 2017-12-22 14:36:07 -0800 | [diff] [blame] | 30 | DEPENDS += "phosphor-dbus-interfaces" |
Adriana Kobylak | 17885c2 | 2017-02-17 08:21:42 -0600 | [diff] [blame] | 31 | DEPENDS += "phosphor-logging" |
Brad Bishop | 1122eb0 | 2016-10-05 20:10:23 -0400 | [diff] [blame] | 32 | DEPENDS += "phosphor-mapper" |
Ratan Gupta | 8dc22a9 | 2017-03-20 18:20:47 +0530 | [diff] [blame] | 33 | DEPENDS += "sdbusplus" |
Patrick Venture | d3dd094 | 2017-12-22 14:36:07 -0800 | [diff] [blame] | 34 | DEPENDS += "sdbus++-native" |
Tom Joseph | c32034f | 2019-02-04 03:54:06 -0600 | [diff] [blame] | 35 | DEPENDS += "virtual/phosphor-ipmi-inventory-sel" |
Marri Devender Rao | 5a0088c | 2017-07-26 02:11:32 -0500 | [diff] [blame] | 36 | DEPENDS += "virtual/phosphor-ipmi-fru-merge-config" |
Patrick Venture | d3dd094 | 2017-12-22 14:36:07 -0800 | [diff] [blame] | 37 | DEPENDS += "virtual/phosphor-ipmi-sensor-inventory" |
Andrew Geissler | a561ec9 | 2018-09-25 19:50:20 +0000 | [diff] [blame] | 38 | DEPENDS += "boost" |
Patrick Venture | 12a94a8 | 2018-11-07 17:48:53 -0800 | [diff] [blame] | 39 | DEPENDS += "sdeventplus" |
Ratan Gupta | b92d0ec | 2017-03-06 17:05:11 +0530 | [diff] [blame] | 40 | |
Andrew Jeffery | 381e1e9 | 2018-04-06 14:13:14 +0930 | [diff] [blame] | 41 | VIRTUAL-RUNTIME_ipmi-config ?= "phosphor-ipmi-config" |
| 42 | |
Adriana Kobylak | 17885c2 | 2017-02-17 08:21:42 -0600 | [diff] [blame] | 43 | RDEPENDS_${PN}-dev += "phosphor-logging" |
Brad Bishop | 1122eb0 | 2016-10-05 20:10:23 -0400 | [diff] [blame] | 44 | RDEPENDS_${PN}-dev += "phosphor-mapper-dev" |
Milton D. Miller II | 611e3ff | 2016-03-04 15:29:29 -0600 | [diff] [blame] | 45 | RDEPENDS_${PN} += "clear-once" |
Patrick Venture | 98fa961 | 2019-03-28 09:09:13 -0700 | [diff] [blame] | 46 | RDEPENDS_${PN} += "phosphor-network" |
Vishwanatha Subbanna | 78bc542 | 2016-11-10 21:52:46 +0530 | [diff] [blame] | 47 | RDEPENDS_${PN} += "phosphor-time-manager" |
Andrew Jeffery | 381e1e9 | 2018-04-06 14:13:14 +0930 | [diff] [blame] | 48 | RDEPENDS_${PN} += "${VIRTUAL-RUNTIME_ipmi-config}" |
Vishwanatha Subbanna | 55c545a | 2017-06-12 13:09:10 +0530 | [diff] [blame] | 49 | RDEPENDS_${PN} += "virtual/obmc-watchdog" |
Patrick Venture | 68f1261 | 2019-04-30 10:26:34 -0700 | [diff] [blame] | 50 | RDEPENDS_${PN} += "${VIRTUAL-RUNTIME_obmc-bmc-state-manager}" |
Patrick Venture | 00e88bf | 2019-05-03 07:51:58 -0700 | [diff] [blame] | 51 | RDEPENDS_${PN} += "${VIRTUAL-RUNTIME_obmc-bmc-version}" |
Patrick Venture | f5dd031 | 2019-05-03 07:53:57 -0700 | [diff] [blame] | 52 | RDEPENDS_${PN} += "${VIRTUAL-RUNTIME_obmc-bmc-updater}" |
Ratan Gupta | 8dc22a9 | 2017-03-20 18:20:47 +0530 | [diff] [blame] | 53 | |
Richard Marian Thomaiyar | fe5b8d2 | 2018-08-20 20:14:16 +0530 | [diff] [blame] | 54 | inherit useradd |
| 55 | |
| 56 | USERADD_PACKAGES = "${PN}" |
| 57 | # add ipmi group |
| 58 | GROUPADD_PARAM_${PN} = "ipmi" |
Richard Marian Thomaiyar | 41882fb | 2018-12-14 09:04:40 +0530 | [diff] [blame] | 59 | # Add root user to ipmi group |
| 60 | GROUPMEMS_PARAM_${PN} = "-g ipmi -a root" |
Richard Marian Thomaiyar | fe5b8d2 | 2018-08-20 20:14:16 +0530 | [diff] [blame] | 61 | |
Vishwanatha Subbanna | 3531840 | 2017-03-31 14:41:11 +0530 | [diff] [blame] | 62 | SYSTEMD_SERVICE_${PN} += "xyz.openbmc_project.Ipmi.Internal.SoftPowerOff.service phosphor-ipmi-host.service" |
| 63 | |
Andrew Geissler | 78e0454 | 2018-02-05 12:02:35 -0800 | [diff] [blame] | 64 | RRECOMMENDS_${PN} += "${VIRTUAL-RUNTIME_obmc-settings-mgmt}" |
| 65 | |
vishwabmc | 1bf499d | 2015-10-09 15:51:50 +0530 | [diff] [blame] | 66 | |
Marri Devender Rao | 52a9f2d | 2017-06-08 00:47:54 -0500 | [diff] [blame] | 67 | require ${PN}.inc |
Chris Austen | 213cd2a | 2015-10-24 19:34:11 -0500 | [diff] [blame] | 68 | |
Tom Joseph | f07ae01 | 2017-02-20 12:01:43 +0530 | [diff] [blame] | 69 | # Setup IPMI Whitelist Conf files |
| 70 | WHITELIST_CONF = " \ |
Patrick Williams | f11f015 | 2017-02-24 13:04:06 -0600 | [diff] [blame] | 71 | ${STAGING_DATADIR_NATIVE}/phosphor-ipmi-host/*.conf \ |
Tom Joseph | f07ae01 | 2017-02-20 12:01:43 +0530 | [diff] [blame] | 72 | ${S}/host-ipmid-whitelist.conf \ |
| 73 | " |
| 74 | EXTRA_OECONF = " \ |
Ratan Gupta | b92d0ec | 2017-03-06 17:05:11 +0530 | [diff] [blame] | 75 | SENSOR_YAML_GEN=${STAGING_DIR_NATIVE}${sensor_datadir}/sensor.yaml \ |
Tom Joseph | c32034f | 2019-02-04 03:54:06 -0600 | [diff] [blame] | 76 | INVSENSOR_YAML_GEN=${STAGING_DIR_NATIVE}${sensor_datadir}/invsensor.yaml \ |
Marri Devender Rao | 5a0088c | 2017-07-26 02:11:32 -0500 | [diff] [blame] | 77 | FRU_YAML_GEN=${STAGING_DIR_NATIVE}${config_datadir}/fru_config.yaml \ |
Tom Joseph | f07ae01 | 2017-02-20 12:01:43 +0530 | [diff] [blame] | 78 | " |
Brad Bishop | bb60cff | 2019-06-09 22:57:35 -0400 | [diff] [blame] | 79 | EXTRA_OECONF_append = " \ |
| 80 | WHITELIST_CONF="${WHITELIST_CONF}" \ |
| 81 | " |
Tom Joseph | f07ae01 | 2017-02-20 12:01:43 +0530 | [diff] [blame] | 82 | |
vishwabmc | 1bf499d | 2015-10-09 15:51:50 +0530 | [diff] [blame] | 83 | S = "${WORKDIR}/git" |
| 84 | |
Andrew Jeffery | 381e1e9 | 2018-04-06 14:13:14 +0930 | [diff] [blame] | 85 | SRC_URI += "file://merge_yamls.py " |
Dhruvaraj Subhashchandran | 16d5705 | 2017-08-04 16:09:15 -0500 | [diff] [blame] | 86 | |
Vernon Mauery | 595c738 | 2018-07-30 15:49:09 -0700 | [diff] [blame] | 87 | HOSTIPMI_PROVIDER_LIBRARY += "libipmi20.so" |
Tom Joseph | 40b4e3f | 2017-02-01 19:47:27 +0530 | [diff] [blame] | 88 | HOSTIPMI_PROVIDER_LIBRARY += "libsysintfcmds.so" |
William A. Kennington III | c426a98 | 2018-12-19 14:53:22 -0800 | [diff] [blame] | 89 | HOSTIPMI_PROVIDER_LIBRARY += "libusercmds.so" |
Tom Joseph | 40b4e3f | 2017-02-01 19:47:27 +0530 | [diff] [blame] | 90 | |
Vernon Mauery | 595c738 | 2018-07-30 15:49:09 -0700 | [diff] [blame] | 91 | NETIPMI_PROVIDER_LIBRARY += "libipmi20.so" |
William A. Kennington III | c426a98 | 2018-12-19 14:53:22 -0800 | [diff] [blame] | 92 | NETIPMI_PROVIDER_LIBRARY += "libusercmds.so" |
Tom Joseph | 40b4e3f | 2017-02-01 19:47:27 +0530 | [diff] [blame] | 93 | |
Matthew Barth | 302592f | 2016-08-16 16:51:35 -0500 | [diff] [blame] | 94 | FILES_${PN}_append = " ${libdir}/host-ipmid/lib*${SOLIBS}" |
Patrick Venture | d3dd094 | 2017-12-22 14:36:07 -0800 | [diff] [blame] | 95 | FILES_${PN}_append = " ${libdir}/ipmid-providers/lib*${SOLIBS}" |
Tom Joseph | 40b4e3f | 2017-02-01 19:47:27 +0530 | [diff] [blame] | 96 | FILES_${PN}_append = " ${libdir}/net-ipmid/lib*${SOLIBS}" |
| 97 | 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] | 98 | |
Andrew Geissler | afc510f | 2017-01-04 11:11:50 -0600 | [diff] [blame] | 99 | # Soft Power Off |
Andrew Geissler | d40db75 | 2017-05-11 16:16:27 -0500 | [diff] [blame] | 100 | # install the soft power off service in the host shutdown target |
| 101 | SOFT_SVC = "xyz.openbmc_project.Ipmi.Internal.SoftPowerOff.service" |
| 102 | SOFT_TGTFMT = "obmc-host-shutdown@{0}.target" |
| 103 | SOFT_FMT = "../${SOFT_SVC}:${SOFT_TGTFMT}.requires/${SOFT_SVC}" |
| 104 | SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'SOFT_FMT', 'OBMC_HOST_INSTANCES')}" |
Dhruvaraj Subhashchandran | 16d5705 | 2017-08-04 16:09:15 -0500 | [diff] [blame] | 105 | |
Brad Bishop | fe88ee4 | 2019-06-07 15:21:01 -0400 | [diff] [blame^] | 106 | do_replace_entity_default() { |
| 107 | # The in-repo provided default is tailored to testing the ipmid code. |
| 108 | # Replace it with a reasonable default for users. |
| 109 | cp entity.yaml ${S}/scripts/entity-example.yaml |
| 110 | } |
| 111 | |
| 112 | do_patch_append() { |
| 113 | bb.build.exec_func('do_replace_entity_default', d) |
| 114 | } |
| 115 | |
Dhruvaraj Subhashchandran | 16d5705 | 2017-08-04 16:09:15 -0500 | [diff] [blame] | 116 | #Collect all hardcoded sensor yamls from different recipes and |
| 117 | #merge all of them with sensor.yaml. |
| 118 | python do_merge_sensors () { |
| 119 | import subprocess |
| 120 | |
| 121 | # TODO: Perform the merge in a temporary directory? |
| 122 | workdir = d.getVar('WORKDIR', True) |
| 123 | nativedir = d.getVar('STAGING_DIR_NATIVE', True) |
| 124 | sensorsdir = d.getVar('sensor_datadir', True) |
| 125 | sensorsdir = sensorsdir[1:] |
| 126 | sensorsdir = os.path.join(nativedir, sensorsdir) |
| 127 | cmd = [] |
| 128 | cmd.append(os.path.join(workdir, 'merge_yamls.py')) |
| 129 | cmd.append(os.path.join(sensorsdir, 'sensor.yaml')) |
| 130 | |
| 131 | if os.stat(os.path.join(sensorsdir, 'sensor.yaml')).st_size == 0: |
| 132 | return |
| 133 | fetch = bb.fetch2.Fetch([], d) |
Kun Yi | e6bd58c | 2017-10-09 23:17:08 -0700 | [diff] [blame] | 134 | 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] | 135 | for url in override_urls: |
| 136 | bb.debug(2, 'Overriding with source: ' + url) |
| 137 | local_base = os.path.basename(fetch.localpath(url)) |
| 138 | filename = os.path.join(workdir, local_base) |
| 139 | cmd.append(filename) |
| 140 | |
| 141 | # Invoke the script and don't catch any resulting exception. |
| 142 | subprocess.check_call(cmd) |
| 143 | } |
Andrew Jeffery | 381e1e9 | 2018-04-06 14:13:14 +0930 | [diff] [blame] | 144 | |
Dhruvaraj Subhashchandran | 16d5705 | 2017-08-04 16:09:15 -0500 | [diff] [blame] | 145 | # python-pyyaml-native is installed by do_configure, so put this task after |
| 146 | addtask merge_sensors after do_configure before do_compile |