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

Side by Side Diff: scripts/image_signing/set_lsb_release.sh

Issue 3563001: set_lsb_release.sh: Make it mount rootfs r/w only if necessary. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/vboot_reference.git
Patch Set: Created 10 years, 2 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « scripts/image_signing/common.sh ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 "$@"
OLDNEW
« no previous file with comments | « scripts/image_signing/common.sh ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698