OLD | NEW |
1 #!/bin/sh | 1 #!/bin/sh |
2 | 2 |
3 # Copyright (c) 2009 The Chromium OS Authors. All rights reserved. | 3 # Copyright (c) 2009 The Chromium OS Authors. All rights reserved. |
4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
6 | 6 |
7 # This script is called after an AutoUpdate or USB install. The first argument | 7 # This script is called after an AutoUpdate or USB install. The first argument |
8 # is the partition where the new rootfs is installed or empty. If non-empty | 8 # is the partition where the new rootfs is installed or empty. If non-empty |
9 # the rootfs should be updated w/ the new bootloader config. If empty, the | 9 # the rootfs should be updated w/ the new bootloader config. If empty, the |
10 # rootfs is mounted-read only and should not be updated. | 10 # rootfs is mounted-read only and should not be updated. |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 LEGACY_PART_NUM=12 | 65 LEGACY_PART_NUM=12 |
66 | 66 |
67 if [ "${FLAGS_postcommit}" -eq "${FLAGS_FALSE}" ]; then | 67 if [ "${FLAGS_postcommit}" -eq "${FLAGS_FALSE}" ]; then |
68 # Pre-commit. Returning an error here will prevent ever booting into the | 68 # Pre-commit. Returning an error here will prevent ever booting into the |
69 # installed system. | 69 # installed system. |
70 | 70 |
71 echo "Postinst running" | 71 echo "Postinst running" |
72 | 72 |
73 # If this FS was mounted read-write, we can't do deltas from it. Mark the | 73 # If this FS was mounted read-write, we can't do deltas from it. Mark the |
74 # FS as such | 74 # FS as such |
75 touch "${INSTALL_ROOT}/.nodelta" || true 2>&1 > /dev/null | 75 (touch "${INSTALL_ROOT}/.nodelta" || true) > /dev/null 2>&1 |
76 | 76 |
77 # TODO(zelidrag): http://crosbug/6367 - Remove this before the product is | 77 # TODO(zelidrag): http://crosbug/6367 - Remove this before the product is |
78 # released. For now, this should recover users that reimaged their machine. | 78 # released. For now, this should recover users that reimaged their machine. |
79 if [ -f /home/chronos/.oobe_completed ]; then | 79 if [ -f /home/chronos/.oobe_completed ]; then |
80 CONSENT_FILE="/home/chronos/Consent To Send Stats" | 80 CONSENT_FILE="/home/chronos/Consent To Send Stats" |
81 if [ ! -f "$CONSENT_FILE" ]; then | 81 if [ ! -f "$CONSENT_FILE" ]; then |
82 "${INSTALL_ROOT}/usr/bin/uuidgen" > "$CONSENT_FILE" | 82 "${INSTALL_ROOT}/usr/bin/uuidgen" > "$CONSENT_FILE" |
83 fi | 83 fi |
84 fi | 84 fi |
85 | 85 |
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
342 echo "marking part $LEGACY_PART_NUM bootable (new)" | 342 echo "marking part $LEGACY_PART_NUM bootable (new)" |
343 "${INSTALL_ROOT}"/usr/bin/cgpt boot -i $LEGACY_PART_NUM ${ROOT_DEV} 2>&1 | 343 "${INSTALL_ROOT}"/usr/bin/cgpt boot -i $LEGACY_PART_NUM ${ROOT_DEV} 2>&1 |
344 else | 344 else |
345 # The old gpt tool requires a -b arg to specify the PMBR bootcode. We don't | 345 # The old gpt tool requires a -b arg to specify the PMBR bootcode. We don't |
346 # want to change the code, so we have to extract it, then put it back. | 346 # want to change the code, so we have to extract it, then put it back. |
347 dd if=${ROOT_DEV} bs=512 count=1 of=/tmp/oldpmbr.bin | 347 dd if=${ROOT_DEV} bs=512 count=1 of=/tmp/oldpmbr.bin |
348 echo "marking part $LEGACY_PART_NUM bootable (old)" | 348 echo "marking part $LEGACY_PART_NUM bootable (old)" |
349 gpt -S boot -i $LEGACY_PART_NUM -b /tmp/oldpmbr.bin ${ROOT_DEV} 2>&1 | 349 gpt -S boot -i $LEGACY_PART_NUM -b /tmp/oldpmbr.bin ${ROOT_DEV} 2>&1 |
350 fi | 350 fi |
351 fi | 351 fi |
OLD | NEW |