Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(151)

Unified Diff: create_esp.sh

Issue 2829039: [PATCH 4/5] update_bootloaders.sh, create_esp.sh: add two helpers (Closed)
Patch Set: Created 10 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | update_bootloaders.sh » ('j') | update_bootloaders.sh » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: create_esp.sh
diff --git a/create_esp.sh b/create_esp.sh
new file mode 100755
index 0000000000000000000000000000000000000000..5b345e20e1c6e632394fd6d484fb90e6c23caa94
--- /dev/null
+++ b/create_esp.sh
@@ -0,0 +1,34 @@
+#!/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). We only need this for x86, but it's simpler and safer to keep the
+# disk images the same for both x86 and ARM.
+# 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}
« no previous file with comments | « no previous file | update_bootloaders.sh » ('j') | update_bootloaders.sh » ('J')

Powered by Google App Engine
This is Rietveld 408576698