add more mosys platform information to chrome://system
To be able to debug various hardware related issues on Spring, we need
to know precisely the board revision inside the machine.
"mosys platform version" is returning a decoded form of the board revision
id and various other "mosys platform" subcommands give hw specific info.
Let's add these to chrome://system and feedback reports.
BUG=chrome-os-partner:21674
TEST=on Spring, open chrome://system and see the board revision properly
reported under "platform_info", fill a feedback and also see it in the
feedback "Product Specific Data"
Change-Id: I41d844cf4293d0a6f373662983b36ee279f30879
Reviewed-on: https://gerrit.chromium.org/gerrit/64707
Reviewed-by: Todd Broch <tbroch@chromium.org>
Reviewed-by: David Hendricks <dhendrix@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
diff --git a/init/memory-spd-info.conf b/init/mosys-info.conf
similarity index 68%
rename from init/memory-spd-info.conf
rename to init/mosys-info.conf
index 31863b5..7c55269 100644
--- a/init/memory-spd-info.conf
+++ b/init/mosys-info.conf
@@ -2,10 +2,10 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-description "Launch memory SPD info scripts to populate chrome://system"
+description "Launch mosys info dump script to populate chrome://system"
author "chromium-os-dev@chromium.org"
start on started system-services
script
- /usr/share/userfeedback/scripts/memory_spd_info
+ /usr/share/userfeedback/scripts/mosys_info
end script
diff --git a/scripts/memory_spd_info b/scripts/memory_spd_info
deleted file mode 100755
index cbb224d..0000000
--- a/scripts/memory_spd_info
+++ /dev/null
@@ -1,23 +0,0 @@
-#! /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
-
diff --git a/scripts/mosys_info b/scripts/mosys_info
new file mode 100755
index 0000000..6e2983a
--- /dev/null
+++ b/scripts/mosys_info
@@ -0,0 +1,32 @@
+#! /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 platform information through mosys :
+# - the memory info from SPD data
+# - the platform name/version/variant
+
+MEMORY_SPD_INFO_FILE="/var/log/memory_spd_info.txt"
+PLATFORM_INFO_FILE="/var/log/platform_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
+
+# Record available platform parameters from mosys
+(mosys -l platform vendor || echo -n "") > ${PLATFORM_INFO_FILE}
+(mosys -l platform name || echo -n "") >> ${PLATFORM_INFO_FILE}
+(mosys -l platform version || echo -n "") >> ${PLATFORM_INFO_FILE}
+(mosys -l platform family || echo -n "") >> ${PLATFORM_INFO_FILE}
+(mosys -l platform variant || echo -n "") >> ${PLATFORM_INFO_FILE}