blob: 42e19c760fdbb25df3d8043b62d7414c6abc022c [file] [log] [blame]
# Copyright (c) 2015 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.
description "Report EC panic data"
author "chromium-os-dev@chromium.org"
start on started system-services
script
# For each EC device on the system, check for new panic data, and log the
# data to syslog if present.
ECTOOL_CMD="/usr/sbin/ectool panicinfo"
# 0 = EC, 1 = PD on Samus
EC_DEVS="0 1"
for ec_dev in ${EC_DEVS}; do
panic=$(${ECTOOL_CMD} --dev=${ec_dev})
if echo "${panic}" | grep -qv "No panic data"; then
logger -t "${UPSTART_JOB}" "EC#${ec_dev}:${panic}"
fi
done
end script