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 # Customizes a Chrome OS release image by setting /etc/lsb-release values. | 7 # Customizes a Chrome OS release image by setting /etc/lsb-release values. |
8 | 8 |
9 # Load common constants and variables. | 9 # Load common constants and variables. |
10 . "$(dirname "$0")/common.sh" | 10 . "$(dirname "$0")/common.sh" |
(...skipping 30 matching lines...) Expand all Loading... |
41 | 41 |
42 Sets the CHROMEOS_RELEASE_DESCRIPTION key's value to "New description" | 42 Sets the CHROMEOS_RELEASE_DESCRIPTION key's value to "New description" |
43 in /etc/lsb-release in chromiumos_image.bin, sorts the keys and dumps | 43 in /etc/lsb-release in chromiumos_image.bin, sorts the keys and dumps |
44 the updated file to stdout. | 44 the updated file to stdout. |
45 | 45 |
46 EOF | 46 EOF |
47 exit 1 | 47 exit 1 |
48 fi | 48 fi |
49 | 49 |
50 local rootfs=$(mktemp -d) | 50 local rootfs=$(mktemp -d) |
51 mount_image_partition "$image" 3 "$rootfs" | 51 mount_image_partition_ro "$image" 3 "$rootfs" |
52 trap "sudo umount -d $rootfs; rm -rf $rootfs" EXIT | 52 trap "sudo umount -d $rootfs; rm -rf $rootfs" EXIT |
53 if [ -n "$key" ]; then | 53 if [ -n "$key" ]; then |
| 54 sudo umount -d "$rootfs" |
| 55 mount_image_partition "$image" 3 "$rootfs" |
54 set_lsb_release_keyval "$rootfs" "$key" "$value" | 56 set_lsb_release_keyval "$rootfs" "$key" "$value" |
55 touch "$image" # Updates the image modification time. | 57 touch "$image" # Updates the image modification time. |
56 fi | 58 fi |
57 cat "$rootfs/etc/lsb-release" | 59 cat "$rootfs/etc/lsb-release" |
58 } | 60 } |
59 | 61 |
60 main "$@" | 62 main "$@" |
OLD | NEW |