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

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

Issue 6543027: Signer script to add update verification public key to an image (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/vboot_reference.git@master
Patch Set: message on success Created 9 years, 10 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 | « no previous file | 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
(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"
16 local pub_key="$2"
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"
30 sudo chmod 644 "$rootfs/$key_location/update-payload-key.pub.pem"
31 echo "AU verification key was installed. Do not forget to resign the image!"
32 }
33
34 main "$@"
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698