summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Filippov <a.filippov@yadro.com>2019-04-03 16:29:57 +0300
committerAlexander Filippov <a.filippov@yadro.com>2019-04-03 16:29:57 +0300
commit86cffd9cb226b33126cf367cda676e0edcacdf1e (patch)
treed92b68a3e6d23bdb0db93e410e7f3c3765ddf53d
parent64d60978c586435e76211faa4e435368a9f84757 (diff)
downloadphosphor-state-manager-86cffd9cb226b33126cf367cda676e0edcacdf1e.tar.gz
phosphor-state-manager-86cffd9cb226b33126cf367cda676e0edcacdf1e.zip
obmcutil: add more info to state subcommand
Adds new subcommand to request the OS state. Adds bootprogress and osstate to the output of state/status subcommands. Tested: The output of `obmcutil state` must look like: ``` CurrentBMCState : xyz.openbmc_project.State.BMC.BMCState.Ready CurrentPowerState : xyz.openbmc_project.State.Chassis.PowerState.Off CurrentHostState : xyz.openbmc_project.State.Host.HostState.Off BootProgress : xyz.openbmc_project.State.Boot.Progress.ProgressStages.Unspecified OperatingSystemState: xyz.openbmc_project.State.OperatingSystem.Status.OSStatus.Inactive ``` Change-Id: I59937986317fe2ac487d355a627de1070ba813f8 Signed-off-by: Alexander Filippov <a.filippov@yadro.com>
-rw-r--r--obmcutil11
1 files changed, 9 insertions, 2 deletions
diff --git a/obmcutil b/obmcutil
index b70babe..6f1fbd7 100644
--- a/obmcutil
+++ b/obmcutil
@@ -3,7 +3,7 @@
set -euo pipefail
OPTS="bmcstate,bootprogress,chassiskill,chassisoff,chassison,chassisstate,hoststate,\
-power,poweroff,poweron,state,status"
+osstate,power,poweroff,poweron,state,status"
USAGE="Usage: obmcutil [-h] [--wait]
{$OPTS}"
@@ -176,8 +176,15 @@ handle_cmd ()
PROPERTY=CurrentHostState
state_query $SERVICE $OBJECT $INTERFACE $PROPERTY
;;
+ osstate)
+ OBJECT=$STATE_OBJECT/host0
+ SERVICE=$(mapper get-service $OBJECT)
+ INTERFACE=$STATE_INTERFACE.OperatingSystem.Status
+ PROPERTY=OperatingSystemState
+ state_query $SERVICE $OBJECT $INTERFACE $PROPERTY
+ ;;
state|status)
- for query in bmcstate chassisstate hoststate
+ for query in bmcstate chassisstate hoststate bootprogress osstate
do
handle_cmd $query
done
OpenPOWER on IntegriCloud