mirror of
https://github.com/flatcar/scripts.git
synced 2025-08-09 05:56:58 +02:00
Incorporate the contents of create_esp.sh inline in build_image
Stripped of its boilerplate, create_esp.sh was a one-line script called from only one place in the source. Replace the script with the one command it represented. BUG=chromium-os:17390 TEST=build_image TEST=grep all relevant sources for "create_esp" Change-Id: Iaa4be285066b524ff169f5185c455e2566177648 Reviewed-on: http://gerrit.chromium.org/gerrit/4756 Reviewed-by: Will Drewry <wad@chromium.org> Tested-by: Richard Barnette <jrbarnette@chromium.org>
This commit is contained in:
parent
8447777820
commit
5b80a0b22c
@ -697,8 +697,11 @@ create_base_image() {
|
||||
# expected in build_gpt.sh.
|
||||
cp "${ROOT_FS_DIR}/boot/vmlinuz" "${OUTPUT_DIR}/vmlinuz.image"
|
||||
|
||||
# Create an empty esp image to be updated in by update_bootloaders.sh.
|
||||
${SCRIPTS_DIR}/create_esp.sh --to="${ESP_FS_IMG}"
|
||||
# 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.
|
||||
/usr/sbin/mkfs.vfat -C "${ESP_FS_IMG}" 16384
|
||||
|
||||
# Zero rootfs free space to make it more compressible so auto-update
|
||||
# payloads become smaller
|
||||
|
@ -1,52 +0,0 @@
|
||||
#!/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.
|
||||
|
||||
# --- BEGIN COMMON.SH BOILERPLATE ---
|
||||
# Load common CrOS utilities. Inside the chroot this file is installed in
|
||||
# /usr/lib/crosutils. Outside the chroot we find it relative to the script's
|
||||
# location.
|
||||
find_common_sh() {
|
||||
local common_paths=(/usr/lib/crosutils $(dirname "$(readlink -f "$0")"))
|
||||
local path
|
||||
|
||||
SCRIPT_ROOT=
|
||||
for path in "${common_paths[@]}"; do
|
||||
if [ -r "${path}/common.sh" ]; then
|
||||
SCRIPT_ROOT=${path}
|
||||
break
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
find_common_sh
|
||||
. "${SCRIPT_ROOT}/common.sh" || { echo "Unable to load common.sh"; exit 1; }
|
||||
# --- END COMMON.SH BOILERPLATE ---
|
||||
|
||||
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}
|
Loading…
Reference in New Issue
Block a user