summaryrefslogtreecommitdiff
path: root/meta-phosphor/recipes-phosphor/sensors
diff options
context:
space:
mode:
authorEd Tanous <edtanous@google.com>2022-09-19 19:13:20 +0300
committerPatrick Williams <patrick@stwcx.xyz>2022-09-20 17:02:39 +0300
commit9936f86df6fc55be042cec5eb15f6e19a9e7c890 (patch)
tree251861f6bba6451ddfe328558097f6abf438d8d6 /meta-phosphor/recipes-phosphor/sensors
parentbb8f0657781d78264d08d324853f94bd1abc8efa (diff)
downloadopenbmc-9936f86df6fc55be042cec5eb15f6e19a9e7c890.tar.xz
Run oe-stylize on our files
In all of our recipes, we should be following yoctos lead on formatting, order, and other things, for consistency in our meta layers. This commit runs oe-stylize.py on all of our files. The types of changes being made can be seen in the commit, but amount to: 1. Setting an explicit key ordering 2. Sectioning the files appropriately 3. Applying rules checking to our files At some point in the near future, we would turn this on as part of repotest, but some minor changes need to be upstreamed to meta-oe (WIP) to make that happen. Looking for input on whether this is something we'd like to do, and whether the diffs below look reasonable to folks. Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I489dd21d38a9fe4f3ece89cc7a5e1d0463224abf
Diffstat (limited to 'meta-phosphor/recipes-phosphor/sensors')
-rw-r--r--meta-phosphor/recipes-phosphor/sensors/dbus-sensors_git.bb33
-rw-r--r--meta-phosphor/recipes-phosphor/sensors/phosphor-hwmon-config-mrw.bb16
-rw-r--r--meta-phosphor/recipes-phosphor/sensors/phosphor-hwmon_git.bb50
-rw-r--r--meta-phosphor/recipes-phosphor/sensors/phosphor-nvme_git.bb13
-rw-r--r--meta-phosphor/recipes-phosphor/sensors/phosphor-virtual-sensor_git.bb13
5 files changed, 49 insertions, 76 deletions
diff --git a/meta-phosphor/recipes-phosphor/sensors/dbus-sensors_git.bb b/meta-phosphor/recipes-phosphor/sensors/dbus-sensors_git.bb
index 3b012f764a..8c5b27711c 100644
--- a/meta-phosphor/recipes-phosphor/sensors/dbus-sensors_git.bb
+++ b/meta-phosphor/recipes-phosphor/sensors/dbus-sensors_git.bb
@@ -1,14 +1,17 @@
SUMMARY = "dbus-sensors"
DESCRIPTION = "Dbus Sensor Services Configured from D-Bus"
-
-SRC_URI = "git://github.com/openbmc/dbus-sensors.git;branch=master;protocol=https"
-SRCREV = "e330c0c1feedc765f8bef3fc0215c764e43bfc5c"
-
-PV = "0.1+git${SRCPV}"
-
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://LICENSE;md5=86d3f3a95c324c9479bd8986968f4327"
-
+DEPENDS = " \
+ boost \
+ i2c-tools \
+ libgpiod \
+ liburing \
+ nlohmann-json \
+ phosphor-logging \
+ sdbusplus \
+ "
+SRCREV = "e330c0c1feedc765f8bef3fc0215c764e43bfc5c"
PACKAGECONFIG ??= " \
adcsensor \
intelcpusensor \
@@ -21,7 +24,6 @@ PACKAGECONFIG ??= " \
psusensor \
external \
"
-
PACKAGECONFIG[adcsensor] = "-Dadc=enabled, -Dadc=disabled"
PACKAGECONFIG[intelcpusensor] = "-Dintel-cpu=enabled, -Dintel-cpu=disabled"
PACKAGECONFIG[exitairtempsensor] = "-Dexit-air=enabled, -Dexit-air=disabled"
@@ -33,6 +35,9 @@ PACKAGECONFIG[mcutempsensor] = "-Dmcu=enabled, -Dmcu=disabled"
PACKAGECONFIG[psusensor] = "-Dpsu=enabled, -Dpsu=disabled"
PACKAGECONFIG[nvmesensor] = "-Dnvme=enabled, -Dnvme=disabled"
PACKAGECONFIG[external] = "-Dexternal=enabled, -Dexternal=disabled"
+PV = "0.1+git${SRCPV}"
+
+SRC_URI = "git://github.com/openbmc/dbus-sensors.git;branch=master;protocol=https"
SYSTEMD_SERVICE:${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'adcsensor', \
'xyz.openbmc_project.adcsensor.service', \
@@ -67,18 +72,8 @@ SYSTEMD_SERVICE:${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'nvmesensor', \
SYSTEMD_SERVICE:${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'external', \
'xyz.openbmc_project.externalsensor.service', \
'', d)}"
+S = "${WORKDIR}/git"
-DEPENDS = " \
- boost \
- i2c-tools \
- libgpiod \
- liburing \
- nlohmann-json \
- phosphor-logging \
- sdbusplus \
- "
inherit pkgconfig meson systemd
-S = "${WORKDIR}/git"
-
EXTRA_OEMESON:append = " -Dtests=disabled"
diff --git a/meta-phosphor/recipes-phosphor/sensors/phosphor-hwmon-config-mrw.bb b/meta-phosphor/recipes-phosphor/sensors/phosphor-hwmon-config-mrw.bb
index d1e97c4e0d..6cc04ac622 100644
--- a/meta-phosphor/recipes-phosphor/sensors/phosphor-hwmon-config-mrw.bb
+++ b/meta-phosphor/recipes-phosphor/sensors/phosphor-hwmon-config-mrw.bb
@@ -1,54 +1,44 @@
SUMMARY = "Phosphor hwmon configuration generator"
DESCRIPTION = "Generate phosphor-hwmon configuration from an MRW."
-PR = "r1"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
+DEPENDS += "mrw-perl-tools-native mrw-native"
+PR = "r1"
inherit allarch
inherit mrw-xml
-DEPENDS += "mrw-perl-tools-native mrw-native"
-
do_compile:append() {
${STAGING_BINDIR_NATIVE}/perl-native/perl \
${STAGING_BINDIR_NATIVE}/hwmon.pl \
-x ${mrw_datadir}/${MRW_XML} \
-d ${WORKDIR}/mrw-config-files
}
+do_install[postfuncs] += "install_conf_files"
def find_conf_files(dir):
from fnmatch import fnmatch
myfiles = []
-
#These conf files generated by hwmon.pl are in
#subdirectories which we need to preserve the path to.
for root, dirs, files in os.walk(dir):
for name in files:
if fnmatch(name, "*.conf"):
myfiles.append(os.path.join(root, name))
-
return myfiles
-
python install_conf_files() {
from shutil import copy
-
conf_file_dir = os.path.join(
d.getVar("WORKDIR", True),
'mrw-config-files')
files = find_conf_files(conf_file_dir)
-
install_dir = os.path.join(d.getVar("D", True),
"etc", "default", "obmc", "hwmon")
-
dir_len = len(conf_file_dir)
-
for f in files:
dest = os.path.join(install_dir, f[dir_len + 1:])
parent = os.path.dirname(dest)
if not os.path.exists(parent):
os.makedirs(parent)
-
copy(f, dest)
}
-
-do_install[postfuncs] += "install_conf_files"
diff --git a/meta-phosphor/recipes-phosphor/sensors/phosphor-hwmon_git.bb b/meta-phosphor/recipes-phosphor/sensors/phosphor-hwmon_git.bb
index 160abb2d99..516fc815f4 100644
--- a/meta-phosphor/recipes-phosphor/sensors/phosphor-hwmon_git.bb
+++ b/meta-phosphor/recipes-phosphor/sensors/phosphor-hwmon_git.bb
@@ -1,23 +1,7 @@
SUMMARY = "OpenBMC hwmon poller"
DESCRIPTION = "OpenBMC hwmon poller."
-PR = "r1"
-PV = "1.0+git${SRCPV}"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://LICENSE;md5=fa818a259cbed7ce8bc2a22d35a464fc"
-
-inherit pkgconfig meson
-inherit obmc-phosphor-systemd
-
-PACKAGECONFIG ??= ""
-# Meson configure option to enable/disable max31785-msl
-PACKAGECONFIG[max31785-msl] = "-Denable-max31785-msl=true, -Denable-max31785-msl=false"
-
-PACKAGE_BEFORE_PN = "max31785-msl"
-SYSTEMD_PACKAGES = "${PN} max31785-msl"
-
-SYSTEMD_SERVICE:${PN} = "xyz.openbmc_project.Hwmon@.service"
-SYSTEMD_SERVICE:max31785-msl = "${@bb.utils.contains('PACKAGECONFIG', 'max31785-msl', 'phosphor-max31785-msl@.service', '', d)}"
-
DEPENDS += " \
sdbusplus \
sdeventplus \
@@ -27,27 +11,37 @@ DEPENDS += " \
gpioplus \
cli11 \
"
+SRCREV = "5e5259bf6710f22d3b78667098e56fa0e4895160"
+PACKAGECONFIG ??= ""
+# Meson configure option to enable/disable max31785-msl
+PACKAGECONFIG[max31785-msl] = "-Denable-max31785-msl=true, -Denable-max31785-msl=false"
+PV = "1.0+git${SRCPV}"
+PR = "r1"
+
+SRC_URI += "git://github.com/openbmc/phosphor-hwmon;branch=master;protocol=https"
+
+SYSTEMD_PACKAGES = "${PN} max31785-msl"
+SYSTEMD_SERVICE:${PN} = "xyz.openbmc_project.Hwmon@.service"
+SYSTEMD_SERVICE:max31785-msl = "${@bb.utils.contains('PACKAGECONFIG', 'max31785-msl', 'phosphor-max31785-msl@.service', '', d)}"
+S = "${WORKDIR}/git"
+
+inherit pkgconfig meson
+inherit obmc-phosphor-systemd
EXTRA_OEMESON:append = " -Dtests=disabled"
-FILES:${PN} += "${base_libdir}/systemd/system/xyz.openbmc_project.Hwmon@.service"
RDEPENDS:${PN} += "\
bash \
"
+RDEPENDS:max31785-msl = "${VIRTUAL-RUNTIME_base-utils} i2c-tools bash"
RRECOMMENDS:${PN} += "${VIRTUAL-RUNTIME_phosphor-hwmon-config}"
+FILES:${PN} += "${base_libdir}/systemd/system/xyz.openbmc_project.Hwmon@.service"
FILES:max31785-msl = "\
${base_libdir}/systemd/system/phosphor-max31785-msl@.service \
${bindir}/max31785-msl \
"
-RDEPENDS:max31785-msl = "${VIRTUAL-RUNTIME_base-utils} i2c-tools bash"
-
-SRC_URI += "git://github.com/openbmc/phosphor-hwmon;branch=master;protocol=https"
-
-SRCREV = "5e5259bf6710f22d3b78667098e56fa0e4895160"
-
-S = "${WORKDIR}/git"
# The following postinstall script iterate over hwmon env files:
# 1. It adds HW_SENSOR_ID value if not set. The value being calculated
@@ -56,7 +50,6 @@ S = "${WORKDIR}/git"
pkg_postinst:${PN}() {
hwmon_dir="$D/etc/default/obmc/hwmon"
dbus_dir="$D/${datadir}/dbus-1/system.d"
-
if [ -n "$D" -a -d "${hwmon_dir}" ]; then
# Remove existing links and replace with actual copy of the file to prevent
# HW_SENSOR_ID variable override for different sensors' instances.
@@ -65,22 +58,17 @@ pkg_postinst:${PN}() {
rm -f "${f}"
cp "${path}" "${f}"
done
-
find "${hwmon_dir}" -type f -name \*.conf | while read f; do
path="/${f##${hwmon_dir}/}"
path="${path%.conf}"
sensor_id="$(printf "%s" "${path}" | sha256sum | cut -d\ -f1)"
acl_file="${dbus_dir}/xyz.openbmc_project.Hwmon-${sensor_id}.conf"
-
egrep -q '^HW_SENSOR_ID\s*=' "${f}" ||
printf "\n# Sensor id for %s\nHW_SENSOR_ID = \"%s\"\n" "${path}" "${sensor_id}" >> "${f}"
-
# Extract HW_SENSOR_ID that could be either quoted or unquoted string.
sensor_id="$(sed -n 's,^HW_SENSOR_ID\s*=\s*"\?\(.[^" ]\+\)\s*"\?,\1,p' "${f}")"
-
[ ! -f "${acl_file}" ] || continue
path_s="$(echo "${path}" | sed 's,\-\-,\\-\\-,g')"
-
cat <<EOF>"${acl_file}"
<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
@@ -95,3 +83,5 @@ EOF
done
fi
}
+
+PACKAGE_BEFORE_PN = "max31785-msl"
diff --git a/meta-phosphor/recipes-phosphor/sensors/phosphor-nvme_git.bb b/meta-phosphor/recipes-phosphor/sensors/phosphor-nvme_git.bb
index be336de19e..1346ddda68 100644
--- a/meta-phosphor/recipes-phosphor/sensors/phosphor-nvme_git.bb
+++ b/meta-phosphor/recipes-phosphor/sensors/phosphor-nvme_git.bb
@@ -1,21 +1,20 @@
SUMMARY = "NVMe Drive Manager"
DESCRIPTION = "Daemon to monitor and report the status of NVMe drives"
HOMEPAGE = "https://github.com/openbmc/phosphor-nvme"
-PR = "r1"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://LICENSE;md5=86d3f3a95c324c9479bd8986968f4327"
-
-inherit meson pkgconfig
-inherit systemd
-
DEPENDS += "sdbusplus"
DEPENDS += "phosphor-dbus-interfaces"
DEPENDS += "sdeventplus"
DEPENDS += "phosphor-logging"
DEPENDS += "nlohmann-json"
+SRCREV = "d4f5199251f2acbcf007c9bc163fd65d3695655b"
+PR = "r1"
SRC_URI = "git://github.com/openbmc/phosphor-nvme.git;protocol=https;branch=master"
-SRCREV = "d4f5199251f2acbcf007c9bc163fd65d3695655b"
-S = "${WORKDIR}/git"
+S = "${WORKDIR}/git"
SYSTEMD_SERVICE:${PN} = "xyz.openbmc_project.nvme.manager.service"
+
+inherit meson pkgconfig
+inherit systemd
diff --git a/meta-phosphor/recipes-phosphor/sensors/phosphor-virtual-sensor_git.bb b/meta-phosphor/recipes-phosphor/sensors/phosphor-virtual-sensor_git.bb
index d714e263ff..7af012c025 100644
--- a/meta-phosphor/recipes-phosphor/sensors/phosphor-virtual-sensor_git.bb
+++ b/meta-phosphor/recipes-phosphor/sensors/phosphor-virtual-sensor_git.bb
@@ -1,13 +1,8 @@
SUMMARY = "Virtual Sensors"
DESCRIPTION = "virtual sensors created from existing sensors and config data"
HOMEPAGE = "https://github.com/openbmc/phosphor-virtual-sensor"
-PR = "r1"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://LICENSE;md5=9e69ba356fa59848ffd865152a3ccc13"
-
-inherit meson pkgconfig
-inherit systemd
-
DEPENDS:append = "\
exprtk \
nlohmann-json \
@@ -15,9 +10,13 @@ DEPENDS:append = "\
phosphor-logging \
sdbusplus \
"
+SRCREV = "dc7770153b8fdfca26f1e7fd038033dff6b20456"
+PR = "r1"
SRC_URI = "git://github.com/openbmc/phosphor-virtual-sensor.git;protocol=https;branch=master"
-SRCREV = "dc7770153b8fdfca26f1e7fd038033dff6b20456"
-S = "${WORKDIR}/git"
+S = "${WORKDIR}/git"
SYSTEMD_SERVICE:${PN} = "phosphor-virtual-sensor.service"
+
+inherit meson pkgconfig
+inherit systemd