blob: 4491bda934841511a40831fb45e4a909a0af80c9 [file] [log] [blame]
Deepak Kodihallifeb88672017-05-17 06:42:51 -05001SUMMARY = "Phosphor Settings Manager"
2DESCRIPTION = "Phosphor Settings Manager is an application that creates \
3d-bus objects to represent various user settings."
4PR = "r1"
Patrick Venture0e3e53b2018-10-26 08:55:27 -07005PV = "1.0+git${SRCPV}"
Deepak Kodihallifeb88672017-05-17 06:42:51 -05006
Jagpal Singh Gill11860702023-04-25 18:14:22 -07007inherit meson pkgconfig
Deepak Kodihallifeb88672017-05-17 06:42:51 -05008inherit obmc-phosphor-dbus-service
Andrew Geissler384f1902020-04-02 13:11:28 +00009inherit python3native
Deepak Kodihallifeb88672017-05-17 06:42:51 -050010inherit phosphor-settings-manager
11
12require phosphor-settings-manager.inc
13
Patrick Williams12fc9392021-08-06 09:16:53 -050014DBUS_SERVICE:${PN} = "xyz.openbmc_project.Settings.service"
Deepak Kodihallifeb88672017-05-17 06:42:51 -050015
Andrew Geissler384f1902020-04-02 13:11:28 +000016DEPENDS += "${PYTHON_PN}-pyyaml-native"
17DEPENDS += "${PYTHON_PN}-mako-native"
Patrick Williams6aa2b122021-05-05 17:01:23 -050018DEPENDS += "${PYTHON_PN}-sdbus++-native"
Deepak Kodihallifeb88672017-05-17 06:42:51 -050019DEPENDS += "virtual/phosphor-settings-defaults"
Brad Bishopff92bb62020-07-09 16:59:54 -040020DEPENDS += "${@bb.utils.contains('DISTRO_FEATURES', 'obmc-mrw', 'phosphor-settings-read-settings-mrw-native', '', d)}"
Patrick Williams4b32c9a2020-03-31 16:43:15 -050021DEPENDS += "sdbusplus"
Patrick Williamsce14ef62020-06-09 21:00:08 -050022DEPENDS += "phosphor-dbus-interfaces"
Brad Bishopd55ffca2017-07-30 20:33:06 -040023DEPENDS += "phosphor-logging"
Brad Bishop17c08bf2018-10-18 17:07:53 -040024DEPENDS += "libcereal"
Deepak Kodihallifeb88672017-05-17 06:42:51 -050025
Deepak Kodihallifeb88672017-05-17 06:42:51 -050026S = "${WORKDIR}/git"
Deepak Kodihalli68136c32017-07-23 14:08:56 -050027SRC_URI += "file://merge_settings.py"
Deepak Kodihallifeb88672017-05-17 06:42:51 -050028
Konstantin Aladyshevd8154d02021-02-24 20:46:10 +030029# 'boot_type' configuration parameter is used to add support for
30# the Legacy/EFI boot override selector for systems with x86 host
31PACKAGECONFIG[boot_type] = ""
32SRC_URI += "${@bb.utils.contains('PACKAGECONFIG', 'boot_type', 'file://boot_type.override.yml', '', d)}"
33
Jagpal Singh Gill11860702023-04-25 18:14:22 -070034EXTRA_OEMESON = " \
35 -Dsettings_yaml=${STAGING_DIR_NATIVE}${settings_datadir}/defaults.yaml \
36 "
Deepak Kodihalli68136c32017-07-23 14:08:56 -050037
Gaurav Gandhid08d1062022-02-18 21:24:19 +000038# Collect files in SRC_URI that end in ".override.yml" or ".remove.yml" and call a script that
39# writes/removes their contents from that of settings.yaml, which is then updated to
Deepak Kodihalli68136c32017-07-23 14:08:56 -050040# the merged data values.
41# This doesn't correctly handle globs in ".override.yml" entries in SRC_URI.
42python do_merge_settings () {
43 import subprocess
44
45 # TODO: Perform the merge in a temporary directory?
46 workdir = d.getVar('WORKDIR', True)
47 nativedir = d.getVar('STAGING_DIR_NATIVE', True)
48 settingsdir = d.getVar('settings_datadir', True)
49 settingsdir = settingsdir[1:]
50 settingsdir = os.path.join(nativedir, settingsdir)
51 cmd = []
52 cmd.append(os.path.join(workdir, 'merge_settings.py'))
53 cmd.append(os.path.join(settingsdir, 'defaults.yaml'))
Gunnar Mills8c6516f2017-10-04 15:38:33 -050054 # Used for any settings from the MRW
Brad Bishopff92bb62020-07-09 16:59:54 -040055 use_mrw = bb.utils.contains('DISTRO_FEATURES', 'obmc-mrw', 'true', '', d)
Gunnar Mills8c6516f2017-10-04 15:38:33 -050056 if (use_mrw == 'true'):
57 cmd.append(os.path.join(settingsdir, 'mrw-settings.override.yaml'))
Deepak Kodihalli68136c32017-07-23 14:08:56 -050058
59 fetch = bb.fetch2.Fetch([], d)
Gaurav Gandhid08d1062022-02-18 21:24:19 +000060 override_urls = [url for url in fetch.urls if url.endswith(('.override.yml', '.remove.yml'))]
Deepak Kodihalli68136c32017-07-23 14:08:56 -050061 for url in override_urls:
62 bb.debug(2, 'Overriding with source: ' + url)
63 local_base = os.path.basename(fetch.localpath(url))
64 filename = os.path.join(workdir, local_base)
65 cmd.append(filename)
66
67 # Invoke the script and don't catch any resulting exception.
68 subprocess.check_call(cmd)
69}
70# python-pyyaml-native is installed by do_configure, so put this task after
71addtask merge_settings after do_configure before do_compile