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 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 mount_image_partition "${image}" 3 "${rootfs_dir}" | 131 mount_image_partition "${image}" 3 "${rootfs_dir}" |
132 sudo rm -f "${rootfs_dir}/${TAG_NEEDS_TO_BE_SIGNED}" | 132 sudo rm -f "${rootfs_dir}/${TAG_NEEDS_TO_BE_SIGNED}" |
133 fi | 133 fi |
134 sudo umount -d "${rootfs_dir}" | 134 sudo umount -d "${rootfs_dir}" |
135 | 135 |
136 local rootfs_image=$(make_temp_file) | 136 local rootfs_image=$(make_temp_file) |
137 extract_image_partition ${image} 3 ${rootfs_image} | 137 extract_image_partition ${image} 3 ${rootfs_image} |
138 local kernel_config=$(grab_kernel_config "${image}") | 138 local kernel_config=$(grab_kernel_config "${image}") |
139 local hash_image=$(make_temp_file) | 139 local hash_image=$(make_temp_file) |
140 | 140 |
| 141 # Disable rw mount support prior to hashing. |
| 142 disable_rw_mount "${rootfs_image}" |
| 143 |
141 local new_kernel_config=$(calculate_rootfs_hash "${rootfs_image}" \ | 144 local new_kernel_config=$(calculate_rootfs_hash "${rootfs_image}" \ |
142 "${kernel_config}" "${hash_image}") | 145 "${kernel_config}" "${hash_image}") |
143 | 146 |
144 local rootfs_blocks=$(sudo dumpe2fs "${rootfs_image}" 2> /dev/null | | 147 local rootfs_blocks=$(sudo dumpe2fs "${rootfs_image}" 2> /dev/null | |
145 grep "Block count" | | 148 grep "Block count" | |
146 tr -d ' ' | | 149 tr -d ' ' | |
147 cut -f2 -d:) | 150 cut -f2 -d:) |
148 local rootfs_sectors=$((rootfs_blocks * 8)) | 151 local rootfs_sectors=$((rootfs_blocks * 8)) |
149 | 152 |
150 # Overwrite the appended hashes in the rootfs | 153 # Overwrite the appended hashes in the rootfs |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
365 elif [ "${TYPE}" == "install" ]; then | 368 elif [ "${TYPE}" == "install" ]; then |
366 resign_firmware_payload ${INPUT_IMAGE} | 369 resign_firmware_payload ${INPUT_IMAGE} |
367 update_rootfs_hash ${INPUT_IMAGE} \ | 370 update_rootfs_hash ${INPUT_IMAGE} \ |
368 ${KEY_DIR}/installer_kernel.keyblock \ | 371 ${KEY_DIR}/installer_kernel.keyblock \ |
369 ${KEY_DIR}/recovery_kernel_data_key.vbprivk | 372 ${KEY_DIR}/recovery_kernel_data_key.vbprivk |
370 sign_for_factory_install | 373 sign_for_factory_install |
371 else | 374 else |
372 echo "Invalid type ${TYPE}" | 375 echo "Invalid type ${TYPE}" |
373 exit 1 | 376 exit 1 |
374 fi | 377 fi |
OLD | NEW |