From feb8867b4faa4aacb3b648dc3c8c9d597dadc394 Mon Sep 17 00:00:00 2001 From: Deepak Kodihalli Date: Wed, 17 May 2017 06:42:51 -0500 Subject: Add recipe for the new settings manager Change-Id: I28b3454c0066649b0c163616247f9ca1bbf3abb3 Signed-off-by: Deepak Kodihalli --- .../classes/phosphor-settings-manager.bbclass | 1 + .../packagegroups/packagegroup-obmc-apps.bb | 6 ++++ .../settings/phosphor-settings-defaults.bb | 18 ++++++++++++ .../phosphor-settings-defaults/defaults.yaml | 32 ++++++++++++++++++++++ .../settings/phosphor-settings-manager.bb | 28 +++++++++++++++++++ .../settings/phosphor-settings-manager.inc | 5 ++++ .../xyz.openbmc_project.Settings.service | 11 ++++++++ .../conf/distro/include/phosphor-defaults.inc | 5 ++++ 8 files changed, 106 insertions(+) create mode 100644 meta-phosphor/classes/phosphor-settings-manager.bbclass create mode 100644 meta-phosphor/common/recipes-phosphor/settings/phosphor-settings-defaults.bb create mode 100644 meta-phosphor/common/recipes-phosphor/settings/phosphor-settings-defaults/defaults.yaml create mode 100644 meta-phosphor/common/recipes-phosphor/settings/phosphor-settings-manager.bb create mode 100644 meta-phosphor/common/recipes-phosphor/settings/phosphor-settings-manager.inc create mode 100644 meta-phosphor/common/recipes-phosphor/settings/phosphor-settings-manager/xyz.openbmc_project.Settings.service diff --git a/meta-phosphor/classes/phosphor-settings-manager.bbclass b/meta-phosphor/classes/phosphor-settings-manager.bbclass new file mode 100644 index 000000000..7e554f3ce --- /dev/null +++ b/meta-phosphor/classes/phosphor-settings-manager.bbclass @@ -0,0 +1 @@ +settings_datadir="${datadir}/phosphor-settings/default" diff --git a/meta-phosphor/common/recipes-phosphor/packagegroups/packagegroup-obmc-apps.bb b/meta-phosphor/common/recipes-phosphor/packagegroups/packagegroup-obmc-apps.bb index f570c060c..8ce984f2f 100644 --- a/meta-phosphor/common/recipes-phosphor/packagegroups/packagegroup-obmc-apps.bb +++ b/meta-phosphor/common/recipes-phosphor/packagegroups/packagegroup-obmc-apps.bb @@ -19,6 +19,7 @@ PACKAGES = " \ ${PN}-software \ ${PN}-host-check-mgmt \ ${PN}-debug-collector \ + ${PN}-settings \ " SUMMARY_${PN}-bmc-state-mgmt = "BMC state management" @@ -91,3 +92,8 @@ SUMMARY_${PN}-debug-collector = "BMC debug collector" RDEPENDS_${PN}-debug-collector = " \ ${VIRTUAL-RUNTIME_obmc-debug-collector} \ " + +SUMMARY_${PN}-settings = "Settings applications" +RDEPENDS_${PN}-settings = " \ + ${VIRTUAL-RUNTIME_obmc-settings-mgr} \ + " diff --git a/meta-phosphor/common/recipes-phosphor/settings/phosphor-settings-defaults.bb b/meta-phosphor/common/recipes-phosphor/settings/phosphor-settings-defaults.bb new file mode 100644 index 000000000..37b8d4ef6 --- /dev/null +++ b/meta-phosphor/common/recipes-phosphor/settings/phosphor-settings-defaults.bb @@ -0,0 +1,18 @@ +SUMMARY = "Default settings" +PR = "r1" + +inherit native +inherit obmc-phosphor-license +inherit phosphor-settings-manager + +SRC_URI += "file://defaults.yaml" + +PROVIDES += "virtual/phosphor-settings-defaults" + +S = "${WORKDIR}" + +do_install() { + DEST=${D}${settings_datadir} + install -d ${DEST} + install defaults.yaml ${DEST} +} diff --git a/meta-phosphor/common/recipes-phosphor/settings/phosphor-settings-defaults/defaults.yaml b/meta-phosphor/common/recipes-phosphor/settings/phosphor-settings-defaults/defaults.yaml new file mode 100644 index 000000000..b054bb26b --- /dev/null +++ b/meta-phosphor/common/recipes-phosphor/settings/phosphor-settings-defaults/defaults.yaml @@ -0,0 +1,32 @@ +/xyz/openbmc_project/control/host0/auto_reboot: + Interface: xyz.openbmc_project.Control.Boot.RebootPolicy + Defaults: + AutoReboot: 'false' + +/xyz/openbmc_project/control/host0/boot_source: + Interface: xyz.openbmc_project.Control.Boot.Source + Defaults: + BootSource: Source::Sources::Default + +/xyz/openbmc_project/control/host0/boot_mode: + Interface: xyz.openbmc_project.Control.Boot.Mode + Defaults: + BootMode: Mode::Modes::Regular + +/xyz/openbmc_project/control/host0/power_cap: + Interface: xyz.openbmc_project.Control.Power.Cap + +/xyz/openbmc_project/control/host0/power_restore_policy: + Interface: xyz.openbmc_project.Control.Power.RestorePolicy + Defaults: + PowerRestorePolicy: RestorePolicy::Policy::Restore + +/xyz/openbmc_project/time/owner: + Interface: xyz.openbmc_project.Time.Owner + Defaults: + TimeOwner: Owner::Owners::BMC + +/xyz/openbmc_project/time/sync_method: + Interface: xyz.openbmc_project.Time.Synchronization + Defaults: + TimeSyncMethod: Synchronization::Method::NTP diff --git a/meta-phosphor/common/recipes-phosphor/settings/phosphor-settings-manager.bb b/meta-phosphor/common/recipes-phosphor/settings/phosphor-settings-manager.bb new file mode 100644 index 000000000..56db58b4c --- /dev/null +++ b/meta-phosphor/common/recipes-phosphor/settings/phosphor-settings-manager.bb @@ -0,0 +1,28 @@ +SUMMARY = "Phosphor Settings Manager" +DESCRIPTION = "Phosphor Settings Manager is an application that creates \ +d-bus objects to represent various user settings." +PR = "r1" + +inherit autotools +inherit obmc-phosphor-dbus-service +inherit pythonnative +inherit phosphor-settings-manager + +require phosphor-settings-manager.inc + +DBUS_SERVICE_${PN} = "xyz.openbmc_project.Settings.service" + +DEPENDS += "python-pyyaml-native" +DEPENDS += "python-mako-native" +DEPENDS += "autoconf-archive-native" +DEPENDS += "virtual/phosphor-settings-defaults" +DEPENDS += "sdbusplus sdbusplus-native" +DEPENDS += "phosphor-dbus-interfaces phosphor-dbus-interfaces-native" + +RDEPENDS_${PN} += "sdbusplus phosphor-dbus-interfaces" + +S = "${WORKDIR}/git" + +EXTRA_OECONF = " \ + SETTINGS_YAML=${STAGING_DIR_NATIVE}${settings_datadir}/defaults.yaml \ + " diff --git a/meta-phosphor/common/recipes-phosphor/settings/phosphor-settings-manager.inc b/meta-phosphor/common/recipes-phosphor/settings/phosphor-settings-manager.inc new file mode 100644 index 000000000..53287e8d3 --- /dev/null +++ b/meta-phosphor/common/recipes-phosphor/settings/phosphor-settings-manager.inc @@ -0,0 +1,5 @@ +HOMEPAGE = "http://github.com/openbmc/phosphor-settingsd" +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=fa818a259cbed7ce8bc2a22d35a464fc" +SRC_URI += "git://github.com/openbmc/phosphor-settingsd" +SRCREV = "89872291c360dfb33824738c066a2171c3306910" diff --git a/meta-phosphor/common/recipes-phosphor/settings/phosphor-settings-manager/xyz.openbmc_project.Settings.service b/meta-phosphor/common/recipes-phosphor/settings/phosphor-settings-manager/xyz.openbmc_project.Settings.service new file mode 100644 index 000000000..8b4be9c7c --- /dev/null +++ b/meta-phosphor/common/recipes-phosphor/settings/phosphor-settings-manager/xyz.openbmc_project.Settings.service @@ -0,0 +1,11 @@ +[Unit] +Description=Phosphor Settings Daemon + +[Service] +ExecStart={sbindir}/phosphor-settings-manager +Restart=always +Type=dbus +BusName={BUSNAME} + +[Install] +WantedBy={SYSTEMD_DEFAULT_TARGET} diff --git a/meta-phosphor/conf/distro/include/phosphor-defaults.inc b/meta-phosphor/conf/distro/include/phosphor-defaults.inc index 870407535..80a5c8871 100644 --- a/meta-phosphor/conf/distro/include/phosphor-defaults.inc +++ b/meta-phosphor/conf/distro/include/phosphor-defaults.inc @@ -121,6 +121,11 @@ PREFERRED_PROVIDER_virtual/obmc-wsgihost ?= "phosphor-gevent" VIRTUAL-RUNTIME_phosphor-hwmon-config ?= \ "${@cf_enabled(d, 'obmc-mrw', 'phosphor-hwmon-config-mrw')}" +# obmc-settings-mgr +# +# Provides a manager for user settings. +VIRTUAL-RUNTIME_obmc-settings-mgr ?= "phosphor-settings-manager" + # virtual/phosphor-ipmi-fru-hostfw-config # # The phosphor-ipmi-fru application is data-driven and requires an input -- cgit v1.2.3