blob: ea60fcf697730a9e88dc6cde4b7735500a568959 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
#!/bin/bash
# Check current Host status. Do nothing when the Host is currently ON
st=$(busctl get-property xyz.openbmc_project.State.Host \
/xyz/openbmc_project/state/host0 xyz.openbmc_project.State.Host \
CurrentHostState | cut -d"." -f6)
if [ "$st" == "Running\"" ]; then
exit 0
fi
# Time out checking for Host ON is 60s
cnt=60
while [ "$cnt" -gt 0 ];
do
cnt=$((cnt - 1))
st=$(busctl call xyz.openbmc_project.State.HostCondition.Gpio \
/xyz/openbmc_project/Gpios/host0 org.freedesktop.DBus.Properties \
Get ss xyz.openbmc_project.Condition.HostFirmware \
CurrentFirmwareCondition | cut -d"." -f6)
if [ "$st" == "Running\"" ]; then
if command -v ampere_driver_binder.sh;
then
ampere_driver_binder.sh
fi
exit 0
fi
sleep 1
done
exit 1
|