Index: scripts/image_signing/set_channel.sh |
diff --git a/scripts/image_signing/set_channel.sh b/scripts/image_signing/set_channel.sh |
new file mode 100755 |
index 0000000000000000000000000000000000000000..33a16d3668acb172b2672736ee6ace6acf09c82e |
--- /dev/null |
+++ b/scripts/image_signing/set_channel.sh |
@@ -0,0 +1,38 @@ |
+#!/bin/bash |
+ |
+# Copyright (c) 2011 The Chromium OS Authors. All rights reserved. |
+# Use of this source code is governed by a BSD-style license that can be |
+# found in the LICENSE file. |
+ |
+# Changes the channel on a Chrome OS image. |
+ |
+# Load common constants and variables. |
+. "$(dirname "$0")/common.sh" |
+ |
+set -e |
+ |
+if [ $# -ne 3 ]; then |
+ cat <<EOF |
+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.
|
+ |
+<image.bin>: Path to image. |
+<from_channel>: The current channel of the image. |
+<to_channel>: The new channel of the image. |
+EOF |
+ exit 1 |
+fi |
+ |
+main() { |
+ local image=$1 |
+ local from=$2 |
+ local to=$3 |
+ |
+ rootfs=$(make_temp_dir) |
+ mount_image_partition "${image}" 3 "${rootfs}" |
+ 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
|
+ echo "Channel change successful." |
+ |
+ cat "$rootfs/etc/lsb-release" |
+} |
+ |
+main "$@" |