#!/bin/bash -e

set -euo pipefail

OPTS="bmcstate,bootprogress,chassiskill,chassisoff,chassison,chassisstate,hoststate,\
osstate,power,poweroff,poweron,state,status,hostrebootoff,hostrebooton,recoveryoff,recoveryon,\
bmcrebootoff, bmcrebooton, listbootblock listlogs showlog deletelogs, stopofftargets"

USAGE="Usage: obmcutil [-h] [--wait] [--verbose] [--id=<INSTANCE_ID>]
{$OPTS}"

INTERFACE_ROOT=xyz.openbmc_project
STATE_INTERFACE=$INTERFACE_ROOT.State
CONTROL_INTERFACE=$INTERFACE_ROOT.Control

OBJECT_ROOT=/xyz/openbmc_project
STATE_OBJECT=$OBJECT_ROOT/state
CONTROL_OBJECT=$OBJECT_ROOT/control

HOST_TIMEOUT_TARGET=obmc-host-timeout@0.target
HOST_CRASH_TARGET=obmc-host-crash@0.target

## NOTE: The following global variables are used only in the run_timeout cmd.
## By declaring these globally instead of passing them through the
## intermediary functions, which may not be "best practice", the readability
## and cleanliness of the code should at least be increased.

# The command passed in to be executed (e.g. poweron/off, status, etc.)
# This will be be used in some instances of error reporting
G_ORIG_CMD=
# The state an interface should be in after executing the requested command.
G_REQUESTED_STATE=
# The query to run during a poweron/off or chassison/off to check that
# the requested state (G_REQUESTED_STATE) of the interface has been reached.
G_QUERY=
# Wait the set period of time for state transitions to be successful before
# continuing on with the program or reporting an error if timeout reached.
G_WAIT=
# Print the journal to the console
G_VERBOSE=
# Instance id, default 0
G_INSTANCE_ID="0"

function print_help()
{
    echo "$USAGE"
    echo ""
    echo "positional arguments:"
    echo "  {$OPTS}"
    echo ""
    echo "Examples:"
    echo ""
    echo "obmcutil hostrebootoff Disable auto reboot of Host from Quiesce state"
    echo "obmcutil hostrebootoffonetime Disable auto reboot of Host from"
    echo "                              Quiesce state for a single boot"
    echo "obmcutil hostrebooton   Enable auto reboot of Host from Quiesce state"
    echo ""
    echo "obmcutil bmcrebootoff   Disable reboot of BMC"
    echo "obmcutil bmcrebooton    Enable reboot of BMC"
    echo ""
    echo "obmcutil recoveryoff    Disable handling boot watchdog timeout and host crash"
    echo "                        Also, disable BMC and Host auto reboots"
    echo ""
    echo "obmcutil recoveryon     Enable handling boot watchdog timeout and host crash"
    echo "                        Also, enable BMC and Host auto reboots"
    echo ""
    echo "obmcutil listbootblock  Check for and list any errors blocking the boot"
    echo "                        of the system"
    echo ""
    echo "obmcutil listlogs       List all phosphor-logging entries on the"
    echo "                        system"
    echo ""
    echo "obmcutil showlog <log>  Display details of input log. Format of <log>"
    echo "                        should match listlogs output"
    echo ""
    echo "obmcutil deletelogs     Delete all phosphor-logging entries from"
    echo "                        system"
    echo "obmcutil stopofftargets Manually stop all obmc targets in power off"
    echo "                        path"
    echo ""
    echo "optional arguments (must precede the positional options above):"
    echo "  -h, --help          show this help message and exit"
    echo "  -w, --wait          block until state transition succeeds or fails"
    echo "  -v, --verbose       print the journal to stdout if --wait is supplied"
    echo "  -i, -id             instance id, default 0"
    exit 0
}

function run_timeout()
{
    local timeout="$1"; shift
    local cmd="$*"
    local verbose_child=

    if [ -n "$G_VERBOSE" ]; then
        journalctl -f &
        verbose_child=$!
    fi

    $cmd

    # Run a background query for the transition to the expected state
    # This will be killed if the transition doesn't succeed within
    # a timeout period.
    (
        while ! grep -q "$G_REQUESTED_STATE" <<< "$(handle_cmd "$G_QUERY")" ; do
            sleep 1
        done
    ) &
    wait_child=$!

    # Could be bad if process is killed before 'timeout' occurs if
    # transition doesn't succeed.
    trap -- "" SIGTERM

    # Workaround for lack of 'timeout' command.
    (
        sleep "$timeout"
        kill $wait_child
    ) > /dev/null 2>&1 &

    if ! wait $wait_child; then
        echo "Unable to confirm '$G_ORIG_CMD' success" \
            "within timeout period (${timeout}s)"
    fi

    if [ -n "$verbose_child" ]; then
        kill $verbose_child
    fi
}

