Adriana Kobylak | 2ca101c | 2016-01-30 08:53:35 -0600 | [diff] [blame] | 1 | SUMMARY = "Settings DBUS object" |
| 2 | DESCRIPTION = "Settings DBUS object" |
| 3 | HOMEPAGE = "http://github.com/openbmc/phosphor-settingsd" |
| 4 | PR = "r1" |
| 5 | |
Brad Bishop | 677be98 | 2016-09-15 09:54:10 -0400 | [diff] [blame] | 6 | inherit allarch |
Adriana Kobylak | 2ca101c | 2016-01-30 08:53:35 -0600 | [diff] [blame] | 7 | inherit obmc-phosphor-license |
Adriana Kobylak | 79841ae | 2016-08-25 10:07:34 -0500 | [diff] [blame] | 8 | inherit setuptools |
Brad Bishop | 677be98 | 2016-09-15 09:54:10 -0400 | [diff] [blame] | 9 | inherit obmc-phosphor-dbus-service |
Xo Wang | 51a53f0 | 2017-03-17 18:15:10 -0700 | [diff] [blame] | 10 | inherit pythonnative |
Brad Bishop | 677be98 | 2016-09-15 09:54:10 -0400 | [diff] [blame] | 11 | |
Patrick Williams | 1f962b7 | 2017-06-02 07:08:31 -0500 | [diff] [blame] | 12 | include phosphor-settings-manager.inc |
| 13 | |
Brad Bishop | 677be98 | 2016-09-15 09:54:10 -0400 | [diff] [blame] | 14 | DBUS_SERVICE_${PN} = "org.openbmc.settings.Host.service" |
Adriana Kobylak | 2ca101c | 2016-01-30 08:53:35 -0600 | [diff] [blame] | 15 | |
Adriana Kobylak | 79841ae | 2016-08-25 10:07:34 -0500 | [diff] [blame] | 16 | DEPENDS += "python-pyyaml-native" |
Patrick Williams | a25bbf6 | 2017-05-24 18:21:54 -0500 | [diff] [blame] | 17 | RDEPENDS_${PN} += "python-dbus python-pygobject python-ipy" |
Adriana Kobylak | 79841ae | 2016-08-25 10:07:34 -0500 | [diff] [blame] | 18 | PROVIDES += "virtual/obmc-settings-mgmt" |
| 19 | RPROVIDES_${PN} += "virtual-obmc-settings-mgmt" |
Adriana Kobylak | 2ca101c | 2016-01-30 08:53:35 -0600 | [diff] [blame] | 20 | |
Xo Wang | 51a53f0 | 2017-03-17 18:15:10 -0700 | [diff] [blame] | 21 | SRC_URI += "file://merge_settings.py" |
Adriana Kobylak | 2ca101c | 2016-01-30 08:53:35 -0600 | [diff] [blame] | 22 | |
Adriana Kobylak | 2ca101c | 2016-01-30 08:53:35 -0600 | [diff] [blame] | 23 | S = "${WORKDIR}/git" |
Xo Wang | 51a53f0 | 2017-03-17 18:15:10 -0700 | [diff] [blame] | 24 | |
| 25 | # Collect files in SRC_URI that end in ".override.yml" and call a script that |
| 26 | # writes their contents over that of settings.yaml, which is then updated to |
| 27 | # the merged data values. |
| 28 | # This doesn't correctly handle globs in ".override.yml" entries in SRC_URI. |
| 29 | python do_merge_settings () { |
| 30 | import subprocess |
| 31 | |
| 32 | # TODO: Perform the merge in a temporary directory? |
| 33 | workdir = d.getVar('WORKDIR', True) |
| 34 | cmd = [] |
| 35 | cmd.append(os.path.join(workdir, 'merge_settings.py')) |
| 36 | cmd.append(os.path.join(d.getVar('S', True), 'settings.yaml')) |
| 37 | |
| 38 | fetch = bb.fetch2.Fetch([], d) |
Kun Yi | e6bd58c | 2017-10-09 23:17:08 -0700 | [diff] [blame] | 39 | override_urls = [url for url in fetch.urls if url.endswith('.override.yml')] |
Xo Wang | 51a53f0 | 2017-03-17 18:15:10 -0700 | [diff] [blame] | 40 | for url in override_urls: |
| 41 | bb.debug(2, 'Overriding with source: ' + url) |
| 42 | local_base = os.path.basename(fetch.localpath(url)) |
| 43 | filename = os.path.join(workdir, local_base) |
| 44 | cmd.append(filename) |
| 45 | |
| 46 | # Invoke the script and don't catch any resulting exception. |
| 47 | subprocess.check_call(cmd) |
| 48 | } |
| 49 | # python-pyyaml-native is installed by do_configure, so put this task after |
| 50 | addtask merge_settings after do_configure before do_compile |