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 # Install an update payload verification public key to the image. | |
| 8 | |
| 9 # Load common constants and variables. | |
| 10 . "$(dirname "$0")/common.sh" | |
| 11 | |
| 12 main() { | |
| 13 set -e | |
| 14 | |
| 15 local image=$1 | |
|
petkov
2011/02/18 23:38:49
"$1"?
gauravsh
2011/02/18 23:51:24
Done.
| |
| 16 local pub_key=$2 | |
|
petkov
2011/02/18 23:38:49
"$2"?
gauravsh
2011/02/18 23:51:24
Done.
| |
| 17 if [ $# -ne 2 ]; then | |
| 18 cat <<EOF | |
| 19 Usage: $PROG <image.bin> <au_public_key.pem> | |
| 20 Installs the update verification public key <au_public_key.pem> to <image.bin>. | |
| 21 EOF | |
| 22 exit 1 | |
| 23 fi | |
| 24 local rootfs=$(make_temp_dir) | |
| 25 local key_location="/usr/share/update_engine/" | |
| 26 mount_image_partition "$image" 3 "$rootfs" | |
| 27 sudo mkdir -p "$rootfs/$key_location" | |
| 28 sudo cp "$pub_key" "$rootfs/$key_location/update-payload-key.pub.pem" | |
| 29 sudo chown root:root "$rootfs/$key_location/update-payload-key.pub.pem" | |
|
petkov
2011/02/18 23:38:49
do we also want to chmod it explicitly or we'll ju
petkov
2011/02/18 23:38:49
I assume root UID/GUID is always 0/0 so this is sa
gauravsh
2011/02/18 23:51:24
I think so.
gauravsh
2011/02/18 23:51:24
Good idea - in case the umask is screwed up or som
| |
| 30 } | |
| 31 | |
| 32 main "$@" | |
| OLD | NEW |