chassis-power: Create initial application
Create the new chassis power monitor application and a service file that
would start it. Make the new application available via a meson option.
Tested: Verified the service and application start with no errors.
```
root@p10bmc:~# systemctl status phosphor-chassis-power.service
● phosphor-chassis-power.service - Chassis Power Monitor
Loaded: loaded
(/usr/lib/systemd/system/phosphor-chassis-power.service; enabled;
preset: enabled)
Active: active (running) since Mon 2025-11-10 19:08:09 UTC; 4min 28s ago
Invocation: 6f0cac0ee4e04066b68ba448aa2d7ccc
Main PID: 549 (phosphor-chassi)
CPU: 29ms
CGroup: /system.slice/phosphor-chassis-power.service
└─549 /usr/libexec/phosphor-power/phosphor-chassis-power
Nov 10 19:08:09 p10bmc systemd[1]: Started Chassis Power Monitor.
root@p10bmc:~# ps |grep chassis
549 root 14928 S /usr/libexec/phosphor-power/phosphor-chassis-power
```
Change-Id: Ia0ab5bc6c578b8203f09feec9b6927059db0f883
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
diff --git a/meson.build b/meson.build
index 9fe350c..7843cd3 100644
--- a/meson.build
+++ b/meson.build
@@ -112,6 +112,7 @@
servicedir = systemd.get_variable('systemd_system_unit_dir')
services = [
+ ['chassis-power', 'phosphor-chassis-power.service'],
['supply-monitor', 'power-supply-monitor@.service'],
['sequencer-monitor', 'pseq-monitor-pgood.service'],
['sequencer-monitor', 'pseq-monitor.service'],
@@ -200,6 +201,9 @@
if get_option('regulators')
subdir('phosphor-regulators')
endif
+if get_option('chassis-power')
+ subdir('phosphor-chassis-power')
+endif
if get_option('sequencer-monitor')
subdir('power-sequencer')
endif
diff --git a/meson.options b/meson.options
index c701960..296c672 100644
--- a/meson.options
+++ b/meson.options
@@ -64,6 +64,11 @@
description: 'Enable support for cold redundancy',
)
option(
+ 'chassis-power',
+ type: 'boolean',
+ description: 'Enable support for chassis power monitoring',
+)
+option(
'supply-monitor',
type: 'boolean',
description: 'Enable support for power supply monitoring',
diff --git a/phosphor-chassis-power/meson.build b/phosphor-chassis-power/meson.build
new file mode 100644
index 0000000..9537275
--- /dev/null
+++ b/phosphor-chassis-power/meson.build
@@ -0,0 +1 @@
+subdir('src')
diff --git a/phosphor-chassis-power/src/main.cpp b/phosphor-chassis-power/src/main.cpp
new file mode 100644
index 0000000..f75994a
--- /dev/null
+++ b/phosphor-chassis-power/src/main.cpp
@@ -0,0 +1,10 @@
+// SPDX-License-Identifier: Apache-2.0
+// SPDX-FileCopyrightText: Copyright 2025 IBM Corporation
+
+#include <sdbusplus/async.hpp>
+
+int main()
+{
+ sdbusplus::async::context ctx;
+ ctx.run();
+}
diff --git a/phosphor-chassis-power/src/meson.build b/phosphor-chassis-power/src/meson.build
new file mode 100644
index 0000000..e70cd02
--- /dev/null
+++ b/phosphor-chassis-power/src/meson.build
@@ -0,0 +1,7 @@
+phosphor_chassis_power = executable(
+ 'phosphor-chassis-power',
+ 'main.cpp',
+ dependencies: [sdbusplus],
+ install: true,
+ install_dir: get_option('libexecdir') / 'phosphor-power',
+)
diff --git a/services/phosphor-chassis-power.service b/services/phosphor-chassis-power.service
new file mode 100644
index 0000000..e1b0d3a
--- /dev/null
+++ b/services/phosphor-chassis-power.service
@@ -0,0 +1,9 @@
+[Unit]
+Description=Chassis Power Monitor
+
+[Service]
+Restart=always
+ExecStart=/usr/libexec/phosphor-power/phosphor-chassis-power
+
+[Install]
+WantedBy=multi-user.target