| 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 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 of="${image}" \ | 184 of="${image}" \ |
| 185 conv=notrunc | 185 conv=notrunc |
| 186 # We don't need to keep the file around anymore. | 186 # We don't need to keep the file around anymore. |
| 187 sudo rm "${FLAGS_rootfs_hash}" | 187 sudo rm "${FLAGS_rootfs_hash}" |
| 188 | 188 |
| 189 # Move the verification block needed for the hard disk install to the | 189 # Move the verification block needed for the hard disk install to the |
| 190 # stateful partition. Mount stateful fs, copy file, and umount fs. | 190 # stateful partition. Mount stateful fs, copy file, and umount fs. |
| 191 # In original CL: http://codereview.chromium.org/2868044, this was done in | 191 # In original CL: http://codereview.chromium.org/2868044, this was done in |
| 192 # create_base_image(). However, it could break the build if it is a clean | 192 # create_base_image(). However, it could break the build if it is a clean |
| 193 # build because vmlinuz_hd.vblock hasn't been created by build_kernel_image.sh | 193 # build because vmlinuz_hd.vblock hasn't been created by build_kernel_image.sh |
| 194 if [[ "${FLAGS_arch}" = "x86" ]]; then | 194 sudo cp "${FLAGS_output_dir}/vmlinuz_hd.vblock" \ |
| 195 sudo cp "${FLAGS_output_dir}/vmlinuz_hd.vblock" \ | 195 "${FLAGS_statefulfs_mountpoint}" |
| 196 "${FLAGS_statefulfs_mountpoint}" | |
| 197 fi | |
| 198 | 196 |
| 199 # START_KERN_A is set by the first call to install the gpt. | 197 # START_KERN_A is set by the first call to install the gpt. |
| 200 local koffset="$(partoffset ${image} 2)" | 198 local koffset="$(partoffset ${image} 2)" |
| 201 sudo dd if="${FLAGS_output_dir}/vmlinuz.image" of="${image}" \ | 199 sudo dd if="${FLAGS_output_dir}/vmlinuz.image" of="${image}" \ |
| 202 conv=notrunc bs=512 seek=${koffset} | 200 conv=notrunc bs=512 seek=${koffset} |
| 203 | 201 |
| 204 # Update the bootloaders. For legacy/efi x86, the EFI system partition | 202 # Update the bootloaders. For legacy/efi x86, the EFI system partition |
| 205 # will be updated and for arm, the mbr will be updated (for u-boot). | 203 # will be updated and for arm, the mbr will be updated (for u-boot). |
| 206 local kernel_part= | 204 local kernel_part= |
| 207 local usb_disk="${FLAGS_usb_disk}" | 205 local usb_disk="${FLAGS_usb_disk}" |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 253 mkdir -p ${FLAGS_statefulfs_mountpoint} | 251 mkdir -p ${FLAGS_statefulfs_mountpoint} |
| 254 mkdir -p ${FLAGS_espfs_mountpoint} | 252 mkdir -p ${FLAGS_espfs_mountpoint} |
| 255 | 253 |
| 256 make_image_bootable ${IMAGE} | 254 make_image_bootable ${IMAGE} |
| 257 | 255 |
| 258 if [ ${FLAGS_cleanup_dirs} -eq ${FLAGS_TRUE} ]; then | 256 if [ ${FLAGS_cleanup_dirs} -eq ${FLAGS_TRUE} ]; then |
| 259 rmdir ${FLAGS_rootfs_mountpoint} | 257 rmdir ${FLAGS_rootfs_mountpoint} |
| 260 rmdir ${FLAGS_statefulfs_mountpoint} | 258 rmdir ${FLAGS_statefulfs_mountpoint} |
| 261 rmdir ${FLAGS_espfs_mountpoint} | 259 rmdir ${FLAGS_espfs_mountpoint} |
| 262 fi | 260 fi |
| OLD | NEW |