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 # Script which ensures that a given image has an up-to-date | 7 # Script which ensures that a given image has an up-to-date |
8 # kernel partition, rootfs integrity hashes, and legacy bootloader configs. | 8 # kernel partition, rootfs integrity hashes, and legacy bootloader configs. |
9 | 9 |
10 # Load common constants. This should be the first executable line. | 10 # Load common constants. This should be the first executable line. |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 "Directory to place output in." | 61 "Directory to place output in." |
62 DEFINE_string image "chromiumos_base.img" \ | 62 DEFINE_string image "chromiumos_base.img" \ |
63 "Full path to the chromiumos image to make bootable." | 63 "Full path to the chromiumos image to make bootable." |
64 DEFINE_string arch "x86" \ | 64 DEFINE_string arch "x86" \ |
65 "Architecture to make bootable for: arm or x86" | 65 "Architecture to make bootable for: arm or x86" |
66 DEFINE_string usb_disk "/dev/sdb3" \ | 66 DEFINE_string usb_disk "/dev/sdb3" \ |
67 "Path syslinux should use to do a usb boot." | 67 "Path syslinux should use to do a usb boot." |
68 DEFINE_boolean cleanup_dirs ${FLAGS_TRUE} \ | 68 DEFINE_boolean cleanup_dirs ${FLAGS_TRUE} \ |
69 "Whether the mount dirs should be removed on completion." | 69 "Whether the mount dirs should be removed on completion." |
70 | 70 |
| 71 DEFINE_string boot_args "noinitrd" \ |
| 72 "Additional boot arguments to pass to the commandline" |
| 73 |
71 DEFINE_integer rootfs_size 720 \ | 74 DEFINE_integer rootfs_size 720 \ |
72 "rootfs filesystem size in MBs." | 75 "rootfs filesystem size in MBs." |
73 # ceil(0.1 * rootfs_size) is a good minimum. | 76 # ceil(0.1 * rootfs_size) is a good minimum. |
74 DEFINE_integer rootfs_hash_pad 8 \ | 77 DEFINE_integer rootfs_hash_pad 8 \ |
75 "MBs reserved at the end of the rootfs image." | 78 "MBs reserved at the end of the rootfs image." |
76 | 79 |
77 DEFINE_string rootfs_hash "/tmp/rootfs.hash" \ | 80 DEFINE_string rootfs_hash "/tmp/rootfs.hash" \ |
78 "Path where the rootfs hash should be stored." | 81 "Path where the rootfs hash should be stored." |
79 DEFINE_boolean enable_rootfs_verification ${FLAGS_FALSE} \ | 82 DEFINE_boolean enable_rootfs_verification ${FLAGS_FALSE} \ |
80 "Default all bootloaders to use kernel-based root fs integrity checking." | 83 "Default all bootloaders to use kernel-based root fs integrity checking." |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 fi | 153 fi |
151 | 154 |
152 # Builds the kernel partition image. The temporary files are kept around | 155 # Builds the kernel partition image. The temporary files are kept around |
153 # so that we can perform a load_kernel_test later on the final image. | 156 # so that we can perform a load_kernel_test later on the final image. |
154 ${SCRIPTS_DIR}/build_kernel_image.sh \ | 157 ${SCRIPTS_DIR}/build_kernel_image.sh \ |
155 --arch="${FLAGS_arch}" \ | 158 --arch="${FLAGS_arch}" \ |
156 --to="${FLAGS_output_dir}/vmlinuz.image" \ | 159 --to="${FLAGS_output_dir}/vmlinuz.image" \ |
157 --hd_vblock="${FLAGS_output_dir}/vmlinuz_hd.vblock" \ | 160 --hd_vblock="${FLAGS_output_dir}/vmlinuz_hd.vblock" \ |
158 --vmlinuz="${FLAGS_rootfs_mountpoint}/boot/vmlinuz" \ | 161 --vmlinuz="${FLAGS_rootfs_mountpoint}/boot/vmlinuz" \ |
159 --working_dir="${FLAGS_output_dir}" \ | 162 --working_dir="${FLAGS_output_dir}" \ |
| 163 --boot_args="${FLAGS_boot_args}" \ |
160 --keep_work \ | 164 --keep_work \ |
161 --rootfs_image=${root_dev} \ | 165 --rootfs_image=${root_dev} \ |
162 --rootfs_hash=${FLAGS_rootfs_hash} \ | 166 --rootfs_hash=${FLAGS_rootfs_hash} \ |
163 --verity_hash_alg=${FLAGS_verity_algorithm} \ | 167 --verity_hash_alg=${FLAGS_verity_algorithm} \ |
164 --verity_tree_depth=${FLAGS_verity_depth} \ | 168 --verity_tree_depth=${FLAGS_verity_depth} \ |
165 --verity_max_ios=${FLAGS_verity_max_ios} \ | 169 --verity_max_ios=${FLAGS_verity_max_ios} \ |
166 --verity_error_behavior=${FLAGS_verity_error_behavior} \ | 170 --verity_error_behavior=${FLAGS_verity_error_behavior} \ |
167 --root=${cros_root} \ | 171 --root=${cros_root} \ |
168 --keys_dir="${FLAGS_keys_dir}" \ | 172 --keys_dir="${FLAGS_keys_dir}" \ |
169 ${use_dev_keys} | 173 ${use_dev_keys} |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
252 mkdir -p ${FLAGS_statefulfs_mountpoint} | 256 mkdir -p ${FLAGS_statefulfs_mountpoint} |
253 mkdir -p ${FLAGS_espfs_mountpoint} | 257 mkdir -p ${FLAGS_espfs_mountpoint} |
254 | 258 |
255 make_image_bootable ${IMAGE} | 259 make_image_bootable ${IMAGE} |
256 | 260 |
257 if [ ${FLAGS_cleanup_dirs} -eq ${FLAGS_TRUE} ]; then | 261 if [ ${FLAGS_cleanup_dirs} -eq ${FLAGS_TRUE} ]; then |
258 rmdir ${FLAGS_rootfs_mountpoint} | 262 rmdir ${FLAGS_rootfs_mountpoint} |
259 rmdir ${FLAGS_statefulfs_mountpoint} | 263 rmdir ${FLAGS_statefulfs_mountpoint} |
260 rmdir ${FLAGS_espfs_mountpoint} | 264 rmdir ${FLAGS_espfs_mountpoint} |
261 fi | 265 fi |
OLD | NEW |