Index: vpd-log.conf |
diff --git a/vpd-log.conf b/vpd-log.conf |
new file mode 100644 |
index 0000000000000000000000000000000000000000..663b6ef8b5e5d406c25c1355cd331b3be812caa0 |
--- /dev/null |
+++ b/vpd-log.conf |
@@ -0,0 +1,35 @@ |
+# 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. |
+ |
+description "dumps VPD information for chrome://system" |
+author "chromium-os-dev@chromium.org" |
+ |
+# VPD (Vital Product Data) information is shown on chrome://system for |
+# user, feedback, and partner's customer service center. |
+# |
+# This script will read VPD from BIOS and dump into /var/log/vpd_2.0.txt. |
+# It should be executed at least once some time after boot and before user |
+# types "chrome://system" in chrome location bar. |
+# |
+# Since VPD utility could invoke flashrom utility to access BIOS, which is |
+# slow, this script should be run after calculating boot time. |
+# Hence, later than boot-complete can be acceptable. |
+start on stopped boot-complete |
+ |
+script |
+ VPD_2_0="/var/log/vpd_2.0.txt" |
+ TMP="/tmp/vpd.bin" |
+ |
+ # Since we don't change the VPD data too often, only create the log file |
+ # if it does not exist. |
+ if [ ! -f $VPD_2_0 ]; then |
+ if flashrom -r $TMP > /dev/null ; then |
+ vpd -f $TMP -i "RO VPD" -l || echo "RO VPD execute error." |
+ vpd -f $TMP -i "RW VPD" -l || echo "RW VPD execute error." |
+ else |
+ echo "flashrom execute error." |
+ fi >> $VPD_2_0 |
+ rm -f $TMP |
+ fi |
+end script |