Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(41)

Unified Diff: util/dump_vpd_log

Issue 6676022: script to dump RO and RW VPDs into /var/log/vpd-log.conf. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/vpd.git@master
Patch Set: set proper file permission Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: util/dump_vpd_log
diff --git a/util/dump_vpd_log b/util/dump_vpd_log
new file mode 100755
index 0000000000000000000000000000000000000000..d97bb6ee945cf65fd5814245e3dfca1f15ef3ab7
--- /dev/null
+++ b/util/dump_vpd_log
@@ -0,0 +1,27 @@
+#!/bin/sh
+#
+# Helper function to dump VPD RO/RW content into /var/log/vpd_2.0.txt
+#
+# Used in:
+# + OOBE reads this log file for the default locale setting.
+# + chrome://system reads this log file.
+#
+TMP="/tmp/vpd_2.0.txt"
+VPD_2_0="/var/log/vpd_2.0.txt"
+
+if [ "$1" = "--force" ]; then
+ force=1
+else
+ force=0
+fi
+
+# 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 -o $force -eq 1 ]; then
+ rm -f $TMP
+ (vpd -i "RO_VPD" -l || echo "RO VPD execute error.") >> $TMP
+ (vpd -i "RW_VPD" -l || echo "RW VPD execute error.") >> $TMP
+ chmod go-stwx $TMP
+ mv -f $TMP $VPD_2_0
+fi
+
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698