mirror of
https://github.com/flatcar/scripts.git
synced 2025-08-08 05:26:58 +02:00
- I looked at all of the x86 and ARM paths through out build image scripts, these changes clean up stale comments, stale code, and unforks some small things. BUG=none TEST=Built images for x86-generic, arm-generic and tegra2-seaboard, booted tegra2-seaboard image. Review URL: http://codereview.chromium.org/3448022 Change-Id: Ibad2774ff2cbf5f15528454506542b87e43e24a2
34 lines
882 B
Bash
Executable File
34 lines
882 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
|
|
# Use of this source code is governed by a BSD-style license that can be
|
|
# found in the LICENSE file.
|
|
|
|
# Creates an empty ESP image.
|
|
|
|
. "$(dirname "$0")/common.sh"
|
|
|
|
get_default_board
|
|
|
|
# Flags.
|
|
DEFINE_string to "/tmp/esp.img" \
|
|
"Path to esp image (Default: /tmp/esp.img)"
|
|
|
|
# Parse flags
|
|
FLAGS "$@" || exit 1
|
|
eval set -- "${FLAGS_ARGV}"
|
|
set -e
|
|
|
|
if [[ -e "${FLAGS_to}" ]]; then
|
|
info "ESP already exists: ${FLAGS_to}"
|
|
exit 0
|
|
fi
|
|
|
|
info "Creating a new esp image at ${FLAGS_to}" anyway.
|
|
# Create EFI System Partition to boot stock EFI BIOS (but not ChromeOS EFI
|
|
# BIOS). ARM uses this space to determine which partition is bootable.
|
|
# NOTE: The size argument for mkfs.vfat is in 1024-byte blocks.
|
|
# We'll hard-code it to 16M for now.
|
|
ESP_BLOCKS=16384
|
|
/usr/sbin/mkfs.vfat -C "${FLAGS_to}" ${ESP_BLOCKS}
|