| OLD | NEW |
| 1 #!/bin/bash | 1 #!/bin/bash |
| 2 | 2 |
| 3 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 3 # Copyright (c) 2010 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 # Determine script directory | 7 # Determine script directory |
| 8 SCRIPT_DIR=$(dirname $0) | 8 SCRIPT_DIR=$(dirname $0) |
| 9 PROG=$(basename $0) | 9 PROG=$(basename $0) |
| 10 GPT=cgpt | 10 GPT=cgpt |
| 11 | 11 |
| 12 # The tag when the rootfs is changed. | 12 # The tag when the rootfs is changed. |
| 13 TAG_NEEDS_TO_BE_SIGNED="/root/.need_to_be_signed" | 13 TAG_NEEDS_TO_BE_SIGNED="/root/.need_to_be_signed" |
| 14 | 14 |
| 15 # Load shflags | 15 # Load shflags |
| 16 if [[ -f /usr/lib/shflags ]]; then | 16 if [ -f /usr/lib/shflags ]; then |
| 17 . /usr/lib/shflags | 17 . /usr/lib/shflags |
| 18 else | 18 else |
| 19 . "${SCRIPT_DIR}/lib/shflags/shflags" | 19 . "${SCRIPT_DIR}/lib/shflags/shflags" |
| 20 fi | 20 fi |
| 21 | 21 |
| 22 # List of Temporary files and mount points. | 22 # List of Temporary files and mount points. |
| 23 TEMP_FILE_LIST=$(mktemp) | 23 TEMP_FILE_LIST=$(mktemp) |
| 24 TEMP_DIR_LIST=$(mktemp) | 24 TEMP_DIR_LIST=$(mktemp) |
| 25 | 25 |
| 26 # Read GPT table to find the starting location of a specific partition. | 26 # Read GPT table to find the starting location of a specific partition. |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 sudo umount -d $i 2>/dev/null | 144 sudo umount -d $i 2>/dev/null |
| 145 rm -rf $i | 145 rm -rf $i |
| 146 fi | 146 fi |
| 147 done | 147 done |
| 148 set -e | 148 set -e |
| 149 rm -rf $TEMP_DIR_LIST $TEMP_FILE_LIST | 149 rm -rf $TEMP_DIR_LIST $TEMP_FILE_LIST |
| 150 } | 150 } |
| 151 | 151 |
| 152 trap "cleanup_temps_and_mounts" EXIT | 152 trap "cleanup_temps_and_mounts" EXIT |
| 153 | 153 |
| OLD | NEW |