Initial commit
This commit is contained in:
+11
@@ -0,0 +1,11 @@
|
||||
[Unit]
|
||||
Description=RL300 power supply 1 monitoring
|
||||
After=dbus.service
|
||||
|
||||
[Service]
|
||||
Restart=always
|
||||
RestartSec=5
|
||||
ExecStart=startMonitoring1.sh
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
@@ -0,0 +1,10 @@
|
||||
[
|
||||
{
|
||||
"Name": "PowerGoodUp",
|
||||
"LineName": "PSU1_INST",
|
||||
"EventMon": "BOTH",
|
||||
"TargetRising": "psu1up.service",
|
||||
"TargetFalling": "psu1down.service",
|
||||
"Continue": true
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,8 @@
|
||||
[Unit]
|
||||
Description=HPE RL300 PSU1 Manager
|
||||
|
||||
[Service]
|
||||
ExecStart=/usr/bin/psus-manager.sh 1 down
|
||||
|
||||
[Install]
|
||||
# WantedBy=multi-user.target
|
||||
@@ -0,0 +1,8 @@
|
||||
[Unit]
|
||||
Description=HPE RL300 PSU1 Manager
|
||||
|
||||
[Service]
|
||||
ExecStart=/usr/bin/psus-manager.sh 1 up
|
||||
|
||||
[Install]
|
||||
# WantedBy=multi-user.target
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
[Unit]
|
||||
Description=RL300 power supply 2 monitoring
|
||||
After=dbus.service
|
||||
|
||||
[Service]
|
||||
Restart=always
|
||||
RestartSec=5
|
||||
ExecStart=startMonitoring2.sh
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
@@ -0,0 +1,10 @@
|
||||
[
|
||||
{
|
||||
"Name": "psu2",
|
||||
"LineName": "PSU2_INST",
|
||||
"EventMon": "BOTH",
|
||||
"TargetRising": "psu2up.service",
|
||||
"TargetFalling": "psu2down.service",
|
||||
"Continue": true
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,8 @@
|
||||
[Unit]
|
||||
Description=HPE RL300 PSU2 Manager
|
||||
|
||||
[Service]
|
||||
ExecStart=/usr/bin/psus-manager.sh 2 down
|
||||
|
||||
[Install]
|
||||
# WantedBy=multi-user.target
|
||||
@@ -0,0 +1,8 @@
|
||||
[Unit]
|
||||
Description=HPE RL300 PSU2 Manager
|
||||
|
||||
[Service]
|
||||
ExecStart=/usr/bin/psus-manager.sh 2 up
|
||||
|
||||
[Install]
|
||||
# WantedBy=multi-user.target
|
||||
@@ -0,0 +1,7 @@
|
||||
#!/bin/sh
|
||||
# we need to restart FRU service and PSU Monitor everything else shall be ok
|
||||
systemctl stop xyz.openbmc_project.psusensor.service
|
||||
systemctl stop xyz.openbmc_project.GxpFruDevice.service
|
||||
|
||||
systemctl start xyz.openbmc_project.GxpFruDevice.service
|
||||
systemctl start xyz.openbmc_project.psusensor.service
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
#!/bin/sh
|
||||
myaddress=$(gpiofind PSU1_INST)
|
||||
state=$(gpioget "$myaddress")
|
||||
if [ "r$state" = "r1" ]
|
||||
then
|
||||
psus-manager 1 up
|
||||
else
|
||||
psus-manager 1 down
|
||||
fi
|
||||
/usr/bin/phosphor-multi-gpio-monitor --config /usr/share/gpios/psu1.json
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
#!/bin/sh
|
||||
myaddress=$(gpiofind PSU2_INST)
|
||||
state=$(gpioget "$myaddress")
|
||||
if [ "r$state" = "r1" ]
|
||||
then
|
||||
psus-manager 2 up
|
||||
else
|
||||
psus-manager 2 down
|
||||
fi
|
||||
/usr/bin/phosphor-multi-gpio-monitor --config /usr/share/gpios/psu2.json
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
inherit obmc-phosphor-systemd
|
||||
SUMMARY = "Power Supplies monitoring for HPE RL300 Gen11"
|
||||
SYSTEMD_AUTO_ENABLE = "enable"
|
||||
SYSTEMD_SERVICE:${PN} = "psu2-monitoring.service psu1-monitoring.service psu2up.service psu2down.service psu1down.service psu1up.service"
|
||||
SRC_URI:append = " file://psu2-monitoring.service file://psu1-monitoring.service file://psus-manager.sh file://psu2up.service file://psu2down.service file://psu1down.service file://psu1up.service file://psu2.json file://psu1.json file://startMonitoring1.sh file://startMonitoring2.sh"
|
||||
|
||||
LICENSE = "Apache-2.0"
|
||||
LIC_FILES_CHKSUM = "file://${WORKDIR}/LICENSE;md5=89aea4e17d99a7cacdbeed46a0096b10"
|
||||
|
||||
FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
|
||||
IMAGE_INSTALL += "power-supplies-monitoring "
|
||||
|
||||
FILES:${PN} = "/usr/share/gpios/* /usr/bin/* /etc/system/*"
|
||||
|
||||
do_install:append() {
|
||||
install -d ${D}${sysconfdir}/system/
|
||||
install -d ${D}/usr/share/gpios
|
||||
install -d ${D}/usr/bin
|
||||
install -m 0644 ${WORKDIR}/psu1.json ${D}/usr/share/gpios/psu1.json
|
||||
install -m 0644 ${WORKDIR}/psu2.json ${D}/usr/share/gpios/psu2.json
|
||||
install -m 0644 ${WORKDIR}/psu2-monitoring.service ${D}${sysconfdir}/system/psu2-monitoring.service
|
||||
install -m 0644 ${WORKDIR}/psu1-monitoring.service ${D}${sysconfdir}/system/psu1-monitoring.service
|
||||
install -m 0644 ${WORKDIR}/psu2up.service ${D}${sysconfdir}/system/psu2up.service
|
||||
install -m 0644 ${WORKDIR}/psu1up.service ${D}${sysconfdir}/system/psu1up.service
|
||||
install -m 0644 ${WORKDIR}/psu1down.service ${D}${sysconfdir}/system/psu1down.service
|
||||
install -m 0644 ${WORKDIR}/psu1down.service ${D}${sysconfdir}/system/psu1down.service
|
||||
install -m 0755 ${WORKDIR}/psus-manager.sh ${D}/usr/bin/psus-manager.sh
|
||||
install -m 0755 ${WORKDIR}/startMonitoring1.sh ${D}/usr/bin/startMonitoring1.sh
|
||||
install -m 0755 ${WORKDIR}/startMonitoring2.sh ${D}/usr/bin/startMonitoring2.sh
|
||||
}
|
||||
Reference in New Issue
Block a user