| #! /bin/sh |
| |
| # Copyright 2015 The ChromiumOS Authors |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| # |
| # This script obtains the EC version |
| |
| EC_INFO_FILE="/var/log/ec_info.txt" |
| |
| ( |
| # Show commands ran (for informational purposes). |
| set -x |
| |
| # Log versions for all known chip types. |
| for ec_type in cros_ec cros_pd cros_fp cros_scp cros_ish; do |
| ectool --name "${ec_type}" version || true |
| done |
| |
| # Log PD devices attached to each port. This assumes no more than 4 ports, as |
| # we don't have devices with more than 4 TCPC ports at the moment. If that |
| # changes, below will need updated. |
| for i in 0 1 2 3; do |
| ectool pdchipinfo "${i}" || true |
| done |
| ) > "${EC_INFO_FILE}" 2>&1 |