OLD | NEW |
1 #!/bin/bash | 1 #!/bin/bash |
2 # | 2 # |
3 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 3 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. |
4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
6 # | 6 # |
7 # Load common constants. This should be the first executable line. | 7 # Load common constants. This should be the first executable line. |
8 # The path to common.sh should be relative to your script's location. | 8 # The path to common.sh should be relative to your script's location. |
9 . "$(dirname "$0")/common.sh" | 9 . "$(dirname "$0")/common.sh" |
10 | 10 |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 # We'll need some code to put in the PMBR, for booting on legacy BIOS. Some ARM | 112 # We'll need some code to put in the PMBR, for booting on legacy BIOS. Some ARM |
113 # systems will use a U-Boot script temporarily, but it goes in the same place. | 113 # systems will use a U-Boot script temporarily, but it goes in the same place. |
114 if [[ "$ARCH" = "arm" ]]; then | 114 if [[ "$ARCH" = "arm" ]]; then |
115 PMBRCODE=/dev/zero | 115 PMBRCODE=/dev/zero |
116 else | 116 else |
117 PMBRCODE=$(readlink -f /usr/share/syslinux/gptmbr.bin) | 117 PMBRCODE=$(readlink -f /usr/share/syslinux/gptmbr.bin) |
118 fi | 118 fi |
119 | 119 |
120 # Create the GPT. This has the side-effect of setting some global vars | 120 # Create the GPT. This has the side-effect of setting some global vars |
121 # describing the partition table entries (see the comments in the source). | 121 # describing the partition table entries (see the comments in the source). |
122 install_gpt $OUTDEV $ROOTFS_IMG $STATEFUL_IMG $PMBRCODE $ESP_IMG \ | 122 install_gpt $OUTDEV $(numsectors $ROOTFS_IMG) $(numsectors $STATEFUL_IMG) \ |
123 false $FLAGS_rootfs_partition_size | 123 $PMBRCODE $(numsectors $ESP_IMG) false $FLAGS_rootfs_partition_size |
124 | 124 |
125 if [[ "$ARCH" = "arm" ]]; then | 125 if [[ "$ARCH" = "arm" ]]; then |
126 # assume /dev/mmcblk1. we could not get this from ${OUTDEV} | 126 # assume /dev/mmcblk1. we could not get this from ${OUTDEV} |
127 DEVICE=1 | 127 DEVICE=1 |
128 MBR_SCRIPT_UIMG=$(make_arm_mbr \ | 128 MBR_SCRIPT_UIMG=$(make_arm_mbr \ |
129 ${START_KERN_A} \ | 129 ${START_KERN_A} \ |
130 ${NUM_KERN_SECTORS} \ | 130 ${NUM_KERN_SECTORS} \ |
131 ${DEVICE} \ | 131 ${DEVICE} \ |
132 "${FLAGS_arm_extra_bootargs}") | 132 "${FLAGS_arm_extra_bootargs}") |
133 sudo dd bs=1 count=`stat --printf="%s" ${MBR_SCRIPT_UIMG}` \ | 133 sudo dd bs=1 count=`stat --printf="%s" ${MBR_SCRIPT_UIMG}` \ |
(...skipping 24 matching lines...) Expand all Loading... |
158 $sudo dd if=${ROOTFS_IMG} of=${OUTDEV} conv=notrunc bs=512 \ | 158 $sudo dd if=${ROOTFS_IMG} of=${OUTDEV} conv=notrunc bs=512 \ |
159 seek=${START_ROOTFS_A} | 159 seek=${START_ROOTFS_A} |
160 | 160 |
161 echo "Copying EFI system partition..." | 161 echo "Copying EFI system partition..." |
162 $sudo dd if=${ESP_IMG} of=${OUTDEV} conv=notrunc bs=512 seek=${START_ESP} | 162 $sudo dd if=${ESP_IMG} of=${OUTDEV} conv=notrunc bs=512 seek=${START_ESP} |
163 | 163 |
164 # Clean up temporary files. | 164 # Clean up temporary files. |
165 if [[ -n "${MBR_IMG:-}" ]]; then | 165 if [[ -n "${MBR_IMG:-}" ]]; then |
166 rm "${MBR_IMG}" | 166 rm "${MBR_IMG}" |
167 fi | 167 fi |
OLD | NEW |