| 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 # Helper script that generates the signed kernel image | 7 # Helper script that generates the signed kernel image |
| 8 | 8 |
| 9 . "$(dirname "$0")/common.sh" | 9 . "$(dirname "$0")/common.sh" |
| 10 | 10 |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 base_root='/dev/${devname}${rootpart}' | 94 base_root='/dev/${devname}${rootpart}' |
| 95 fi | 95 fi |
| 96 table=${table//HASH_DEV/${base_root}} | 96 table=${table//HASH_DEV/${base_root}} |
| 97 table=${table//ROOT_DEV/${base_root}} | 97 table=${table//ROOT_DEV/${base_root}} |
| 98 fi | 98 fi |
| 99 verity_args="dm=\"vroot none ro,${table}\"" | 99 verity_args="dm=\"vroot none ro,${table}\"" |
| 100 info "dm-verity configuration: ${verity_args}" | 100 info "dm-verity configuration: ${verity_args}" |
| 101 fi | 101 fi |
| 102 | 102 |
| 103 mkdir -p "${FLAGS_working_dir}" | 103 mkdir -p "${FLAGS_working_dir}" |
| 104 |
| 105 # Only let dm-verity block if rootfs verification is configured. |
| 106 dev_wait=0 |
| 107 if [[ ${FLAGS_root} = "/dev/dm-0" ]]; then |
| 108 dev_wait=1 |
| 109 fi |
| 110 |
| 104 cat <<EOF > "${FLAGS_working_dir}/boot.config" | 111 cat <<EOF > "${FLAGS_working_dir}/boot.config" |
| 105 root=${FLAGS_root} | 112 root=${FLAGS_root} |
| 106 dm_verity.error_behavior=${FLAGS_verity_error_behavior} | 113 dm_verity.error_behavior=${FLAGS_verity_error_behavior} |
| 107 dm_verity.max_bios=${FLAGS_verity_max_ios} | 114 dm_verity.max_bios=${FLAGS_verity_max_ios} |
| 115 dm_verity.dev_wait=${dev_wait} |
| 108 ${verity_args} | 116 ${verity_args} |
| 109 ${FLAGS_boot_args} | 117 ${FLAGS_boot_args} |
| 110 EOF | 118 EOF |
| 111 | 119 |
| 112 WORK="${WORK} ${FLAGS_working_dir}/boot.config" | 120 WORK="${WORK} ${FLAGS_working_dir}/boot.config" |
| 113 info "Emitted cross-platform boot params to ${FLAGS_working_dir}/boot.config" | 121 info "Emitted cross-platform boot params to ${FLAGS_working_dir}/boot.config" |
| 114 | 122 |
| 115 # FIXME: At the moment, we're working on signed images for x86 only. ARM will | 123 # FIXME: At the moment, we're working on signed images for x86 only. ARM will |
| 116 # support this before shipping, but at the moment they don't. | 124 # support this before shipping, but at the moment they don't. |
| 117 if [[ "${FLAGS_arch}" = "x86" ]]; then | 125 if [[ "${FLAGS_arch}" = "x86" ]]; then |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 241 info "Cleaning up temporary files: ${WORK}" | 249 info "Cleaning up temporary files: ${WORK}" |
| 242 rm ${WORK} | 250 rm ${WORK} |
| 243 rmdir ${FLAGS_working_dir} | 251 rmdir ${FLAGS_working_dir} |
| 244 fi | 252 fi |
| 245 | 253 |
| 246 info "Kernel partition image emitted: ${FLAGS_to}" | 254 info "Kernel partition image emitted: ${FLAGS_to}" |
| 247 | 255 |
| 248 if [[ -f ${FLAGS_rootfs_hash} ]]; then | 256 if [[ -f ${FLAGS_rootfs_hash} ]]; then |
| 249 info "Root filesystem hash emitted: ${FLAGS_rootfs_hash}" | 257 info "Root filesystem hash emitted: ${FLAGS_rootfs_hash}" |
| 250 fi | 258 fi |
| OLD | NEW |