function run_cmd()
{
    local cmd="$*";

    if [ -n "$G_WAIT" ]; then
        run_timeout "$G_WAIT" "$cmd"
    else
        $cmd
    fi
}

function set_property()
{
    run_cmd busctl set-property "$@"
}

function get_property()
{
    G_WAIT=""
    run_cmd busctl get-property "$@"
}

function state_query()
{
    local state
    state=$(get_property "$@" | cut -d '"' -f2)
    printf "%-20s: %s\n" "$4" "$state"
}

function print_usage_err()
{
    echo "ERROR: $1" >&2
    echo "$USAGE"
    exit 1
}

function mask_systemd_target()
{
    target="$*"
    systemctl mask "$target"
}

function unmask_systemd_target()
{
    target="$*"
    systemctl unmask "$target"
}

function disable_bmc_reboot()
{
    dir="/run/systemd/system/"
    file="reboot-guard.conf"
    units=("reboot" "poweroff" "halt")

    for unit in "${units[@]}"; do
        mkdir -p "${dir}${unit}.target.d"
        echo -e "[Unit]\nRefuseManualStart=yes" >> "${dir}${unit}.target.d/${file}"
    done
}

function enable_bmc_reboot()
{
    dir="/run/systemd/system/"
    file="reboot-guard.conf"
    units=("reboot" "poweroff" "halt")

    for unit in "${units[@]}"; do
        rm -rf "${dir}${unit}.target.d/${file}"
        rm -rf "${dir}${unit}.target.d"
    done
}

# will write blocking errors to stdout
function check_boot_block_errors()
{
    # array of boot block objects
    blockArray=()

    # Look for any objects under logging that implement the
    # xyz.openbmc_project.Logging.ErrorBlocksTransition
    subtree="$(busctl call xyz.openbmc_project.ObjectMapper \
               /xyz/openbmc_project/object_mapper \
               xyz.openbmc_project.ObjectMapper \
               GetSubTree sias "/xyz/openbmc_project/logging/" 0 1 \
               xyz.openbmc_project.Logging.ErrorBlocksTransition)"

    # remove quotation marks
    # shellcheck disable=SC2001
    subtree="$(echo "$subtree" | sed 's/\"//g')"

    for entry in $subtree; do
        if [[ ${entry} =~ "xyz/openbmc_project/logging/block"* ]]; then
            blockArray+=( "$entry" )
        fi
    done

    # now find associated error log for each boot block error
    for berror in "${blockArray[@]}"; do
        assocs="$(busctl call xyz.openbmc_project.Logging "$berror" \
                  org.freedesktop.DBus.Properties Get \
                  ss xyz.openbmc_project.Association.Definitions Associations)"

        # remove quotation marks
        # shellcheck disable=SC2001
        assocs="$(echo "$assocs" | sed 's/\"//g')"

        for entry in $assocs; do
            if [[ ${entry} =~ "xyz/openbmc_project/logging/entry"* ]]; then
                echo "Blocking Error: $entry"
            fi
        done
    done
}

# helper function to check for boot block errors and notify user
function check_and_warn_boot_block()
{
    blockingErrors=$(check_boot_block_errors)
    if [ -n "$blockingErrors" ]; then
        echo !!!!!!!!!!
        echo "WARNING! System has blocking errors that will prevent boot"
        echo "$blockingErrors"
        echo !!!!!!!!!!
    fi
}

# list all phosphor-logging entries
function list_logs()
{
    # Look for any objects under logging that implement the
    # xyz.openbmc_project.Logging.Entry
    busctl -j call xyz.openbmc_project.ObjectMapper \
        /xyz/openbmc_project/object_mapper \
        xyz.openbmc_project.ObjectMapper \
        GetSubTreePaths sias "/xyz/openbmc_project/logging/" 0 1 \
        xyz.openbmc_project.Logging.Entry
}

