OLD | NEW |
1 #!/bin/sh -u | 1 #!/bin/sh -u |
2 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 2 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 # | 5 # |
6 # A script to install recovery image from removable media to hard disk. | 6 # A script to install recovery image from removable media to hard disk. |
7 | 7 |
8 # Load functions and constants for chromeos-install. | 8 # Load functions and constants for chromeos-install. |
9 . "$(dirname "$0")/chromeos-common.sh" || exit 1 | 9 . "$(dirname "$0")/chromeos-common.sh" || exit 1 |
10 . /usr/lib/shflags || exit 1 | 10 . /usr/lib/shflags || exit 1 |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 echo 1 | 78 echo 1 |
79 else | 79 else |
80 log "developer switch bit set to OFF at startup" | 80 log "developer switch bit set to OFF at startup" |
81 echo 0 | 81 echo 0 |
82 fi | 82 fi |
83 } | 83 } |
84 | 84 |
85 # Install Google payload from USB image | 85 # Install Google payload from USB image |
86 install_chromiumos_payload() { | 86 install_chromiumos_payload() { |
87 IS_RECOVERY_INSTALL=1 /usr/sbin/chromeos-install --run_as_root --yes \ | 87 IS_RECOVERY_INSTALL=1 /usr/sbin/chromeos-install --run_as_root --yes \ |
88 --payload_image=${1} 2>&1 >> $RECOVERY_LOG | 88 --payload_image=${1} >> $RECOVERY_LOG 2>&1 |
89 log "Recovery installer completed" | 89 log "Recovery installer completed" |
90 | 90 |
91 # Reset TPM | 91 # Reset TPM |
92 stop tcsd | 92 stop tcsd |
93 tpmc ppon | 93 tpmc ppon |
94 tpmc clear | 94 tpmc clear |
95 tpmc enable | 95 tpmc enable |
96 tpmc activate | 96 tpmc activate |
97 | 97 |
98 # shut down and power off the device | 98 # shut down and power off the device |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 exit 0 | 172 exit 0 |
173 fi | 173 fi |
174 log "Recovery boot. Check if target device is ready" | 174 log "Recovery boot. Check if target device is ready" |
175 | 175 |
176 if [ $(wait_for_device) -eq 0 ]; then | 176 if [ $(wait_for_device) -eq 0 ]; then |
177 log "Timed out waiting for target device. Exit." | 177 log "Timed out waiting for target device. Exit." |
178 exit 0 | 178 exit 0 |
179 fi | 179 fi |
180 | 180 |
181 launch_installer_script | 181 launch_installer_script |
OLD | NEW |