diff options
author | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2018-08-31 13:25:51 +0300 |
---|---|---|
committer | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2018-09-06 14:44:12 +0300 |
commit | ff075f6ee795a590b244d70a90cc312ba1f2d83d (patch) | |
tree | a617790bdbfdeef960665ba0242e1f0c93e5301a /meta-phosphor/recipes-phosphor/dbus | |
parent | 3e4da38c127bb7e7641adc2fc41f4c33744cb918 (diff) | |
download | openbmc-ff075f6ee795a590b244d70a90cc312ba1f2d83d.tar.xz |
meta-phosphor: Move layer content from common/
Adopt a more conventional directory hierarchy. meta-phosphor is still
a _long_ way from suitable for hosting on yoctoproject.org but things
like this don't help.
(From meta-phosphor rev: 471cfcefa74b8c7ceb704cb670e6d915cf27c63b)
Change-Id: I3f106b2f6cdc6cec734be28a6090800546f362eb
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Diffstat (limited to 'meta-phosphor/recipes-phosphor/dbus')
15 files changed, 374 insertions, 0 deletions
diff --git a/meta-phosphor/recipes-phosphor/dbus/dbus-perms.bb b/meta-phosphor/recipes-phosphor/dbus/dbus-perms.bb new file mode 100644 index 000000000..8290ecce2 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/dbus/dbus-perms.bb @@ -0,0 +1,16 @@ +SUMMARY = "Phosphor OpenBMC DBUS Permissions" +DESCRIPTION = "Phosphor OpenBMC DBUS Permissions." +HOMEPAGE = "http://github.com/openbmc/" +PR = "r1" + +inherit allarch +inherit obmc-phosphor-license +inherit dbus-dir + +SRC_URI += "file://org.openbmc.conf" + +do_install_append() { + install -d ${D}${dbus_system_confdir} + install -m 0644 ${WORKDIR}/org.openbmc.conf \ + ${D}${dbus_system_confdir} +} diff --git a/meta-phosphor/recipes-phosphor/dbus/dbus-perms/org.openbmc.conf b/meta-phosphor/recipes-phosphor/dbus/dbus-perms/org.openbmc.conf new file mode 100644 index 000000000..b51293b19 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/dbus/dbus-perms/org.openbmc.conf @@ -0,0 +1,8 @@ +<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN" + "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd"> +<busconfig> + <policy context="default"> + <allow own="*"/> + <allow send_destination="*"/> + </policy> +</busconfig> diff --git a/meta-phosphor/recipes-phosphor/dbus/phosphor-dbus-interfaces-mapper-config-native.bb b/meta-phosphor/recipes-phosphor/dbus/phosphor-dbus-interfaces-mapper-config-native.bb new file mode 100644 index 000000000..c39e0a34f --- /dev/null +++ b/meta-phosphor/recipes-phosphor/dbus/phosphor-dbus-interfaces-mapper-config-native.bb @@ -0,0 +1,11 @@ +SUMMARY="Add /xyz/openbmc_project namespace to phosphor-mapper" +DESCRIPTION="Add the /xyz/openbmc_project path namespace and \ +xyz.openbmc_project interface prefix to the mapper \ +watch list." + +inherit phosphor-mapper +inherit native +inherit obmc-phosphor-license + +PHOSPHOR_MAPPER_NAMESPACE_append = " /xyz/openbmc_project" +PHOSPHOR_MAPPER_INTERFACE_append = " xyz.openbmc_project" diff --git a/meta-phosphor/recipes-phosphor/dbus/phosphor-dbus-interfaces.bb b/meta-phosphor/recipes-phosphor/dbus/phosphor-dbus-interfaces.bb new file mode 100644 index 000000000..790898cd1 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/dbus/phosphor-dbus-interfaces.bb @@ -0,0 +1,32 @@ +SUMMARY = "Phosphor DBus Interfaces" +DESCRIPTION = "Generated bindings, using sdbus++, for the phosphor YAML" +PR = "r1" + +S = "${WORKDIR}/git" + +inherit autotools pkgconfig +inherit obmc-phosphor-license +inherit pythonnative +inherit phosphor-dbus-yaml + +DEPENDS += "autoconf-archive-native" +DEPENDS += "sdbus++-native" + +SRC_URI += "git://github.com/openbmc/phosphor-dbus-interfaces" +SRCREV = "e0e9aed2be16f2189759c36e63dbdef8819f12c9" + +DEPENDS_remove_class-native = "sdbus++-native" +DEPENDS_remove_class-nativesdk = "sdbus++-native" + +PACKAGECONFIG ??= "libphosphor_dbus" +PACKAGECONFIG[libphosphor_dbus] = " \ + --enable-libphosphor_dbus, \ + --disable-libphosphor_dbus, \ + systemd sdbusplus, \ + libsystemd sdbusplus \ + " + +PACKAGECONFIG_remove_class-native = "libphosphor_dbus" +PACKAGECONFIG_remove_class-nativesdk = "libphosphor_dbus" + +BBCLASSEXTEND += "native nativesdk" diff --git a/meta-phosphor/recipes-phosphor/dbus/phosphor-dbus-monitor-config-native.bb b/meta-phosphor/recipes-phosphor/dbus/phosphor-dbus-monitor-config-native.bb new file mode 100644 index 000000000..228ae5a63 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/dbus/phosphor-dbus-monitor-config-native.bb @@ -0,0 +1,20 @@ +SUMMARY = "Phosphor DBus Monitor Configuration" +DESCRIPTION = "Meta-recipe, pulling in native recipes that wish to add \ +configuration files to the /usr/share/phosphor-dbus-monitor filesystem." +HOMEPAGE = "http://github.com/openbmc/phosphor-dbus-monitor" +PR = "r1" + +inherit obmc-phosphor-license +inherit native +inherit phosphor-dbus-monitor + +PHOSPHOR_DBUS_MONITOR_CONFIGS ??= "" + +# To add additional config files, create a recipe in your layer, +# and add it to PHOSPHOR_DBUS_MONITOR_CONFIGS with a bbappend to this recipe. + +DEPENDS += "${PHOSPHOR_DBUS_MONITOR_CONFIGS}" + +do_install() { + mkdir -p ${D}${config_dir} +} diff --git a/meta-phosphor/recipes-phosphor/dbus/phosphor-dbus-monitor.bb b/meta-phosphor/recipes-phosphor/dbus/phosphor-dbus-monitor.bb new file mode 100644 index 000000000..cfa684aa0 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/dbus/phosphor-dbus-monitor.bb @@ -0,0 +1,46 @@ +SUMMARY = "Phosphor DBus Monitor" +DESCRIPTION = "Phosphor DBus Monitor is a general purpose DBus application \ +that watches DBus traffic for events and takes actions based on those events." +PR = "r1" + +HOMEPAGE = "http://github.com/openbmc/phosphor-dbus-monitor" +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://LICENSE;md5=e3fc50a88d0a364313df4b21ef20c29e" +SRC_URI = "git://github.com/openbmc/phosphor-dbus-monitor" +SRCREV = "2ded5e1e3993913be34e8122f2b835468a2f9e91" + +inherit autotools \ + pkgconfig \ + pythonnative \ + phosphor-dbus-monitor \ + obmc-phosphor-systemd + +PACKAGE_BEFORE_PN = "phosphor-msl-verify" +SYSTEMD_PACKAGES = "${PN} phosphor-msl-verify" +SYSTEMD_SERVICE_phosphor-msl-verify = "phosphor-msl-verify.service" + +DEPENDS += " \ + ${PN}-config-native \ + phosphor-logging \ + autoconf-archive-native \ + sdbusplus-native \ + gtest \ + " +RDEPENDS_${PN} += " \ + sdbusplus \ + phosphor-dbus-interfaces \ + phosphor-logging \ + " + +RDEPENDS_phosphor-msl-verify += " \ + sdbusplus \ + phosphor-dbus-interfaces \ + phosphor-logging \ + " +FILES_phosphor-msl-verify = "${sbindir}/phosphor-msl-verify" + +S = "${WORKDIR}/git" + +EXTRA_OECONF = " \ + YAML_PATH=${STAGING_DIR_NATIVE}${config_dir} \ + " diff --git a/meta-phosphor/recipes-phosphor/dbus/phosphor-dbus-monitor/phosphor-dbus-monitor.service b/meta-phosphor/recipes-phosphor/dbus/phosphor-dbus-monitor/phosphor-dbus-monitor.service new file mode 100644 index 000000000..9440f0c2d --- /dev/null +++ b/meta-phosphor/recipes-phosphor/dbus/phosphor-dbus-monitor/phosphor-dbus-monitor.service @@ -0,0 +1,11 @@ +[Unit] +Description=Phosphor DBus Monitor +After=obmc-mapper.target + +[Service] +Restart=always +ExecStart=/usr/bin/env phosphor-dbus-monitor +SyslogIdentifier=phosphor-dbus-monitor + +[Install] +WantedBy={SYSTEMD_DEFAULT_TARGET} diff --git a/meta-phosphor/recipes-phosphor/dbus/phosphor-dbus-monitor/phosphor-msl-verify.service b/meta-phosphor/recipes-phosphor/dbus/phosphor-dbus-monitor/phosphor-msl-verify.service new file mode 100644 index 000000000..cbefdeab1 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/dbus/phosphor-dbus-monitor/phosphor-msl-verify.service @@ -0,0 +1,10 @@ +[Unit] +Description=Phosphor MSL Verification +After=mapper-wait@-xyz-openbmc_project-inventory.service +Wants=mapper-wait@-xyz-openbmc_project-inventory.service + +[Service] +Type=oneshot +RemainAfterExit=yes +ExecStart=/usr/bin/env phosphor-msl-verify +SyslogIdentifier=phosphor-msl-verify diff --git a/meta-phosphor/recipes-phosphor/dbus/phosphor-legacy-namespace-mapper-config-native.bb b/meta-phosphor/recipes-phosphor/dbus/phosphor-legacy-namespace-mapper-config-native.bb new file mode 100644 index 000000000..67199f9f0 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/dbus/phosphor-legacy-namespace-mapper-config-native.bb @@ -0,0 +1,10 @@ +SUMMARY="Add /org/openbmc namespace to phosphor-mapper" +DESCRIPTION="Add the legacy /org/openbmc path namespace and \ +org.openbmc nterface prefix to the mapper watch list." + +inherit phosphor-mapper +inherit native +inherit obmc-phosphor-license + +PHOSPHOR_MAPPER_NAMESPACE_append = " /org/openbmc" +PHOSPHOR_MAPPER_INTERFACE_append = " org.openbmc" diff --git a/meta-phosphor/recipes-phosphor/dbus/phosphor-mapper-config-native.bb b/meta-phosphor/recipes-phosphor/dbus/phosphor-mapper-config-native.bb new file mode 100644 index 000000000..976c59b9c --- /dev/null +++ b/meta-phosphor/recipes-phosphor/dbus/phosphor-mapper-config-native.bb @@ -0,0 +1,41 @@ +SUMMARY = "Phosphor Mapper Configuration" +DESCRIPTION = "Meta-recipe, pulling in native recipes that wish to add \ +configuration files to the native /usr/share/phosphor-mapper filesystem." +HOMEPAGE = "http://github.com/openbmc/phosphor-objmgr" +PR = "r1" + +inherit obmc-phosphor-license +inherit native +inherit phosphor-mapper + +PHOSPHOR_MAPPER_CONFIGS = " \ + phosphor-dbus-interfaces-mapper-config-native \ + phosphor-legacy-namespace-mapper-config-native \ + " + +DEPENDS += "${PHOSPHOR_MAPPER_CONFIGS}" + +# To add namespaces and blacklists to the mapper configuration, +# create a native recipe in your layer, and add it to +# PHOSPHOR_MAPPER_CONFIGS with a bbappend to this recipe. +# Recipes should set one of the variables below. +# Consult phosphor-mapper.bbclass for additional information. + +# Add path namespaces to be monitored. +PHOSPHOR_MAPPER_NAMESPACE = "" + +# Add interfaces to be monitored. +PHOSPHOR_MAPPER_INTERFACE = "" + +# Blacklist paths from being monitored. +PHOSPHOR_MAPPER_NAMESPACE_BLACKLIST = "" + +# Blacklist interfaces from being monitored. +PHOSPHOR_MAPPER_INTERFACE_BLACKLIST = "" + +do_install() { + install -d ${D}/${namespace_dir} + install -d ${D}/${interface_dir} + install -d ${D}/${blacklist_dir} + install -d ${D}/${interfaceblacklist_dir} +} diff --git a/meta-phosphor/recipes-phosphor/dbus/phosphor-mapper.bb b/meta-phosphor/recipes-phosphor/dbus/phosphor-mapper.bb new file mode 100644 index 000000000..ed7d4bb55 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/dbus/phosphor-mapper.bb @@ -0,0 +1,96 @@ +SUMMARY = "Phosphor DBUS Object Manager" +DESCRIPTION = "Phosphor DBUS object manager." +HOMEPAGE = "http://github.com/openbmc/phosphor-objmgr" +PR = "r1" +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=fa818a259cbed7ce8bc2a22d35a464fc" + +inherit autotools pkgconfig +inherit obmc-phosphor-python-autotools +inherit obmc-phosphor-dbus-service +inherit obmc-phosphor-systemd +inherit phosphor-mapperdir + +DEPENDS += "systemd" +DEPENDS += "autoconf-archive-native" +DEPENDS += "sdbusplus" +DEPENDS += "phosphor-logging" +DEPENDS += "${PN}-config-native" + +DBUS_SERVICE_${PN} += "xyz.openbmc_project.ObjectMapper.service" +SYSTEMD_SERVICE_${PN} += " \ + mapper-wait@.service \ + mapper-subtree-remove@.service \ + " +RDEPENDS_libmapper += "libsystemd" +RDEPENDS_${PN} += " \ + python-argparse \ + python-xml \ + python-dbus \ + python-pygobject \ + pyphosphor-dbus \ + pyphosphor-utils \ + sdbusplus \ + phosphor-logging \ + " +SRC_URI += "git://github.com/openbmc/phosphor-objmgr" + +SRCREV = "d6729ea39d443bf62a27bbf64ef6bc7a123125c8" + +S = "${WORKDIR}/git" + +python populate_packages_prepend () { + mapperlibdir = d.getVar("libdir", True) + do_split_packages(d, mapperlibdir, '^lib(.*)\.so\.*', 'lib%s', 'Phosphor mapper %s library', extra_depends='', allow_links=True) +} +PACKAGES_DYNAMIC += "^libmapper.*" +FILES_${PN}_remove = "${libdir}/lib*.so.* ${libdir}/*" + +# Construct a systemd environment file with mapper commandline +# from the native sysroot /usr/share/phosphor-mapper filesystem. +python do_emit_env() { + path = d.getVar('STAGING_DIR_NATIVE', True) + \ + d.getVar('namespace_dir', True) + paths = [] + for p in os.listdir(path): + paths.append(os.sep.join(p.split('-'))) + + path = d.getVar('STAGING_DIR_NATIVE', True) + \ + d.getVar('interface_dir', True) + interfaces = [] + for i in os.listdir(path): + interfaces.append('.'.join(i.split('-'))) + + path = d.getVar('STAGING_DIR_NATIVE', True) + \ + d.getVar('blacklist_dir', True) + blacklists = [] + for b in os.listdir(path): + blacklists.append(os.sep + os.sep.join(b.split('-'))) + + path = d.getVar('STAGING_DIR_NATIVE', True) + \ + d.getVar('interfaceblacklist_dir', True) + interface_blacklists = [] + for ib in os.listdir(path): + interface_blacklists.append('.'.join(ib.split('-'))) + + path = [d.getVar('D', True) + d.getVar('envfiledir', True)] + path.append('obmc') + path.append('mapper') + parent = os.path.join(*path[:-1]) + path = os.path.join(*path) + + if not os.path.exists(parent): + os.makedirs(parent) + with open(path, 'w+') as fd: + fd.write('MAPPER_NAMESPACES="{}"'.format(' '.join(paths))) + fd.write('\n') + fd.write('MAPPER_INTERFACES="{}"'.format(' '.join(interfaces))) + fd.write('\n') + fd.write('MAPPER_BLACKLISTS="{}"'.format(' '.join(blacklists))) + fd.write('\n') + fd.write('MAPPER_INTERFACEBLACKLISTS="{}"'.format(' '.join(interface_blacklists))) + fd.write('\n') +} + +do_install[postfuncs] += "do_emit_env" +do_install[vardeps] += "PHOSPHOR_MAPPER_NAMESPACES" diff --git a/meta-phosphor/recipes-phosphor/dbus/phosphor-mapper/mapper-subtree-remove@.service b/meta-phosphor/recipes-phosphor/dbus/phosphor-mapper/mapper-subtree-remove@.service new file mode 100644 index 000000000..4bd411e75 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/dbus/phosphor-mapper/mapper-subtree-remove@.service @@ -0,0 +1,22 @@ +[Unit] +Description=mapper subtree-remove %I +Wants=obmc-mapper.target +After=obmc-mapper.target + +[Service] +# We are using a Type=simple service instead of the normal Type=oneshot +# since Type=oneshot can't have Restart= lines +# https://github.com/systemd/systemd/issues/2582 +# Unfortunately Type=oneshot services halt any services which order after +# the oneshot on the completion of ExecStart= lines. For Type=simple, the +# halting is only until ExecStartPre lines have completed and ExecStart has +# begun executing. Since we want to wait for the `mapper wait` process to +# finish, it must be an ExecStartPre. All Type=simple services require an +# ExecStart so we use `true` as a placeholder to satisfy the requirement. +Type=simple +RemainAfterExit=no +Restart=on-failure +TimeoutStartSec=infinity +ExecStartPre=/usr/bin/env mapper subtree-remove %I +ExecStart=/usr/bin/env true +SyslogIdentifier=mapper diff --git a/meta-phosphor/recipes-phosphor/dbus/phosphor-mapper/mapper-wait@.service b/meta-phosphor/recipes-phosphor/dbus/phosphor-mapper/mapper-wait@.service new file mode 100644 index 000000000..f7744e2d8 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/dbus/phosphor-mapper/mapper-wait@.service @@ -0,0 +1,22 @@ +[Unit] +Description=Wait for %I +Wants=obmc-mapper.target +After=obmc-mapper.target + +[Service] +# We are using a Type=simple service instead of the normal Type=oneshot +# since Type=oneshot can't have Restart= lines +# https://github.com/systemd/systemd/issues/2582 +# Unfortunately Type=oneshot services halt any services which order after +# the oneshot on the completion of ExecStart= lines. For Type=simple, the +# halting is only until ExecStartPre lines have completed and ExecStart has +# begun executing. Since we want to wait for the `mapper wait` process to +# finish, it must be an ExecStartPre. All Type=simple services require an +# ExecStart so we use `true` as a placeholder to satisfy the requirement. +Type=simple +RemainAfterExit=yes +Restart=on-failure +TimeoutStartSec=infinity +ExecStartPre=/usr/bin/env mapper wait %I +ExecStart=/usr/bin/env true +SyslogIdentifier=mapper diff --git a/meta-phosphor/recipes-phosphor/dbus/phosphor-mapper/xyz.openbmc_project.ObjectMapper.conf b/meta-phosphor/recipes-phosphor/dbus/phosphor-mapper/xyz.openbmc_project.ObjectMapper.conf new file mode 100644 index 000000000..3d9fcc327 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/dbus/phosphor-mapper/xyz.openbmc_project.ObjectMapper.conf @@ -0,0 +1,8 @@ +<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN" + "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd"> +<busconfig> + <policy user="root"> + <allow own="xyz.openbmc_project.ObjectMapper"/> + <allow send_destination="xyz.openbmc_project.ObjectMapper"/> + </policy> +</busconfig> diff --git a/meta-phosphor/recipes-phosphor/dbus/phosphor-mapper/xyz.openbmc_project.ObjectMapper.service b/meta-phosphor/recipes-phosphor/dbus/phosphor-mapper/xyz.openbmc_project.ObjectMapper.service new file mode 100644 index 000000000..aeb734da7 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/dbus/phosphor-mapper/xyz.openbmc_project.ObjectMapper.service @@ -0,0 +1,21 @@ +[Unit] +Description=Phosphor DBus Service Discovery Manager +Before=obmc-mapper.target +After=dbus.service + +[Service] +Restart=always +Type=dbus +ExecStart=/usr/bin/env phosphor-mapper \ + --path_namespaces="${{MAPPER_NAMESPACES}}" \ + --interface_namespaces="${{MAPPER_INTERFACES}}" \ + --blacklists="${{MAPPER_BLACKLISTS}}" \ + --interface_blacklists="${{MAPPER_INTERFACEBLACKLISTS}}" +SyslogIdentifier=phosphor-mapper +BusName={BUSNAME} +TimeoutStartSec=300 +EnvironmentFile={envfiledir}/obmc/mapper +Environment="PYTHONUNBUFFERED=1" + +[Install] +WantedBy={SYSTEMD_DEFAULT_TARGET} |