Initial commit

This commit is contained in:
Your Name
2026-04-23 17:07:55 +08:00
commit b7e39e063b
16725 changed files with 1625565 additions and 0 deletions
@@ -0,0 +1,79 @@
SUMMARY = "dbus-sensors"
DESCRIPTION = "Dbus Sensor Services Configured from D-Bus"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://LICENSE;md5=86d3f3a95c324c9479bd8986968f4327"
DEPENDS = " \
boost \
i2c-tools \
libgpiod \
liburing \
nlohmann-json \
phosphor-logging \
sdbusplus \
"
SRCREV = "6e69973ebd248f95483c8c8ee1d656520cda0e2f"
PACKAGECONFIG ??= " \
adcsensor \
intelcpusensor \
exitairtempsensor \
fansensor \
hwmontempsensor \
intrusionsensor \
ipmbsensor \
mcutempsensor \
psusensor \
external \
"
PACKAGECONFIG[adcsensor] = "-Dadc=enabled, -Dadc=disabled"
PACKAGECONFIG[intelcpusensor] = "-Dintel-cpu=enabled, -Dintel-cpu=disabled, libpeci"
PACKAGECONFIG[exitairtempsensor] = "-Dexit-air=enabled, -Dexit-air=disabled"
PACKAGECONFIG[fansensor] = "-Dfan=enabled, -Dfan=disabled"
PACKAGECONFIG[hwmontempsensor] = "-Dhwmon-temp=enabled, -Dhwmon-temp=disabled"
PACKAGECONFIG[intrusionsensor] = "-Dintrusion=enabled, -Dintrusion=disabled"
PACKAGECONFIG[ipmbsensor] = "-Dipmb=enabled, -Dipmb=disabled"
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', \
'', d)}"
SYSTEMD_SERVICE:${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'intelcpusensor', \
'xyz.openbmc_project.intelcpusensor.service', \
'', d)}"
SYSTEMD_SERVICE:${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'exitairtempsensor', \
'xyz.openbmc_project.exitairsensor.service', \
'', d)}"
SYSTEMD_SERVICE:${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'fansensor', \
'xyz.openbmc_project.fansensor.service', \
'', d)}"
SYSTEMD_SERVICE:${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'hwmontempsensor', \
'xyz.openbmc_project.hwmontempsensor.service', \
'', d)}"
SYSTEMD_SERVICE:${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'intrusionsensor', \
'xyz.openbmc_project.intrusionsensor.service', \
'', d)}"
SYSTEMD_SERVICE:${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'ipmbsensor', \
'xyz.openbmc_project.ipmbsensor.service', \
'', d)}"
SYSTEMD_SERVICE:${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'mcutempsensor', \
'xyz.openbmc_project.mcutempsensor.service', \
'', d)}"
SYSTEMD_SERVICE:${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'psusensor', \
'xyz.openbmc_project.psusensor.service', \
'', d)}"
SYSTEMD_SERVICE:${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'nvmesensor', \
'xyz.openbmc_project.nvmesensor.service', \
'', d)}"
SYSTEMD_SERVICE:${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'external', \
'xyz.openbmc_project.externalsensor.service', \
'', d)}"
S = "${WORKDIR}/git"
inherit pkgconfig meson systemd
EXTRA_OEMESON:append = " -Dtests=disabled"
@@ -0,0 +1,44 @@
SUMMARY = "Phosphor hwmon configuration generator"
DESCRIPTION = "Generate phosphor-hwmon configuration from an MRW."
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
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)
}
@@ -0,0 +1,87 @@
SUMMARY = "OpenBMC hwmon poller"
DESCRIPTION = "OpenBMC hwmon poller."
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://LICENSE;md5=fa818a259cbed7ce8bc2a22d35a464fc"
DEPENDS += " \
sdbusplus \
sdeventplus \
stdplus \
phosphor-dbus-interfaces \
phosphor-logging \
gpioplus \
cli11 \
"
SRCREV = "24b8b4be970866666988e8993c1f51c317f6b8ef"
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"
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 \
"
# The following postinstall script iterate over hwmon env files:
# 1. It adds HW_SENSOR_ID value if not set. The value being calculated
# as sha256sum.
# 2. For each hwmon the script generates busconfig ACLs.
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.
find "${hwmon_dir}" -type l -name \*.conf | while read f; do
path="$(readlink -f $f)"
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">
<busconfig>
<policy user="root">
<!-- ${path_s} -->
<allow own="xyz.openbmc_project.Hwmon-${sensor_id}.Hwmon1"/>
<allow send_destination="xyz.openbmc_project.Hwmon-${sensor_id}.Hwmon1"/>
</policy>
</busconfig>
EOF
done
fi
}
PACKAGE_BEFORE_PN = "max31785-msl"
@@ -0,0 +1,21 @@
SUMMARY = "NVMe Drive Manager"
DESCRIPTION = "Daemon to monitor and report the status of NVMe drives"
HOMEPAGE = "https://github.com/openbmc/phosphor-nvme"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://LICENSE;md5=86d3f3a95c324c9479bd8986968f4327"
DEPENDS += "sdbusplus"
DEPENDS += "phosphor-dbus-interfaces"
DEPENDS += "sdeventplus"
DEPENDS += "phosphor-logging"
DEPENDS += "nlohmann-json"
SRCREV = "839141e51099b110418d440e7886655b2c546d3f"
PV = "0.1+git${SRCPV}"
PR = "r1"
SRC_URI = "git://github.com/openbmc/phosphor-nvme.git;protocol=https;branch=master"
S = "${WORKDIR}/git"
SYSTEMD_SERVICE:${PN} = "xyz.openbmc_project.nvme.manager.service"
inherit meson pkgconfig
inherit systemd
@@ -0,0 +1,23 @@
SUMMARY = "Virtual Sensors"
DESCRIPTION = "virtual sensors created from existing sensors and config data"
HOMEPAGE = "https://github.com/openbmc/phosphor-virtual-sensor"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://LICENSE;md5=9e69ba356fa59848ffd865152a3ccc13"
DEPENDS:append = "\
exprtk \
nlohmann-json \
phosphor-dbus-interfaces \
phosphor-logging \
sdbusplus \
"
SRCREV = "ce4241cb7173b41ace52a272dc6a52295f949385"
PV = "0.1+git${SRCPV}"
PR = "r1"
SRC_URI = "git://github.com/openbmc/phosphor-virtual-sensor.git;protocol=https;branch=master"
S = "${WORKDIR}/git"
SYSTEMD_SERVICE:${PN} = "phosphor-virtual-sensor.service"
inherit meson pkgconfig
inherit systemd