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 # --- BEGIN COMMON.SH BOILERPLATE --- | 7 # --- BEGIN COMMON.SH BOILERPLATE --- |
8 # Load common CrOS utilities. Inside the chroot this file is installed in | 8 # Load common CrOS utilities. Inside the chroot this file is installed in |
9 # /usr/lib/crosutils. Outside the chroot we find it relative to the script's | 9 # /usr/lib/crosutils. Outside the chroot we find it relative to the script's |
10 # location. | 10 # location. |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 error "Can't find ${KERNEL_IMG}" | 110 error "Can't find ${KERNEL_IMG}" |
111 exit 1 | 111 exit 1 |
112 fi | 112 fi |
113 | 113 |
114 STATEFUL_IMG="${IMAGEDIR}/stateful_partition.image" | 114 STATEFUL_IMG="${IMAGEDIR}/stateful_partition.image" |
115 if [ ! -s ${STATEFUL_IMG} ]; then | 115 if [ ! -s ${STATEFUL_IMG} ]; then |
116 error "Can't find ${STATEFUL_IMG}" | 116 error "Can't find ${STATEFUL_IMG}" |
117 exit 1 | 117 exit 1 |
118 fi | 118 fi |
119 | 119 |
120 OEM_IMG="${IMAGEDIR}/partner_partition.image" | |
121 if [[ ! -s ${OEM_IMG} ]]; then | |
122 error "Can't find ${OEM_IMG}" | |
123 exit 1 | |
124 fi | |
125 | |
126 ESP_IMG="${IMAGEDIR}/esp.image" | 120 ESP_IMG="${IMAGEDIR}/esp.image" |
127 if [ ! -s ${ESP_IMG} ]; then | 121 if [ ! -s ${ESP_IMG} ]; then |
128 error "Can't find ${ESP_IMG}" | 122 error "Can't find ${ESP_IMG}" |
129 exit 1 | 123 exit 1 |
130 fi | 124 fi |
131 | 125 |
132 # We'll need some code to put in the PMBR, for booting on legacy BIOS. | 126 # We'll need some code to put in the PMBR, for booting on legacy BIOS. |
133 if [[ "$ARCH" = "arm" ]]; then | 127 if [[ "$ARCH" = "arm" ]]; then |
134 PMBRCODE=/dev/zero | 128 PMBRCODE=/dev/zero |
135 else | 129 else |
(...skipping 12 matching lines...) Expand all Loading... |
148 if [ ! -w "$OUTDEV" ] ; then | 142 if [ ! -w "$OUTDEV" ] ; then |
149 # use sudo when writing to a block device. | 143 # use sudo when writing to a block device. |
150 sudo=sudo | 144 sudo=sudo |
151 fi | 145 fi |
152 | 146 |
153 # Now populate the partitions. | 147 # Now populate the partitions. |
154 echo "Copying stateful partition..." | 148 echo "Copying stateful partition..." |
155 $sudo dd if=${STATEFUL_IMG} of=${OUTDEV} conv=notrunc bs=512 \ | 149 $sudo dd if=${STATEFUL_IMG} of=${OUTDEV} conv=notrunc bs=512 \ |
156 seek=${START_STATEFUL} | 150 seek=${START_STATEFUL} |
157 | 151 |
158 echo "Copying OEM partition..." | |
159 $sudo dd if=${OEM_IMG} of=${OUTDEV} conv=notrunc bs=512 seek=${START_OEM} | |
160 | |
161 echo "Copying kernel..." | 152 echo "Copying kernel..." |
162 $sudo dd if=${KERNEL_IMG} of=${OUTDEV} conv=notrunc bs=512 seek=${START_KERN_A} | 153 $sudo dd if=${KERNEL_IMG} of=${OUTDEV} conv=notrunc bs=512 seek=${START_KERN_A} |
163 | 154 |
164 echo "Copying rootfs..." | 155 echo "Copying rootfs..." |
165 $sudo dd if=${ROOTFS_IMG} of=${OUTDEV} conv=notrunc bs=512 \ | 156 $sudo dd if=${ROOTFS_IMG} of=${OUTDEV} conv=notrunc bs=512 \ |
166 seek=${START_ROOTFS_A} | 157 seek=${START_ROOTFS_A} |
167 | 158 |
168 echo "Copying EFI system partition..." | 159 echo "Copying EFI system partition..." |
169 $sudo dd if=${ESP_IMG} of=${OUTDEV} conv=notrunc bs=512 seek=${START_ESP} | 160 $sudo dd if=${ESP_IMG} of=${OUTDEV} conv=notrunc bs=512 seek=${START_ESP} |
170 | 161 |
171 # Clean up temporary files. | 162 # Clean up temporary files. |
172 if [[ -n "${MBR_IMG:-}" ]]; then | 163 if [[ -n "${MBR_IMG:-}" ]]; then |
173 rm "${MBR_IMG}" | 164 rm "${MBR_IMG}" |
174 fi | 165 fi |
OLD | NEW |