From 5b80a0b22c7979ebb0cf80f8c075f5287d35eca7 Mon Sep 17 00:00:00 2001 From: "J. Richard Barnette" Date: Tue, 26 Jul 2011 14:14:17 -0700 Subject: [PATCH] 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 Tested-by: Richard Barnette --- build_image | 7 +++++-- create_esp.sh | 52 --------------------------------------------------- 2 files changed, 5 insertions(+), 54 deletions(-) delete mode 100755 create_esp.sh diff --git a/build_image b/build_image index 409818dcce..bf2ddbece4 100755 --- a/build_image +++ b/build_image @@ -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 diff --git a/create_esp.sh b/create_esp.sh deleted file mode 100755 index 9d6a677443..0000000000 --- a/create_esp.sh +++ /dev/null @@ -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}