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

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

Issue 5698004: make_dev_ssh.sh should handle image C as well (Closed) Base URL: http://git.chromium.org/git/vboot_reference.git@master
Patch Set: Created 10 years 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
1 #!/bin/sh 1 #!/bin/sh
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 # This script can change key (usually developer keys) and kernel config 7 # This script can change key (usually developer keys) and kernel config
8 # of a kernels on SSD. 8 # of a kernels on SSD.
9 9
10 SCRIPT_BASE="$(dirname "$0")" 10 SCRIPT_BASE="$(dirname "$0")"
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 84
85 # Prints a more friendly name from kernel index number 85 # Prints a more friendly name from kernel index number
86 cros_kernel_name() { 86 cros_kernel_name() {
87 case $1 in 87 case $1 in
88 2) 88 2)
89 echo "Kernel A" 89 echo "Kernel A"
90 ;; 90 ;;
91 4) 91 4)
92 echo "Kernel B" 92 echo "Kernel B"
93 ;; 93 ;;
94 6)
95 echo "Kernel C"
96 ;;
94 *) 97 *)
95 err_die "unknown kernel index: $1" 98 err_die "unknown kernel index: $1"
96 esac 99 esac
97 } 100 }
98 101
99 # Resigns a kernel on SSD or image. 102 # Resigns a kernel on SSD or image.
100 resign_ssd_kernel() { 103 resign_ssd_kernel() {
101 # bs=512 is the fixed block size for dd and cgpt 104 # bs=512 is the fixed block size for dd and cgpt
102 local bs=512 105 local bs=512
103 local ssd_device="$1" 106 local ssd_device="$1"
104 107
105 # reasonable size for current kernel partition 108 # reasonable size for current kernel partition
106 local min_kernel_size=32000 109 local min_kernel_size=32000
107 local max_kernel_size=65536 110 local max_kernel_size=65536
108 local resigned_kernels=0 111 local resigned_kernels=0
109 112
110 for kernel_index in 2 4; do 113 for kernel_index in 2 4 6; do
111 local old_blob="$(make_temp_file)" 114 local old_blob="$(make_temp_file)"
112 local new_blob="$(make_temp_file)" 115 local new_blob="$(make_temp_file)"
113 local name="$(cros_kernel_name $kernel_index)" 116 local name="$(cros_kernel_name $kernel_index)"
114 local rootfs_index="$(($kernel_index + 1))" 117 local rootfs_index="$(($kernel_index + 1))"
115 118
116 debug_msg "Probing $name information" 119 debug_msg "Probing $name information"
117 local offset size 120 local offset size
118 offset="$(partoffset "$ssd_device" "$kernel_index")" || 121 offset="$(partoffset "$ssd_device" "$kernel_index")" ||
119 err_die "Failed to get partition $kernel_index offset from $ssd_device" 122 err_die "Failed to get partition $kernel_index offset from $ssd_device"
120 size="$(partsize "$ssd_device" "$kernel_index")" || 123 size="$(partsize "$ssd_device" "$kernel_index")" ||
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 debug_msg "Complete." 286 debug_msg "Complete."
284 if [ $num_signed -gt 0 -a $num_signed -le 2 ]; then 287 if [ $num_signed -gt 0 -a $num_signed -le 2 ]; then
285 # signed 1 or two kernels 288 # signed 1 or two kernels
286 echo "Successfully re-signed $num_signed kernel(s) on device $FLAGS_image". 289 echo "Successfully re-signed $num_signed kernel(s) on device $FLAGS_image".
287 else 290 else
288 err_die "Failed re-signing kernels." 291 err_die "Failed re-signing kernels."
289 fi 292 fi
290 } 293 }
291 294
292 main 295 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