| 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 legacy/efi bootloader partitions. | 7 # Helper script that generates the legacy/efi bootloader partitions. |
| 8 # It does not populate the templates, but can update a loop device. | 8 # It does not populate the templates, but can update a loop device. |
| 9 | 9 |
| 10 . "$(dirname "$0")/common.sh" | 10 . "$(dirname "$0")/common.sh" |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 update_x86_bootloaders "${old_root}" \ | 173 update_x86_bootloaders "${old_root}" \ |
| 174 "${kernel_cfg}" \ | 174 "${kernel_cfg}" \ |
| 175 "${ESP_FS_DIR}" \ | 175 "${ESP_FS_DIR}" \ |
| 176 "${FLAGS_from}" | 176 "${FLAGS_from}" |
| 177 | 177 |
| 178 # Install the syslinux loader on the ESP image (part 12) so it is ready when | 178 # Install the syslinux loader on the ESP image (part 12) so it is ready when |
| 179 # we cut over from rootfs booting (extlinux). | 179 # we cut over from rootfs booting (extlinux). |
| 180 if [[ ${FLAGS_install_syslinux} -eq ${FLAGS_TRUE} ]]; then | 180 if [[ ${FLAGS_install_syslinux} -eq ${FLAGS_TRUE} ]]; then |
| 181 sudo umount "${ESP_FS_DIR}" | 181 sudo umount "${ESP_FS_DIR}" |
| 182 sudo syslinux -d /syslinux "${ESP_DEV}" | 182 sudo syslinux -d /syslinux "${ESP_DEV}" |
| 183 # mount again for cleanup to free resource gracefully |
| 184 sudo mount -o ro "${ESP_DEV}" "${ESP_FS_DIR}" |
| 183 fi | 185 fi |
| 184 elif [[ "${FLAGS_arch}" = "arm" ]]; then | 186 elif [[ "${FLAGS_arch}" = "arm" ]]; then |
| 185 # Copy u-boot script to ESP partition | 187 # Copy u-boot script to ESP partition |
| 186 if [ -r "${FLAGS_from}/boot-A.scr.uimg" ]; then | 188 if [ -r "${FLAGS_from}/boot-A.scr.uimg" ]; then |
| 187 sudo mkdir -p "${ESP_FS_DIR}/u-boot" | 189 sudo mkdir -p "${ESP_FS_DIR}/u-boot" |
| 188 sudo cp "${FLAGS_from}/boot-A.scr.uimg" \ | 190 sudo cp "${FLAGS_from}/boot-A.scr.uimg" \ |
| 189 "${ESP_FS_DIR}/u-boot/boot.scr.uimg" | 191 "${ESP_FS_DIR}/u-boot/boot.scr.uimg" |
| 190 fi | 192 fi |
| 191 fi | 193 fi |
| 192 | 194 |
| 193 set +e | 195 set +e |
| OLD | NEW |