| OLD | NEW |
| 1 #!/bin/bash | 1 #!/bin/bash |
| 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 # Sign the final build image using the "official" keys. | 7 # Sign the final build image using the "official" keys. |
| 8 # | 8 # |
| 9 # Prerequisite tools needed in the system path: | 9 # Prerequisite tools needed in the system path: |
| 10 # | 10 # |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 return | 191 return |
| 192 fi | 192 fi |
| 193 | 193 |
| 194 # Grab firmware image from the autoupdate shellball. | 194 # Grab firmware image from the autoupdate shellball. |
| 195 local rootfs_dir=$(make_temp_dir) | 195 local rootfs_dir=$(make_temp_dir) |
| 196 mount_image_partition ${image} 3 ${rootfs_dir} | 196 mount_image_partition ${image} 3 ${rootfs_dir} |
| 197 # Force unmount of the rootfs on function exit as it is needed later. | 197 # Force unmount of the rootfs on function exit as it is needed later. |
| 198 trap "sudo umount -d ${rootfs_dir}" RETURN | 198 trap "sudo umount -d ${rootfs_dir}" RETURN |
| 199 | 199 |
| 200 local shellball_dir=$(make_temp_dir) | 200 local shellball_dir=$(make_temp_dir) |
| 201 # get_firmwarebin_from_shellball can fail if the image has no | 201 # get_firmwarebin_from_shellball can fail if the image has no |
| 202 # firmware update. | 202 # firmware update. |
| 203 get_firmwarebin_from_shellball \ | 203 get_firmwarebin_from_shellball \ |
| 204 ${rootfs_dir}/usr/sbin/chromeos-firmwareupdate ${shellball_dir} || \ | 204 ${rootfs_dir}/usr/sbin/chromeos-firmwareupdate ${shellball_dir} || \ |
| 205 { echo "Didn't find a firmware update. Not signing firmware." | 205 { echo "Didn't find a firmware update. Not signing firmware." |
| 206 return; } | 206 return; } |
| 207 echo "Found a valid firmware update shellball." | 207 echo "Found a valid firmware update shellball." |
| 208 | 208 |
| 209 temp_outfd=$(make_temp_file) | 209 temp_outfd=$(make_temp_file) |
| 210 # Replace the root key in the GBB | 210 # Replace the root key in the GBB |
| 211 # TODO(gauravsh): Remove when we lock down the R/O portion of firmware. | 211 # TODO(gauravsh): Remove when we lock down the R/O portion of firmware. |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 365 elif [ "${TYPE}" == "install" ]; then | 365 elif [ "${TYPE}" == "install" ]; then |
| 366 resign_firmware_payload ${INPUT_IMAGE} | 366 resign_firmware_payload ${INPUT_IMAGE} |
| 367 update_rootfs_hash ${INPUT_IMAGE} \ | 367 update_rootfs_hash ${INPUT_IMAGE} \ |
| 368 ${KEY_DIR}/installer_kernel.keyblock \ | 368 ${KEY_DIR}/installer_kernel.keyblock \ |
| 369 ${KEY_DIR}/recovery_kernel_data_key.vbprivk | 369 ${KEY_DIR}/recovery_kernel_data_key.vbprivk |
| 370 sign_for_factory_install | 370 sign_for_factory_install |
| 371 else | 371 else |
| 372 echo "Invalid type ${TYPE}" | 372 echo "Invalid type ${TYPE}" |
| 373 exit 1 | 373 exit 1 |
| 374 fi | 374 fi |
| OLD | NEW |