OLD | NEW |
(Empty) | |
| 1 #!/bin/bash |
| 2 |
| 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 |
| 5 # found in the LICENSE file. |
| 6 |
| 7 # Creates an empty ESP image. |
| 8 |
| 9 . "$(dirname "$0")/common.sh" |
| 10 |
| 11 get_default_board |
| 12 |
| 13 # Flags. |
| 14 DEFINE_string to "/tmp/esp.img" \ |
| 15 "Path to esp image (Default: /tmp/esp.img)" |
| 16 |
| 17 # Parse flags |
| 18 FLAGS "$@" || exit 1 |
| 19 eval set -- "${FLAGS_ARGV}" |
| 20 set -e |
| 21 |
| 22 if [[ -e "${FLAGS_to}" ]]; then |
| 23 info "ESP already exists: ${FLAGS_to}" |
| 24 exit 0 |
| 25 fi |
| 26 |
| 27 info "Creating a new esp image at ${FLAGS_to}" anyway. |
| 28 # Create EFI System Partition to boot stock EFI BIOS (but not ChromeOS EFI |
| 29 # BIOS). We only need this for x86, but it's simpler and safer to keep the |
| 30 # disk images the same for both x86 and ARM. |
| 31 # NOTE: The size argument for mkfs.vfat is in 1024-byte blocks. |
| 32 # We'll hard-code it to 16M for now. |
| 33 ESP_BLOCKS=16384 |
| 34 /usr/sbin/mkfs.vfat -C "${FLAGS_to}" ${ESP_BLOCKS} |
OLD | NEW |