Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 #!/bin/bash | |
| 2 | |
| 3 # Copyright (c) 2011 The Chromium OS Authors. All rights reserved. | |
| 4 # Use of this source code is governed by a BSD-style license that can be | |
| 5 # found in the LICENSE file. | |
| 6 | |
| 7 # Changes the channel on a Chrome OS image. | |
| 8 | |
| 9 # Load common constants and variables. | |
| 10 . "$(dirname "$0")/common.sh" | |
| 11 | |
| 12 set -e | |
| 13 | |
| 14 if [ $# -ne 3 ]; then | |
| 15 cat <<EOF | |
| 16 Usage: $PROG <image.bin> <from_channel> <to_channel> | |
|
scottz-goog
2011/04/08 19:18:12
Why do we need to know the from channel? Do we rea
gauravsh
2011/04/08 19:24:51
Mainly because of the way it does the change.
| |
| 17 | |
| 18 <image.bin>: Path to image. | |
| 19 <from_channel>: The current channel of the image. | |
| 20 <to_channel>: The new channel of the image. | |
| 21 EOF | |
| 22 exit 1 | |
| 23 fi | |
| 24 | |
| 25 main() { | |
| 26 local image=$1 | |
| 27 local from=$2 | |
| 28 local to=$3 | |
| 29 | |
| 30 rootfs=$(make_temp_dir) | |
| 31 mount_image_partition "${image}" 3 "${rootfs}" | |
| 32 sed -i "s/\b${from}\b/${to}/" "${rootfs}/etc/lsb-release" && | |
|
scottz-goog
2011/04/08 19:18:12
am I missing something? Why aren't we just calling
gauravsh
2011/04/08 19:24:51
Because the channel also appears in CHROMEOS_RELEA
| |
| 33 echo "Channel change successful." | |
| 34 | |
| 35 cat "$rootfs/etc/lsb-release" | |
| 36 } | |
| 37 | |
| 38 main "$@" | |
| OLD | NEW |