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

Unified Diff: src/scripts/build_gpt.sh

Issue 1520007: Fake the GPT once for ARM to determine parameters for U-Boot script (Closed)
Patch Set: remove blank space Created 10 years, 9 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/scripts/build_gpt.sh
diff --git a/src/scripts/build_gpt.sh b/src/scripts/build_gpt.sh
index 0376734bc21ebc4b5553b9b9a347915aa7003431..f9179b2b8d3f6624b062e304ebbe6ce8097e5cc1 100755
--- a/src/scripts/build_gpt.sh
+++ b/src/scripts/build_gpt.sh
@@ -4,7 +4,6 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
#
-
# Load common constants. This should be the first executable line.
# The path to common.sh should be relative to your script's location.
. "$(dirname "$0")/common.sh"
@@ -103,9 +102,16 @@ fi
# We'll need some code to put in the PMBR, for booting on legacy BIOS. Some ARM
# systems will use a U-Boot script temporarily, but it goes in the same place.
if [[ "$ARCH" = "arm" ]]; then
- # U-Boot script copies the kernel into memory, then boots it.
+ # We need to know the location and size of the kernel so we can create the
+ # U-Boot script to point to it. Let's create one fake GPT first which will
+ # set the appropriate environment variables. Then we can create the correct
+ # script and install it for real. A bit awkward, but this is only temporary.
+ echo "Installing fake GPT first, to calculate locations..."
+ install_gpt $OUTDEV $ROOTFS_IMG $KERNEL_IMG $STATEFUL_IMG /dev/zero
+
+ # Create the U-Boot script to copy the kernel into memory and boot it.
KERNEL_OFFSET=$(printf "0x%08x" ${START_KERN_A})
- KERNEL_SECS_HEX=$(printf "0x%08x" ${NUM_KERN_BLOCKS})
+ KERNEL_SECS_HEX=$(printf "0x%08x" ${NUM_KERN_SECTORS})
MBR_SCRIPT="${IMAGEDIR}/mbr_script"
echo -e "echo\necho ---- ChromeOS Boot ----\necho\n" \
"mmc read 1 C0008000 $KERNEL_OFFSET $KERNEL_SECS_HEX\n" \
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698