| 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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 mkdir -p "${FLAGS_working_dir}" | 103 mkdir -p "${FLAGS_working_dir}" |
| 104 | 104 |
| 105 # Only let dm-verity block if rootfs verification is configured. | 105 # Only let dm-verity block if rootfs verification is configured. |
| 106 dev_wait=0 | 106 dev_wait=0 |
| 107 if [[ ${FLAGS_root} = "/dev/dm-0" ]]; then | 107 if [[ ${FLAGS_root} = "/dev/dm-0" ]]; then |
| 108 dev_wait=1 | 108 dev_wait=1 |
| 109 fi | 109 fi |
| 110 | 110 |
| 111 cat <<EOF > "${FLAGS_working_dir}/boot.config" | 111 cat <<EOF > "${FLAGS_working_dir}/boot.config" |
| 112 root=${FLAGS_root} | 112 root=${FLAGS_root} |
| 113 quiet |
| 114 loglevel=1 |
| 115 rootwait |
| 116 ro |
| 113 dm_verity.error_behavior=${FLAGS_verity_error_behavior} | 117 dm_verity.error_behavior=${FLAGS_verity_error_behavior} |
| 114 dm_verity.max_bios=${FLAGS_verity_max_ios} | 118 dm_verity.max_bios=${FLAGS_verity_max_ios} |
| 115 dm_verity.dev_wait=${dev_wait} | 119 dm_verity.dev_wait=${dev_wait} |
| 116 ${verity_args} | 120 ${verity_args} |
| 117 ${FLAGS_boot_args} | 121 ${FLAGS_boot_args} |
| 118 EOF | 122 EOF |
| 119 | 123 |
| 120 WORK="${WORK} ${FLAGS_working_dir}/boot.config" | 124 WORK="${WORK} ${FLAGS_working_dir}/boot.config" |
| 121 info "Emitted cross-platform boot params to ${FLAGS_working_dir}/boot.config" | 125 info "Emitted cross-platform boot params to ${FLAGS_working_dir}/boot.config" |
| 122 | 126 |
| 123 # FIXME: At the moment, we're working on signed images for x86 only. ARM will | 127 # FIXME: At the moment, we're working on signed images for x86 only. ARM will |
| 124 # support this before shipping, but at the moment they don't. | 128 # support this before shipping, but at the moment they don't. |
| 125 if [[ "${FLAGS_arch}" = "x86" ]]; then | 129 if [[ "${FLAGS_arch}" = "x86" ]]; then |
| 126 | 130 |
| 127 # Legacy BIOS will use the kernel in the rootfs (via syslinux), as will | 131 # Legacy BIOS will use the kernel in the rootfs (via syslinux), as will |
| 128 # standard EFI BIOS (via grub, from the EFI System Partition). Chrome OS | 132 # standard EFI BIOS (via grub, from the EFI System Partition). Chrome OS |
| 129 # BIOS will use a separate signed kernel partition, which we'll create now. | 133 # BIOS will use a separate signed kernel partition, which we'll create now. |
| 130 # FIXME: remove serial output, debugging messages. | 134 # FIXME: remove serial output, debugging messages. |
| 131 mkdir -p ${FLAGS_working_dir} | 135 mkdir -p ${FLAGS_working_dir} |
| 132 cat <<EOF | cat - "${FLAGS_working_dir}/boot.config" \ | 136 cat <<EOF | cat - "${FLAGS_working_dir}/boot.config" \ |
| 133 > "${FLAGS_working_dir}/config.txt" | 137 > "${FLAGS_working_dir}/config.txt" |
| 134 quiet | |
| 135 console=tty2 | 138 console=tty2 |
| 136 init=/sbin/init | 139 init=/sbin/init |
| 137 add_efi_memmap | 140 add_efi_memmap |
| 138 boot=local | 141 boot=local |
| 139 rootwait | |
| 140 ro | |
| 141 noresume | 142 noresume |
| 142 noswap | 143 noswap |
| 143 i915.modeset=1 | 144 i915.modeset=1 |
| 144 loglevel=1 | |
| 145 cros_secure | 145 cros_secure |
| 146 kern_guid=%U | 146 kern_guid=%U |
| 147 tpm_tis.force=1 | 147 tpm_tis.force=1 |
| 148 tpm_tis.interrupts=0 | 148 tpm_tis.interrupts=0 |
| 149 EOF | 149 EOF |
| 150 WORK="${WORK} ${FLAGS_working_dir}/config.txt" | 150 WORK="${WORK} ${FLAGS_working_dir}/config.txt" |
| 151 | 151 |
| 152 # We sign the image with the recovery_key, because this is what goes onto the | 152 # We sign the image with the recovery_key, because this is what goes onto the |
| 153 # USB key. We can only boot from the USB drive in recovery mode. | 153 # USB key. We can only boot from the USB drive in recovery mode. |
| 154 # For dev install shim, we need to use the installer keyblock instead of | 154 # For dev install shim, we need to use the installer keyblock instead of |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 251 info "Cleaning up temporary files: ${WORK}" | 251 info "Cleaning up temporary files: ${WORK}" |
| 252 rm ${WORK} | 252 rm ${WORK} |
| 253 rmdir ${FLAGS_working_dir} | 253 rmdir ${FLAGS_working_dir} |
| 254 fi | 254 fi |
| 255 | 255 |
| 256 info "Kernel partition image emitted: ${FLAGS_to}" | 256 info "Kernel partition image emitted: ${FLAGS_to}" |
| 257 | 257 |
| 258 if [[ -f ${FLAGS_rootfs_hash} ]]; then | 258 if [[ -f ${FLAGS_rootfs_hash} ]]; then |
| 259 info "Root filesystem hash emitted: ${FLAGS_rootfs_hash}" | 259 info "Root filesystem hash emitted: ${FLAGS_rootfs_hash}" |
| 260 fi | 260 fi |
| OLD | NEW |