blob: cbb224d9464fdc87cc03443e13fccaedd274f7a0 [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 memory info from SPD data
MEMORY_SPD_INFO_FILE="/var/log/memory_spd_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 memory spd print all > ${MEMORY_SPD_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. If mosys
# fails, delete the output file to avoid placing non-relevent or confusing
# output in /var/log.
rm -f ${MEMORY_SPD_INFO_FILE}
fi