# display input log details
function show_log()
{
    busctl -j call xyz.openbmc_project.Logging \
        "$1" \
        org.freedesktop.DBus.Properties \
        GetAll s xyz.openbmc_project.Logging.Entry
}

# delete all phosphor-logging entries
function delete_logs()
{
    busctl call xyz.openbmc_project.Logging \
        /xyz/openbmc_project/logging \
        xyz.openbmc_project.Collection.DeleteAll DeleteAll
}

# stop all targets associated with powering off a system
function stop_off_targets()
{
    systemctl stop \
        obmc-chassis-powered-off@0.target \
        obmc-host-stop-pre@0.target \
        obmc-host-stopped@0.target \
        obmc-host-stopping@0.target \
        obmc-power-off@0.target \
        obmc-power-stop-pre@0.target \
        obmc-power-stop@0.target
}

function handle_cmd()
{
    case "$1" in
        chassisoff)
            OBJECT=$STATE_OBJECT/chassis$G_INSTANCE_ID
            SERVICE=$(mapper get-service "$OBJECT")
            INTERFACE=$STATE_INTERFACE.Chassis
            PROPERTY=RequestedPowerTransition
            VALUE=$INTERFACE.Transition.Off
            G_REQUESTED_STATE=$INTERFACE.PowerState.Off
            G_QUERY="chassisstate"
            set_property "$SERVICE" "$OBJECT" $INTERFACE $PROPERTY "s" $VALUE
            ;;
        chassison)
            check_and_warn_boot_block
            OBJECT=$STATE_OBJECT/chassis$G_INSTANCE_ID
            SERVICE=$(mapper get-service "$OBJECT")
            INTERFACE=$STATE_INTERFACE.Chassis
            PROPERTY=RequestedPowerTransition
            VALUE=$INTERFACE.Transition.On
            G_REQUESTED_STATE=$INTERFACE.PowerState.On
            G_QUERY="chassisstate"
            set_property "$SERVICE" "$OBJECT" $INTERFACE $PROPERTY "s" $VALUE
            ;;
        poweroff)
            OBJECT=$STATE_OBJECT/host$G_INSTANCE_ID
            SERVICE=$(mapper get-service "$OBJECT")
            INTERFACE=$STATE_INTERFACE.Host
            PROPERTY=RequestedHostTransition
            VALUE=$INTERFACE.Transition.Off
            G_REQUESTED_STATE=$INTERFACE.HostState.Off
            G_QUERY="hoststate"
            set_property "$SERVICE" "$OBJECT" $INTERFACE $PROPERTY "s" $VALUE
            ;;
        poweron)
            check_and_warn_boot_block
            OBJECT=$STATE_OBJECT/host$G_INSTANCE_ID
            SERVICE=$(mapper get-service "$OBJECT")
            INTERFACE=$STATE_INTERFACE.Host
            PROPERTY=RequestedHostTransition
            VALUE=$INTERFACE.Transition.On
            G_REQUESTED_STATE=$INTERFACE.HostState.Running
            G_QUERY="hoststate"
            set_property "$SERVICE" "$OBJECT" $INTERFACE $PROPERTY "s" $VALUE
            ;;
        bmcstate)
            OBJECT=$STATE_OBJECT/bmc0
            SERVICE=$(mapper get-service $OBJECT)
            INTERFACE=$STATE_INTERFACE.BMC
            PROPERTY=CurrentBMCState
            state_query "$SERVICE" $OBJECT $INTERFACE $PROPERTY
            ;;
        chassisstate)
            OBJECT=$STATE_OBJECT/chassis$G_INSTANCE_ID
            SERVICE=$(mapper get-service "$OBJECT")
            INTERFACE=$STATE_INTERFACE.Chassis
            PROPERTY=CurrentPowerState
            state_query "$SERVICE" "$OBJECT" $INTERFACE $PROPERTY
            ;;
        hoststate)
            OBJECT=$STATE_OBJECT/host$G_INSTANCE_ID
            SERVICE=$(mapper get-service "$OBJECT")
            INTERFACE=$STATE_INTERFACE.Host
            PROPERTY=CurrentHostState
            state_query "$SERVICE" "$OBJECT" $INTERFACE $PROPERTY
            ;;
        osstate)
            OBJECT=$STATE_OBJECT/host$G_INSTANCE_ID
            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 bootprogress osstate
            do
                handle_cmd $query
            done
            check_and_warn_boot_block
            ;;
        bootprogress)
            OBJECT=$STATE_OBJECT/host$G_INSTANCE_ID
            SERVICE=$(mapper get-service "$OBJECT")
            INTERFACE=$STATE_INTERFACE.Boot.Progress
            PROPERTY=BootProgress
            state_query "$SERVICE" "$OBJECT" $INTERFACE $PROPERTY
            ;;
        power)
            OBJECT=/org/openbmc/control/power0
            SERVICE=$(mapper get-service $OBJECT)
            INTERFACE=org.openbmc.control.Power
            for property in pgood state pgood_timeout; do
                # get_property can potentially return several
                # different formats of values, so we do the parsing outside
                # of get_property depending on the query. These queries
                # return 'i VALUE' formatted strings.
                STATE=$(get_property "$SERVICE" "$OBJECT" "$INTERFACE" "$property" | sed 's/i[ ^I]*//')
                printf "%s = %s\n" $property "$STATE"
            done
            ;;
        chassiskill)
            /usr/libexec/chassiskill
            ;;
        hostrebootoff)
            OBJECT=$CONTROL_OBJECT/host$G_INSTANCE_ID/auto_reboot
            SERVICE=$(mapper get-service "$OBJECT")
            INTERFACE=$CONTROL_INTERFACE.Boot.RebootPolicy
            PROPERTY=AutoReboot
            VALUE=false
            set_property "$SERVICE" "$OBJECT" $INTERFACE $PROPERTY "b" $VALUE
            ;;
        hostrebootoffonetime)
            OBJECT=$CONTROL_OBJECT/host$G_INSTANCE_ID/auto_reboot/one_time
            SERVICE=$(mapper get-service "$OBJECT")
            INTERFACE=$CONTROL_INTERFACE.Boot.RebootPolicy
            PROPERTY=AutoReboot
            VALUE=false
            set_property "$SERVICE" "$OBJECT" $INTERFACE $PROPERTY "b" $VALUE
            ;;
        hostrebooton)
            OBJECT=$CONTROL_OBJECT/host$G_INSTANCE_ID/auto_reboot
            SERVICE=$(mapper get-service "$OBJECT")
            INTERFACE=$CONTROL_INTERFACE.Boot.RebootPolicy
            PROPERTY=AutoReboot
            VALUE=true
            set_property "$SERVICE" "$OBJECT" $INTERFACE $PROPERTY "b" $VALUE
            ;;
        bmcrebootoff)
            disable_bmc_reboot
            ;;
        bmcrebooton)
            enable_bmc_reboot
            ;;
        recoveryoff)
            handle_cmd hostrebootoff
            handle_cmd bmcrebootoff
            mask_systemd_target $HOST_TIMEOUT_TARGET
            mask_systemd_target $HOST_CRASH_TARGET
            ;;
        recoveryon)
            handle_cmd hostrebooton
            handle_cmd bmcrebooton
            unmask_systemd_target $HOST_TIMEOUT_TARGET
            unmask_systemd_target $HOST_CRASH_TARGET
            ;;
        listbootblock)
            blockingErrors=$(check_boot_block_errors)
            if [ -z "$blockingErrors" ]; then
                echo "No blocking errors present"
            else
                echo "$blockingErrors"
            fi
            ;;
        listlogs)
            list_logs
            ;;
        showlog)
            show_log "$2"
            ;;
        deletelogs)
            delete_logs
            ;;
        stopofftargets)
            stop_off_targets
            ;;
        *)
            print_usage_err "Invalid command '$1'"
            ;;
    esac
}

shiftcnt=0
for arg in "$@"; do
    case $arg in
        -w|--wait)
            G_WAIT=30
            shiftcnt=$((shiftcnt+1))
            continue
            ;;
        -h|--help)
            print_help
            ;;
        -v|--verbose)
            G_VERBOSE=y
            shiftcnt=$((shiftcnt+1))
            ;;
        -i=*|--id=*)
            G_INSTANCE_ID="${arg#*=}"
            shiftcnt=$((shiftcnt+1))
            ;;
        -*)
            print_usage_err "Unknown option: $arg"
            ;;
        *)
            G_ORIG_CMD=$arg
            # shift out the optional parameters
            shift $shiftcnt
            # pass all arguments to handle_cmd in case command takes additional
            # parameters
            handle_cmd "$@"
            break
            ;;
    esac
done
