blob: e2dd68b4e324a5d401adadeb0530e41f888b0b29 [file] [log] [blame]
#! /bin/sh
# Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
# 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"
# Attempts to insert i2c-dev as it may not be done during init on all platforms
if ! modprobe i2c-dev; then
exit 0
fi
if ! mosys -l ec info > ${EC_INFO_FILE} 2> /dev/null; then
# If a sub-command is not available on a platform, mosys will fail with
# a non-zero exit code (EXIT_FAILURE) and print the help menu. For example,
# this will happen if a "mosys smbios" sub-command is run on ARM since ARM
# platforms do not support SMBIOS. If mosys fails, delete the output file
# to avoid placing non-relevent or confusing output in /var/log.
rm -f ${EC_INFO_FILE}
fi