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

Side by Side Diff: build_image

Issue 2823010: Created wrapper methods for create_base_image and image updates. (Closed) Base URL: ssh://git@chromiumos-git/crosutils.git
Patch Set: Created wrapper methods for create_base_image and image updates to prepare for --preserve. 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/bin/bash 1 #!/bin/bash
2 2
3 # Copyright (c) 2009 The Chromium OS Authors. All rights reserved. 3 # Copyright (c) 2009 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 # Script to build a bootable keyfob-based chromeos system image from within 7 # Script to build a bootable keyfob-based chromeos system image from within
8 # a chromiumos setup. This assumes that all needed packages have been built into 8 # a chromiumos setup. This assumes that all needed packages have been built into
9 # the given target's root with binary packages turned on. This script will 9 # the given target's root with binary packages turned on. This script will
10 # build the Chrome OS image using only pre-built binary packages. 10 # build the Chrome OS image using only pre-built binary packages.
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 . "${TOP_SCRIPTS_DIR}/.emerge" 77 . "${TOP_SCRIPTS_DIR}/.emerge"
78 fi 78 fi
79 79
80 # Determine build version. 80 # Determine build version.
81 . "${SCRIPTS_DIR}/chromeos_version.sh" 81 . "${SCRIPTS_DIR}/chromeos_version.sh"
82 82
83 # Use canonical path since some tools (e.g. mount) do not like symlinks. 83 # Use canonical path since some tools (e.g. mount) do not like symlinks.
84 # Append build attempt to output directory. 84 # Append build attempt to output directory.
85 IMAGE_SUBDIR="${CHROMEOS_VERSION_STRING}-a${FLAGS_build_attempt}" 85 IMAGE_SUBDIR="${CHROMEOS_VERSION_STRING}-a${FLAGS_build_attempt}"
86 OUTPUT_DIR="${FLAGS_output_root}/${FLAGS_board}/${IMAGE_SUBDIR}" 86 OUTPUT_DIR="${FLAGS_output_root}/${FLAGS_board}/${IMAGE_SUBDIR}"
87 ROOT_FS_DIR="${OUTPUT_DIR}/rootfs" 87
88 ROOT_FS_IMG="${OUTPUT_DIR}/rootfs.image" 88 OUTSIDE_OUTPUT_DIR="../build/images/${FLAGS_board}/${IMAGE_SUBDIR}"
89 89
90 # If we are creating a developer image, also create a pristine image with a 90 # If we are creating a developer image, also create a pristine image with a
91 # different name. 91 # different name.
92 DEVELOPER_IMAGE_NAME= 92 DEVELOPER_IMAGE_NAME=
93 PRISTINE_IMAGE_NAME=chromiumos_image.bin 93 PRISTINE_IMAGE_NAME=chromiumos_image.bin
94 if [ "${FLAGS_withdev}" -eq "${FLAGS_TRUE}" ]; then 94 if [ "${FLAGS_withdev}" -eq "${FLAGS_TRUE}" ]; then
95 PRISTINE_IMAGE_NAME=chromiumos_base_image.bin 95 PRISTINE_IMAGE_NAME=chromiumos_base_image.bin
96 DEVELOPER_IMAGE_NAME=chromiumos_image.bin 96 DEVELOPER_IMAGE_NAME=chromiumos_image.bin
97 fi 97 fi
98 98
99 # If we are creating a recovery image, rename pristine image. 99 # If we are creating a recovery image, rename pristine image.
100 if [ "${FLAGS_recovery}" -eq "${FLAGS_TRUE}" ]; then 100 if [ "${FLAGS_recovery}" -eq "${FLAGS_TRUE}" ]; then
101 PRISTINE_IMAGE_NAME=recovery_image.bin 101 PRISTINE_IMAGE_NAME=recovery_image.bin
102 fi 102 fi
103 103
104 OUTPUT_IMG=${FLAGS_to:-${OUTPUT_DIR}/${PRISTINE_IMAGE_NAME}} 104 OUTPUT_IMG=${FLAGS_to:-${OUTPUT_DIR}/${PRISTINE_IMAGE_NAME}}
105 105
106 BOARD="${FLAGS_board}" 106 BOARD="${FLAGS_board}"
107 BOARD_ROOT="${FLAGS_build_root}/${BOARD}" 107 BOARD_ROOT="${FLAGS_build_root}/${BOARD}"
108 108
109 ROOT_FS_DIR="${OUTPUT_DIR}/rootfs"
110 ROOT_FS_IMG="${OUTPUT_DIR}/rootfs.image"
111
112 STATEFUL_IMG="${OUTPUT_DIR}/stateful_partition.image"
113 STATEFUL_DIR="${OUTPUT_DIR}/stateful_partition"
114
115 ESP_IMG=${OUTPUT_DIR}/esp.image
116 ESP_DIR=${OUTPUT_DIR}/esp
117
109 LOOP_DEV= 118 LOOP_DEV=
110 STATEFUL_LOOP_DEV= 119 STATEFUL_LOOP_DEV=
111 ESP_LOOP_DEV= 120 ESP_LOOP_DEV=
112 121
122 # ${DEV_IMAGE_ROOT} specifies the location of where developer packages will
123 # be installed on the stateful dir. On a Chromium OS system, this will
124 # translate to /usr/local.
125 DEV_IMAGE_ROOT="${STATEFUL_DIR}/dev_image"
126
113 # What cross-build are we targeting? 127 # What cross-build are we targeting?
114 . "${BOARD_ROOT}/etc/make.conf.board_setup" 128 . "${BOARD_ROOT}/etc/make.conf.board_setup"
115 LIBC_VERSION=${LIBC_VERSION:-"2.10.1-r1"} 129 LIBC_VERSION=${LIBC_VERSION:-"2.10.1-r1"}
116 130
131 INSTALL_MASK=""
132 if [[ ${FLAGS_installmask} -eq ${FLAGS_TRUE} ]] ; then
133 INSTALL_MASK="${DEFAULT_INSTALL_MASK}"
134 fi
135
136 # Reduce the size of factory install shim.
137 # TODO: Build a separated ebuild for the factory install shim to reduce size.
138 if [[ ${FLAGS_factory_install} -eq ${FLAGS_TRUE} ]] ; then
139 INSTALL_MASK="${INSTALL_MASK} ${FACTORY_INSTALL_MASK}"
140 fi
141
142 if [[ ${FLAGS_jobs} -ne -1 ]]; then
143 EMERGE_JOBS="--jobs=${FLAGS_jobs}"
144 fi
145
117 # Figure out ARCH from the given toolchain. 146 # Figure out ARCH from the given toolchain.
118 # TODO: Move to common.sh as a function after scripts are switched over. 147 # TODO: Move to common.sh as a function after scripts are switched over.
119 TC_ARCH=$(echo "${CHOST}" | awk -F'-' '{ print $1 }') 148 TC_ARCH=$(echo "${CHOST}" | awk -F'-' '{ print $1 }')
120 case "${TC_ARCH}" in 149 case "${TC_ARCH}" in
121 arm*) 150 arm*)
122 ARCH="arm" 151 ARCH="arm"
123 ;; 152 ;;
124 *86) 153 *86)
125 ARCH="x86" 154 ARCH="x86"
126 ;; 155 ;;
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 sudo rm -rf "${OUTPUT_DIR}" 221 sudo rm -rf "${OUTPUT_DIR}"
193 echo "Deleted ${OUTPUT_DIR}" 222 echo "Deleted ${OUTPUT_DIR}"
194 else 223 else
195 echo "Not deleting ${OUTPUT_DIR}. Note dev server updates will not work" \ 224 echo "Not deleting ${OUTPUT_DIR}. Note dev server updates will not work" \
196 "until you successfully build another image or delete this directory" 225 "until you successfully build another image or delete this directory"
197 fi 226 fi
198 } 227 }
199 228
200 # $1 - Directory where developer rootfs is mounted. 229 # $1 - Directory where developer rootfs is mounted.
201 # $2 - Directory where developer stateful_partition is mounted. 230 # $2 - Directory where developer stateful_partition is mounted.
202 developer_cleanup() { 231 mount_gpt_cleanup() {
203 "${SCRIPTS_DIR}/mount_gpt_image.sh" -u -r "$1" -s "$2" 232 "${SCRIPTS_DIR}/mount_gpt_image.sh" -u -r "$1" -s "$2"
204 delete_prompt 233 delete_prompt
205 } 234 }
206 235
207 # Creates a modified image based on ${OUTPUT_IMG} with additional packages. 236 # Creates a modified image based on ${OUTPUT_IMG} with additional packages.
208 create_mod_image() { 237 update_dev_packages() {
209 local image_type=$1
210 local root_fs_dir="${OUTPUT_DIR}/rootfs_dev" 238 local root_fs_dir="${OUTPUT_DIR}/rootfs_dev"
211 local root_fs_img="${OUTPUT_DIR}/rootfs_dev.image" 239 local root_fs_img="${OUTPUT_DIR}/rootfs_dev.image"
212 local image_to_mount=${DEVELOPER_IMAGE_NAME} 240 local image_to_mount=${DEVELOPER_IMAGE_NAME}
213 local output_img="${OUTPUT_DIR}/${image_to_mount}" 241 local output_img="${OUTPUT_DIR}/${image_to_mount}"
214 242
215 # Create stateful partition of the same size as the rootfs. 243 # Create stateful partition of the same size as the rootfs.
216 local stateful_img="${OUTPUT_DIR}/stateful_partition_dev.image" 244 local stateful_img="${OUTPUT_DIR}/stateful_partition_dev.image"
217 local stateful_dir="${OUTPUT_DIR}/stateful_partition_dev" 245 local stateful_dir="${OUTPUT_DIR}/stateful_partition_dev"
218 local file_to_touch=".dev_mode" 246 local file_to_touch=".dev_mode"
219 247
220 trap "developer_cleanup \"${root_fs_dir}\" \"${stateful_dir}\"" EXIT 248 trap "mount_gpt_cleanup \"${root_fs_dir}\" \"${stateful_dir}\"" EXIT
221 249
222 if [ "${image_type}" == "dev" ]; then 250 # Mount a new copy of the base image.
223 # Mount a new copy of the base image. 251 echo "Creating developer image from base image ${OUTPUT_IMG}"
224 echo "Creating developer image from base image ${OUTPUT_IMG}" 252 cp "${OUTPUT_IMG}" "${output_img}"
225 cp "${OUTPUT_IMG}" "${output_img}"
226 elif [ "${image_type}" == "recovery" ]; then
227 image_to_mount=${PRISTINE_IMAGE_NAME}
228 file_to_touch=".recovery_installer"
229 fi
230 253
231 ${SCRIPTS_DIR}/mount_gpt_image.sh --from "${OUTPUT_DIR}" \ 254 ${SCRIPTS_DIR}/mount_gpt_image.sh --from "${OUTPUT_DIR}" \
232 --image "${image_to_mount}" -r "${root_fs_dir}" -s "${stateful_dir}" 255 --image "${image_to_mount}" -r "${root_fs_dir}" -s "${stateful_dir}"
233 256
234 if [ "${image_type}" == "dev" ]; then 257 # Determine the root dir for developer packages.
235 # Determine the root dir for developer packages. 258 local root_dev_dir="${root_fs_dir}"
236 local root_dev_dir="${root_fs_dir}" 259 [ ${FLAGS_statefuldev} -eq ${FLAGS_TRUE} ] && \
237 [ ${FLAGS_statefuldev} -eq ${FLAGS_TRUE} ] && \ 260 root_dev_dir="${root_fs_dir}/usr/local"
238 root_dev_dir="${root_fs_dir}/usr/local"
239 261
240 # Install developer packages described in chromeos-dev. 262 # Install developer packages described in chromeos-dev.
241 sudo INSTALL_MASK="${INSTALL_MASK}" ${EMERGE_BOARD_CMD} \ 263 sudo INSTALL_MASK="${INSTALL_MASK}" ${EMERGE_BOARD_CMD} \
242 --root="${root_dev_dir}" --root-deps=rdeps \ 264 --root="${root_dev_dir}" --root-deps=rdeps \
243 --usepkgonly chromeos-dev ${EMERGE_JOBS} 265 --usepkgonly chromeos-dev ${EMERGE_JOBS}
244 elif [ "${image_type}" == "recovery" ]; then
245 # Install recovery installer.
246 sudo ${EMERGE_BOARD_CMD} --root=${root_fs_dir} --usepkgonly \
247 --root-deps=rdeps --nodeps chromeos-recovery
248 fi
249 266
250 # Re-run ldconfig to fix /etc/ldconfig.so.cache. 267 # Re-run ldconfig to fix /etc/ldconfig.so.cache.
251 sudo /sbin/ldconfig -r "${root_fs_dir}" 268 sudo /sbin/ldconfig -r "${root_fs_dir}"
252 269
253 # Mark the image as a developer image (input to chromeos_startup). 270 # Mark the image as a developer image (input to chromeos_startup).
254 sudo mkdir -p "${root_fs_dir}/root" 271 sudo mkdir -p "${root_fs_dir}/root"
255 sudo touch "${root_fs_dir}/root/${file_to_touch}" 272 sudo touch "${root_fs_dir}/root/${file_to_touch}"
256 273
257 if [ "${image_type}" == "dev" ]; then 274 # Additional changes to developer image.
258 # Additional changes to developer image.
259 275
260 # The ldd tool is a useful shell script but lives in glibc; just copy it. 276 # The ldd tool is a useful shell script but lives in glibc; just copy it.
261 sudo cp -a "$(which ldd)" "${root_dev_dir}/usr/bin" 277 sudo cp -a "$(which ldd)" "${root_dev_dir}/usr/bin"
262 278
263 # If vim is installed, then a vi symlink would probably help. 279 # If vim is installed, then a vi symlink would probably help.
264 if [[ -x "${root_fs_dir}/usr/local/bin/vim" ]]; then 280 if [[ -x "${root_fs_dir}/usr/local/bin/vim" ]]; then
265 sudo ln -sf vim "${root_fs_dir}/usr/local/bin/vi" 281 sudo ln -sf vim "${root_fs_dir}/usr/local/bin/vi"
266 fi 282 fi
267 283
268 # Check that the image has been correctly created. Only do it if not 284 # Check that the image has been correctly created. Only do it if not
269 # building a factory install image, as the INSTALL_MASK for it will 285 # building a factory install image, as the INSTALL_MASK for it will
270 # make test_image fail. 286 # make test_image fail.
271 if [[ ${FLAGS_factory_install} -eq ${FLAGS_FALSE} ]] ; then 287 if [[ ${FLAGS_factory_install} -eq ${FLAGS_FALSE} ]] ; then
272 "${SCRIPTS_DIR}/test_image" \ 288 "${SCRIPTS_DIR}/test_image" \
273 --root="${root_fs_dir}" \ 289 --root="${root_fs_dir}" \
274 --target="${ARCH}" 290 --target="${ARCH}"
275 fi
276 echo "Developer image built and stored at ${output_img}"
277 fi 291 fi
292 echo "Developer image built and stored at ${output_img}"
278 293
279 trap - EXIT 294 trap - EXIT
280 ${SCRIPTS_DIR}/mount_gpt_image.sh -u -r "${root_fs_dir}" -s "${stateful_dir}" 295 ${SCRIPTS_DIR}/mount_gpt_image.sh -u -r "${root_fs_dir}" -s "${stateful_dir}"
281 sudo rm -rf "${root_fs_dir}" "${stateful_dir}" 296 sudo rm -rf "${root_fs_dir}" "${stateful_dir}"
282 } 297 }
283 298
284 # ${DEV_IMAGE_ROOT} specifies the location of where developer packages will
285 # be installed on the stateful dir. On a Chromium OS system, this will
286 # translate to /usr/local.
287 DEV_IMAGE_ROOT=
288 299
289 trap "cleanup && delete_prompt" EXIT 300 # Creates a modified image based on ${OUTPUT_IMG} with additional packages.
301 update_recovery_packages() {
302 local root_fs_dir="${OUTPUT_DIR}/rootfs_dev"
303 local root_fs_img="${OUTPUT_DIR}/rootfs_dev.image"
304 local image_to_mount=${DEVELOPER_IMAGE_NAME}
305 local output_img="${OUTPUT_DIR}/${image_to_mount}"
290 306
291 mkdir -p "${ROOT_FS_DIR}" 307 # Create stateful partition of the same size as the rootfs.
308 local stateful_img="${OUTPUT_DIR}/stateful_partition_dev.image"
309 local stateful_dir="${OUTPUT_DIR}/stateful_partition_dev"
310 local file_to_touch=".dev_mode"
292 311
293 # Create and format the root file system. 312 trap "mount_gpt_cleanup \"${root_fs_dir}\" \"${stateful_dir}\"" EXIT
294 313
295 # Check for loop device before creating image. 314 image_to_mount=${PRISTINE_IMAGE_NAME}
296 LOOP_DEV=$(sudo losetup -f) 315 file_to_touch=".recovery_installer"
297 if [ -z "${LOOP_DEV}" ] ; then
298 echo "No free loop device. Free up a loop device or reboot. exiting. "
299 exit 1
300 fi
301 316
302 # Create root file system disk image to fit on a 1GB memory stick. 317 ${SCRIPTS_DIR}/mount_gpt_image.sh --from "${OUTPUT_DIR}" \
303 # 1 GB in hard-drive-manufacturer-speak is 10^9, not 2^30. 950MB < 10^9 bytes. 318 --image "${image_to_mount}" -r "${root_fs_dir}" -s "${stateful_dir}"
304 if [[ ${FLAGS_factory_install} -eq ${FLAGS_TRUE} ]] ; then
305 ROOT_SIZE_BYTES=$((1024 * 1024 * 300))
306 else
307 ROOT_SIZE_BYTES=$((1024 * 1024 * ${FLAGS_rootfs_size}))
308 fi
309 319
310 dd if=/dev/zero of="${ROOT_FS_IMG}" bs=1 count=1 seek=$((ROOT_SIZE_BYTES - 1)) 320 # Install recovery installer.
311 sudo losetup "${LOOP_DEV}" "${ROOT_FS_IMG}" 321 sudo ${EMERGE_BOARD_CMD} --root=${root_fs_dir} --usepkgonly \
312 sudo mkfs.ext3 "${LOOP_DEV}" 322 --root-deps=rdeps --nodeps chromeos-recovery
313 323
314 # Tune and mount rootfs. 324 # Re-run ldconfig to fix /etc/ldconfig.so.cache.
315 UUID=$(uuidgen) 325 sudo /sbin/ldconfig -r "${root_fs_dir}"
316 DISK_LABEL="C-KEYFOB"
317 sudo tune2fs -L "${DISK_LABEL}" -U "${UUID}" -c 0 -i 0 "${LOOP_DEV}"
318 sudo mount "${LOOP_DEV}" "${ROOT_FS_DIR}"
319 326
320 # Create stateful partition of the same size as the rootfs. 327 # Mark the image as a developer image (input to chromeos_startup).
321 STATEFUL_IMG="${OUTPUT_DIR}/stateful_partition.image" 328 sudo mkdir -p "${root_fs_dir}/root"
322 STATEFUL_DIR="${OUTPUT_DIR}/stateful_partition" 329 sudo touch "${root_fs_dir}/root/${file_to_touch}"
323 STATEFUL_LOOP_DEV=$(sudo losetup -f)
324 if [ -z "${STATEFUL_LOOP_DEV}" ] ; then
325 echo "No free loop device. Free up a loop device or reboot. exiting. "
326 exit 1
327 fi
328 dd if=/dev/zero of="${STATEFUL_IMG}" bs=1 count=1 seek=$((ROOT_SIZE_BYTES - 1))
329 sudo losetup "${STATEFUL_LOOP_DEV}" "${STATEFUL_IMG}"
330 sudo mkfs.ext3 "${STATEFUL_LOOP_DEV}"
331 sudo tune2fs -L "C-STATE" -U "${UUID}" -c 0 -i 0 \
332 "${STATEFUL_LOOP_DEV}"
333 330
334 # Mount the stateful partition. 331 trap - EXIT
335 mkdir -p "${STATEFUL_DIR}" 332 ${SCRIPTS_DIR}/mount_gpt_image.sh -u -r "${root_fs_dir}" -s "${stateful_dir}"
336 sudo mount "${STATEFUL_LOOP_DEV}" "${STATEFUL_DIR}" 333 sudo rm -rf "${root_fs_dir}" "${stateful_dir}"
334 }
337 335
338 # Set dev image root now that we have mounted the stateful partition 336 create_base_image() {
339 # we created.
340 DEV_IMAGE_ROOT="${STATEFUL_DIR}/dev_image"
341 337
342 # Turn root file system into bootable image. 338 trap "cleanup && delete_prompt" EXIT
343 if [[ "${ARCH}" = "x86" ]]; then 339
344 # Setup extlinux configuration. 340 mkdir -p "${ROOT_FS_DIR}"
345 # TODO: For some reason the /dev/disk/by-uuid is not being generated by udev 341
346 # in the initramfs. When we figure that out, switch to root=UUID=${UUID}. 342 # Create and format the root file system.
347 sudo mkdir -p "${ROOT_FS_DIR}"/boot 343
348 # TODO(adlr): use initramfs for booting. 344 # Check for loop device before creating image.
349 cat <<EOF | sudo dd of="${ROOT_FS_DIR}"/boot/extlinux.conf 345 LOOP_DEV=$(sudo losetup -f)
346 if [ -z "${LOOP_DEV}" ] ; then
347 echo "No free loop device. Free up a loop device or reboot. exiting. "
348 exit 1
349 fi
350
351 # Create root file system disk image to fit on a 1GB memory stick.
352 # 1 GB in hard-drive-manufacturer-speak is 10^9, not 2^30. 950MB < 10^9 bytes .
353 if [[ ${FLAGS_factory_install} -eq ${FLAGS_TRUE} ]] ; then
354 ROOT_SIZE_BYTES=$((1024 * 1024 * 300))
355 else
356 ROOT_SIZE_BYTES=$((1024 * 1024 * ${FLAGS_rootfs_size}))
357 fi
358
359 dd if=/dev/zero of="${ROOT_FS_IMG}" bs=1 count=1 seek=$((ROOT_SIZE_BYTES - 1))
360 sudo losetup "${LOOP_DEV}" "${ROOT_FS_IMG}"
361 sudo mkfs.ext3 "${LOOP_DEV}"
362
363 # Tune and mount rootfs.
364 UUID=$(uuidgen)
365 DISK_LABEL="C-KEYFOB"
366 sudo tune2fs -L "${DISK_LABEL}" -U "${UUID}" -c 0 -i 0 "${LOOP_DEV}"
367 sudo mount "${LOOP_DEV}" "${ROOT_FS_DIR}"
368
369 # Create stateful partition of the same size as the rootfs.
370 STATEFUL_LOOP_DEV=$(sudo losetup -f)
371 if [ -z "${STATEFUL_LOOP_DEV}" ] ; then
372 echo "No free loop device. Free up a loop device or reboot. exiting. "
373 exit 1
374 fi
375 dd if=/dev/zero of="${STATEFUL_IMG}" bs=1 count=1 seek=$((ROOT_SIZE_BYTES - 1) )
376 sudo losetup "${STATEFUL_LOOP_DEV}" "${STATEFUL_IMG}"
377 sudo mkfs.ext3 "${STATEFUL_LOOP_DEV}"
378 sudo tune2fs -L "C-STATE" -U "${UUID}" -c 0 -i 0 \
379 "${STATEFUL_LOOP_DEV}"
380
381 # Mount the stateful partition.
382 mkdir -p "${STATEFUL_DIR}"
383 sudo mount "${STATEFUL_LOOP_DEV}" "${STATEFUL_DIR}"
384
385 # Turn root file system into bootable image.
386 if [[ "${ARCH}" = "x86" ]]; then
387 # Setup extlinux configuration.
388 # TODO: For some reason the /dev/disk/by-uuid is not being generated by udev
389 # in the initramfs. When we figure that out, switch to root=UUID=${UUID}.
390 sudo mkdir -p "${ROOT_FS_DIR}"/boot
391 # TODO(adlr): use initramfs for booting.
392 cat <<EOF | sudo dd of="${ROOT_FS_DIR}"/boot/extlinux.conf
350 DEFAULT chromeos-usb 393 DEFAULT chromeos-usb
351 PROMPT 0 394 PROMPT 0
352 TIMEOUT 0 395 TIMEOUT 0
353 396
354 label chromeos-usb 397 label chromeos-usb
355 menu label chromeos-usb 398 menu label chromeos-usb
356 kernel vmlinuz 399 kernel vmlinuz
357 append quiet console=tty2 init=/sbin/init boot=local rootwait root=/dev/sdb3 r o noresume noswap i915.modeset=1 loglevel=1 cros_legacy 400 append quiet console=tty2 init=/sbin/init boot=local rootwait root=/dev/sdb3 r o noresume noswap i915.modeset=1 loglevel=1 cros_legacy
358 401
359 label chromeos-hd 402 label chromeos-hd
360 menu label chromeos-hd 403 menu label chromeos-hd
361 kernel vmlinuz 404 kernel vmlinuz
362 append quiet console=tty2 init=/sbin/init boot=local rootwait root=HDROOT ro n oresume noswap i915.modeset=1 loglevel=1 cros_legacy 405 append quiet console=tty2 init=/sbin/init boot=local rootwait root=HDROOT ro n oresume noswap i915.modeset=1 loglevel=1 cros_legacy
363 EOF 406 EOF
364 407
365 # Make partition bootable and label it. 408 # Make partition bootable and label it.
366 sudo extlinux -z --install "${ROOT_FS_DIR}/boot" 409 sudo extlinux -z --install "${ROOT_FS_DIR}/boot"
367 fi 410 fi
368 411
369 # -- Install packages into the root file system -- 412 # -- Install packages into the root file system --
370 413
371 # We need to install libc manually from the cross toolchain. 414 # We need to install libc manually from the cross toolchain.
372 # TODO: Improve this? We only want libc and not the whole toolchain. 415 # TODO: Improve this? We only want libc and not the whole toolchain.
373 PKGDIR="/var/lib/portage/pkgs/cross/" 416 PKGDIR="/var/lib/portage/pkgs/cross/"
374 sudo tar jxvpf \ 417 sudo tar jxvpf \
375 "${PKGDIR}/${CHOST}/cross-${CHOST}"/glibc-${LIBC_VERSION}.tbz2 \ 418 "${PKGDIR}/${CHOST}/cross-${CHOST}"/glibc-${LIBC_VERSION}.tbz2 \
376 -C "${ROOT_FS_DIR}" --strip-components=3 \ 419 -C "${ROOT_FS_DIR}" --strip-components=3 \
377 --exclude=usr/include --exclude=sys-include --exclude=*.a --exclude=*.o 420 --exclude=usr/include --exclude=sys-include --exclude=*.a --exclude=*.o
378 421
379 # We need to install libstdc++ manually from the cross toolchain. 422 # We need to install libstdc++ manually from the cross toolchain.
380 # TODO: Figure out a better way of doing this? 423 # TODO: Figure out a better way of doing this?
381 sudo cp -a "${BOARD_ROOT}"/lib/libgcc_s.so* "${ROOT_FS_DIR}/lib" 424 sudo cp -a "${BOARD_ROOT}"/lib/libgcc_s.so* "${ROOT_FS_DIR}/lib"
382 sudo cp -a "${BOARD_ROOT}"/usr/lib/libstdc++.so* "${ROOT_FS_DIR}/usr/lib" 425 sudo cp -a "${BOARD_ROOT}"/usr/lib/libstdc++.so* "${ROOT_FS_DIR}/usr/lib"
383 426
384 INSTALL_MASK="" 427 # Prepare stateful partition with some pre-created directories.
385 if [[ ${FLAGS_installmask} -eq ${FLAGS_TRUE} ]] ; then 428 sudo mkdir -p "${DEV_IMAGE_ROOT}"
386 INSTALL_MASK="${DEFAULT_INSTALL_MASK}" 429 sudo mkdir -p "${STATEFUL_DIR}/var"
387 fi
388 430
389 # Reduce the size of factory install shim. 431 # Create symlinks so that /usr/local/usr based directories are symlinked to
390 # TODO: Build a separated ebuild for the factory install shim to reduce size. 432 # /usr/local/ directories e.g. /usr/local/usr/bin -> /usr/local/bin, etc.
391 if [[ ${FLAGS_factory_install} -eq ${FLAGS_TRUE} ]] ; then 433 setup_symlinks_on_root "${DEV_IMAGE_ROOT}" "${STATEFUL_DIR}/var" \
392 INSTALL_MASK="${INSTALL_MASK} ${FACTORY_INSTALL_MASK}" 434 "${STATEFUL_DIR}"
393 fi
394 435
395 if [[ ${FLAGS_jobs} -ne -1 ]]; then 436 # Perform binding rather than symlinking because directories must exist
396 EMERGE_JOBS="--jobs=${FLAGS_jobs}" 437 # on rootfs so that we can bind at run-time since rootfs is read-only.
397 fi 438 echo "Binding directories from stateful partition onto the rootfs"
439 sudo mkdir -p "${ROOT_FS_DIR}/usr/local"
440 sudo mount --bind "${DEV_IMAGE_ROOT}" "${ROOT_FS_DIR}/usr/local"
441 sudo mkdir -p "${ROOT_FS_DIR}/var"
442 sudo mount --bind "${STATEFUL_DIR}/var" "${ROOT_FS_DIR}/var"
443 sudo mkdir -p "${ROOT_FS_DIR}/dev"
398 444
399 # Prepare stateful partition with some pre-created directories. 445 # We "emerge --root=${ROOT_FS_DIR} --root-deps=rdeps --usepkgonly" all of the
400 sudo mkdir -p "${DEV_IMAGE_ROOT}" 446 # runtime packages for chrome os. This builds up a chrome os image from
401 sudo mkdir -p "${STATEFUL_DIR}/var" 447 # binary packages with runtime dependencies only. We use INSTALL_MASK to
448 # trim the image size as much as possible.
449 sudo INSTALL_MASK="${INSTALL_MASK}" ${EMERGE_BOARD_CMD} \
450 --root="${ROOT_FS_DIR}" --root-deps=rdeps \
451 --usepkgonly chromeos ${EMERGE_JOBS}
402 452
403 # Create symlinks so that /usr/local/usr based directories are symlinked to 453 # Create EFI System Partition to boot stock EFI BIOS (but not ChromeOS EFI
404 # /usr/local/ directories e.g. /usr/local/usr/bin -> /usr/local/bin, etc. 454 # BIOS). We only need this for x86, but it's simpler and safer to keep the
405 setup_symlinks_on_root "${DEV_IMAGE_ROOT}" "${STATEFUL_DIR}/var" \ 455 # disk images the same for both x86 and ARM.
406 "${STATEFUL_DIR}" 456 # NOTE: The size argument for mkfs.vfat is in 1024-byte blocks.
407 457 # We'll hard-code it to 16M for now.
408 # Perform binding rather than symlinking because directories must exist 458 ESP_BLOCKS=16384
409 # on rootfs so that we can bind at run-time since rootfs is read-only. 459 /usr/sbin/mkfs.vfat -C ${OUTPUT_DIR}/esp.image ${ESP_BLOCKS}
410 echo "Binding directories from stateful partition onto the rootfs" 460 ESP_LOOP_DEV=$(sudo losetup -f)
411 sudo mkdir -p "${ROOT_FS_DIR}/usr/local" 461 if [ -z "${ESP_LOOP_DEV}" ] ; then
412 sudo mount --bind "${DEV_IMAGE_ROOT}" "${ROOT_FS_DIR}/usr/local" 462 echo "No free loop device. Free up a loop device or reboot. exiting. "
413 sudo mkdir -p "${ROOT_FS_DIR}/var" 463 exit 1
414 sudo mount --bind "${STATEFUL_DIR}/var" "${ROOT_FS_DIR}/var" 464 fi
415 sudo mkdir -p "${ROOT_FS_DIR}/dev" 465 mkdir -p "${ESP_DIR}"
416 466 sudo losetup "${ESP_LOOP_DEV}" "${ESP_IMG}"
417 # We "emerge --root=${ROOT_FS_DIR} --root-deps=rdeps --usepkgonly" all of the 467 sudo mount "${ESP_LOOP_DEV}" "${ESP_DIR}"
418 # runtime packages for chrome os. This builds up a chrome os image from binary 468 sudo mkdir -p "${ESP_DIR}/efi/boot"
419 # packages with runtime dependencies only. We use INSTALL_MASK to trim the 469 sudo grub-mkimage -p /efi/boot -o "${ESP_DIR}/efi/boot/bootx64.efi" \
420 # image size as much as possible. 470 part_gpt fat ext2 normal boot sh chain configfile linux
421 sudo INSTALL_MASK="${INSTALL_MASK}" ${EMERGE_BOARD_CMD} \ 471 cat <<'EOF' | sudo dd of="${ESP_DIR}/efi/boot/grub.cfg"
422 --root="${ROOT_FS_DIR}" --root-deps=rdeps \
423 --usepkgonly chromeos ${EMERGE_JOBS}
424
425 # Create EFI System Partition to boot stock EFI BIOS (but not ChromeOS EFI
426 # BIOS). We only need this for x86, but it's simpler and safer to keep the disk
427 # images the same for both x86 and ARM.
428 ESP_IMG=${OUTPUT_DIR}/esp.image
429 # NOTE: The size argument for mkfs.vfat is in 1024-byte blocks. We'll hard-code
430 # it to 16M for now.
431 ESP_BLOCKS=16384
432 /usr/sbin/mkfs.vfat -C ${OUTPUT_DIR}/esp.image ${ESP_BLOCKS}
433 ESP_DIR=${OUTPUT_DIR}/esp
434 ESP_LOOP_DEV=$(sudo losetup -f)
435 if [ -z "${ESP_LOOP_DEV}" ] ; then
436 echo "No free loop device. Free up a loop device or reboot. exiting. "
437 exit 1
438 fi
439 mkdir -p "${ESP_DIR}"
440 sudo losetup "${ESP_LOOP_DEV}" "${ESP_IMG}"
441 sudo mount "${ESP_LOOP_DEV}" "${ESP_DIR}"
442 sudo mkdir -p "${ESP_DIR}/efi/boot"
443 sudo grub-mkimage -p /efi/boot -o "${ESP_DIR}/efi/boot/bootx64.efi" \
444 part_gpt fat ext2 normal boot sh chain configfile linux
445 cat <<'EOF' | sudo dd of="${ESP_DIR}/efi/boot/grub.cfg"
446 set default=0 472 set default=0
447 set timeout=2 473 set timeout=2
448 474
449 # NOTE: These magic grub variables are a Chrome OS hack. They are not portable. 475 # NOTE: These magic grub variables are a Chrome OS hack. They are not portable.
450 476
451 menuentry "local image A" { 477 menuentry "local image A" {
452 linux $grubpartA/boot/vmlinuz quiet console=tty2 init=/sbin/init boot=local ro otwait root=/dev/$linuxpartA ro noresume noswap i915.modeset=1 loglevel=1 cros_e fi 478 linux $grubpartA/boot/vmlinuz quiet console=tty2 init=/sbin/init boot=local ro otwait root=/dev/$linuxpartA ro noresume noswap i915.modeset=1 loglevel=1 cros_e fi
453 } 479 }
454 480
455 menuentry "local image B" { 481 menuentry "local image B" {
456 linux $grubpartB/boot/vmlinuz quiet console=tty2 init=/sbin/init boot=local ro otwait root=/dev/$linuxpartB ro noresume noswap i915.modeset=1 loglevel=1 cros_e fi 482 linux $grubpartB/boot/vmlinuz quiet console=tty2 init=/sbin/init boot=local ro otwait root=/dev/$linuxpartB ro noresume noswap i915.modeset=1 loglevel=1 cros_e fi
457 } 483 }
458 484
459 menuentry "Alternate USB Boot" { 485 menuentry "Alternate USB Boot" {
460 linux (hd0,3)/boot/vmlinuz quiet console=tty2 init=/sbin/init boot=local rootw ait root=/dev/sdb3 ro noresume noswap i915.modeset=1 loglevel=1 cros_efi 486 linux (hd0,3)/boot/vmlinuz quiet console=tty2 init=/sbin/init boot=local rootw ait root=/dev/sdb3 ro noresume noswap i915.modeset=1 loglevel=1 cros_efi
461 } 487 }
462 488
463 EOF 489 EOF
464 490
465 # FIXME: At the moment, we're working on signed images for x86 only. ARM will 491 # FIXME: At the moment, we're working on signed images for x86 only. ARM will
466 # support this before shipping, but at the moment they don't. 492 # support this before shipping, but at the moment they don't.
467 if [[ "${ARCH}" = "x86" ]]; then 493 if [[ "${ARCH}" = "x86" ]]; then
468 494
469 # Legacy BIOS will use the kernel in the rootfs (via syslinux), as will 495 # Legacy BIOS will use the kernel in the rootfs (via syslinux), as will
470 # standard EFI BIOS (via grub, from the EFI System Partition). Chrome OS BIOS 496 # standard EFI BIOS (via grub, from the EFI System Partition). Chrome OS
471 # will use a separate signed kernel partition, which we'll create now. 497 # BIOS will use a separate signed kernel partition, which we'll create now.
472 # FIXME: remove serial output, debugging messages. 498 # FIXME: remove serial output, debugging messages.
473 cat <<'EOF' > "${OUTPUT_DIR}/config.txt" 499 cat <<'EOF' > "${OUTPUT_DIR}/config.txt"
474 earlyprintk=serial,ttyS0,115200 500 earlyprintk=serial,ttyS0,115200
475 console=ttyS0,115200 501 console=ttyS0,115200
476 init=/sbin/init 502 init=/sbin/init
477 add_efi_memmap 503 add_efi_memmap
478 boot=local 504 boot=local
479 rootwait 505 rootwait
480 root=/dev/sd%D%P 506 root=/dev/sd%D%P
481 ro 507 ro
482 noresume 508 noresume
483 noswap 509 noswap
484 i915.modeset=1 510 i915.modeset=1
485 loglevel=7 511 loglevel=7
486 cros_secure 512 cros_secure
487 EOF 513 EOF
488 514
489 # FIXME: We need to specify the real keys and certs here! 515 # FIXME: We need to specify the real keys and certs here!
490 SIG_DIR="${SRC_ROOT}/platform/vboot_reference/tests/testkeys" 516 SIG_DIR="${SRC_ROOT}/platform/vboot_reference/tests/testkeys"
491 517
492 # Wrap the public keys with VbPublicKey headers. 518 # Wrap the public keys with VbPublicKey headers.
493 vbutil_key --pack \ 519 vbutil_key --pack \
494 --in "${SIG_DIR}/key_rsa2048.keyb" \ 520 --in "${SIG_DIR}/key_rsa2048.keyb" \
495 --version 1 --algorithm 4 \ 521 --version 1 --algorithm 4 \
496 --out "${OUTPUT_DIR}/key_alg4.vbpubk" 522 --out "${OUTPUT_DIR}/key_alg4.vbpubk"
497 523
498 vbutil_key --pack \ 524 vbutil_key --pack \
499 --in "${SIG_DIR}/key_rsa4096.keyb" \ 525 --in "${SIG_DIR}/key_rsa4096.keyb" \
500 --version 1 --algorithm 8 \ 526 --version 1 --algorithm 8 \
501 --out "${OUTPUT_DIR}/key_alg8.vbpubk" 527 --out "${OUTPUT_DIR}/key_alg8.vbpubk"
502 528
503 vbutil_keyblock --pack "${OUTPUT_DIR}/data4_sign8.keyblock" \ 529 vbutil_keyblock --pack "${OUTPUT_DIR}/data4_sign8.keyblock" \
504 --datapubkey "${OUTPUT_DIR}/key_alg4.vbpubk" \ 530 --datapubkey "${OUTPUT_DIR}/key_alg4.vbpubk" \
505 --signprivate "${SIG_DIR}/key_rsa4096.pem" \ 531 --signprivate "${SIG_DIR}/key_rsa4096.pem" \
506 --algorithm 8 --flags 3 532 --algorithm 8 --flags 3
507 533
508 # Verify the keyblock. 534 # Verify the keyblock.
509 vbutil_keyblock --unpack "${OUTPUT_DIR}/data4_sign8.keyblock" \ 535 vbutil_keyblock --unpack "${OUTPUT_DIR}/data4_sign8.keyblock" \
510 --signpubkey "${OUTPUT_DIR}/key_alg8.vbpubk" 536 --signpubkey "${OUTPUT_DIR}/key_alg8.vbpubk"
511 537
512 # Sign the kernel: 538 # Sign the kernel:
513 vbutil_kernel --pack "${OUTPUT_DIR}/vmlinuz.image" \ 539 vbutil_kernel --pack "${OUTPUT_DIR}/vmlinuz.image" \
514 --keyblock "${OUTPUT_DIR}/data4_sign8.keyblock" \ 540 --keyblock "${OUTPUT_DIR}/data4_sign8.keyblock" \
515 --signprivate "${SIG_DIR}/key_rsa2048.pem" \ 541 --signprivate "${SIG_DIR}/key_rsa2048.pem" \
516 --version 1 \ 542 --version 1 \
517 --config "${OUTPUT_DIR}/config.txt" \ 543 --config "${OUTPUT_DIR}/config.txt" \
518 --bootloader /lib64/bootstub/bootstub.efi \ 544 --bootloader /lib64/bootstub/bootstub.efi \
519 --vmlinuz "${ROOT_FS_DIR}/boot/vmlinuz" 545 --vmlinuz "${ROOT_FS_DIR}/boot/vmlinuz"
520 546
521 # And verify it. 547 # And verify it.
522 vbutil_kernel --verify "${OUTPUT_DIR}/vmlinuz.image" \ 548 vbutil_kernel --verify "${OUTPUT_DIR}/vmlinuz.image" \
523 --signpubkey "${OUTPUT_DIR}/key_alg8.vbpubk" 549 --signpubkey "${OUTPUT_DIR}/key_alg8.vbpubk"
524 550
525 else 551 else
526 # FIXME: For now, ARM just uses the unsigned kernel by itself. 552 # FIXME: For now, ARM just uses the unsigned kernel by itself.
527 cp -f "${ROOT_FS_DIR}/boot/vmlinuz" "${OUTPUT_DIR}/vmlinuz.image" 553 cp -f "${ROOT_FS_DIR}/boot/vmlinuz" "${OUTPUT_DIR}/vmlinuz.image"
528 fi 554 fi
529 555
530 556
531 # Perform any customizations on the root file system that are needed. 557 # Perform any customizations on the root file system that are needed.
532 "${SCRIPTS_DIR}/customize_rootfs" \ 558 "${SCRIPTS_DIR}/customize_rootfs" \
533 --root="${ROOT_FS_DIR}" \ 559 --root="${ROOT_FS_DIR}" \
534 --target="${ARCH}" \ 560 --target="${ARCH}" \
535 --board="${BOARD}" 561 --board="${BOARD}"
536 562
537 # Don't test the factory install shim. 563 # Don't test the factory install shim.
538 if [[ ${FLAGS_factory_install} -eq ${FLAGS_FALSE} ]] ; then 564 if [[ ${FLAGS_factory_install} -eq ${FLAGS_FALSE} ]] ; then
539 # Check that the image has been correctly created. 565 # Check that the image has been correctly created.
540 "${SCRIPTS_DIR}/test_image" \ 566 "${SCRIPTS_DIR}/test_image" \
541 --root="${ROOT_FS_DIR}" \ 567 --root="${ROOT_FS_DIR}" \
542 --target="${ARCH}" 568 --target="${ARCH}"
543 fi 569 fi
544 570
545 # Clean up symlinks so they work on a running target rooted at "/". 571 # Clean up symlinks so they work on a running target rooted at "/".
546 # Here development packages are rooted at /usr/local. However, do not 572 # Here development packages are rooted at /usr/local. However, do not
547 # create /usr/local or /var on host (already exist on target). 573 # create /usr/local or /var on host (already exist on target).
548 setup_symlinks_on_root "/usr/local" "/var" "${STATEFUL_DIR}" 574 setup_symlinks_on_root "/usr/local" "/var" "${STATEFUL_DIR}"
549 575
550 # Cleanup loop devices. 576 # Cleanup loop devices.
551 cleanup 577 cleanup
552 578
553 trap delete_prompt EXIT 579 trap delete_prompt EXIT
554 580
555 RECOVERY="--norecovery" 581 RECOVERY="--norecovery"
556 if [[ ${FLAGS_recovery} -eq ${FLAGS_TRUE} ]]; then 582 if [[ ${FLAGS_recovery} -eq ${FLAGS_TRUE} ]]; then
557 RECOVERY="--recovery" 583 RECOVERY="--recovery"
558 fi 584 fi
559 585
560 # Create the GPT-formatted image. 586 # Create the GPT-formatted image.
561 ${SCRIPTS_DIR}/build_gpt.sh \ 587 ${SCRIPTS_DIR}/build_gpt.sh \
562 --arch=${ARCH} \ 588 --arch=${ARCH} \
563 --board=${FLAGS_board} \ 589 --board=${FLAGS_board} \
564 --arm_extra_bootargs="${FLAGS_arm_extra_bootargs}" \ 590 --arm_extra_bootargs="${FLAGS_arm_extra_bootargs}" \
565 --rootfs_partition_size=${FLAGS_rootfs_partition_size} \ 591 --rootfs_partition_size=${FLAGS_rootfs_partition_size} \
566 ${RECOVERY} \ 592 ${RECOVERY} \
567 "${OUTPUT_DIR}" \ 593 "${OUTPUT_DIR}" \
568 "${OUTPUT_IMG}" 594 "${OUTPUT_IMG}"
595 }
596
597 create_base_image
569 598
570 # Create a recovery image based on the chromium os base image. 599 # Create a recovery image based on the chromium os base image.
571 [ "${FLAGS_recovery}" -eq "${FLAGS_TRUE}" ] && create_mod_image "recovery" 600 [ "${FLAGS_recovery}" -eq "${FLAGS_TRUE}" ] && update_recovery_packages
572 trap - EXIT 601 trap - EXIT
573 602
574 # Create a developer image based on the chromium os base image. 603 # Create a developer image based on the chromium os base image.
575 [ "${FLAGS_withdev}" -eq "${FLAGS_TRUE}" ] && create_mod_image "dev" 604 [ "${FLAGS_withdev}" -eq "${FLAGS_TRUE}" ] && update_dev_packages
576 trap - EXIT 605 trap - EXIT
577 606
578 # FIXME: only signing things for x86 right now. 607 # FIXME: only signing things for x86 right now.
579 if [[ "${ARCH}" = "x86" ]]; then 608 if [[ "${ARCH}" = "x86" ]]; then
580 # Verify the final image. 609 # Verify the final image.
581 load_kernel_test "${OUTPUT_IMG}" "${OUTPUT_DIR}/key_alg8.vbpubk" 610 load_kernel_test "${OUTPUT_IMG}" "${OUTPUT_DIR}/key_alg8.vbpubk"
582 fi 611 fi
583 612
584 # Clean up temporary files. 613 # Clean up temporary files.
585 rm -f "${ROOT_FS_IMG}" "${STATEFUL_IMG}" "${OUTPUT_DIR}/vmlinuz.image" \ 614 rm -f "${ROOT_FS_IMG}" "${STATEFUL_IMG}" "${OUTPUT_DIR}/vmlinuz.image" \
586 "${ESP_IMG}" "${OUTPUT_DIR}/data4_sign8.keyblock" \ 615 "${ESP_IMG}" "${OUTPUT_DIR}/data4_sign8.keyblock" \
587 "${OUTPUT_DIR}/key_alg4.vbpubk" "${OUTPUT_DIR}/key_alg8.vbpubk" 616 "${OUTPUT_DIR}/key_alg4.vbpubk" "${OUTPUT_DIR}/key_alg8.vbpubk"
588 rmdir "${ROOT_FS_DIR}" "${STATEFUL_DIR}" "${ESP_DIR}" 617 rmdir "${ROOT_FS_DIR}" "${STATEFUL_DIR}" "${ESP_DIR}"
589 618
590 OUTSIDE_OUTPUT_DIR="../build/images/${FLAGS_board}/${IMAGE_SUBDIR}"
591
592 echo "Done. Image created in ${OUTPUT_DIR}" 619 echo "Done. Image created in ${OUTPUT_DIR}"
593 echo "Chromium OS image created as ${PRISTINE_IMAGE_NAME}" 620 echo "Chromium OS image created as ${PRISTINE_IMAGE_NAME}"
594 if [ "${FLAGS_recovery}" -eq "${FLAGS_TRUE}" ]; then 621 if [ "${FLAGS_recovery}" -eq "${FLAGS_TRUE}" ]; then
595 echo "Recovery image created as ${PRISTINE_IMAGE_NAME}" 622 echo "Recovery image created as ${PRISTINE_IMAGE_NAME}"
596 fi 623 fi
597 if [ "${FLAGS_withdev}" -eq "${FLAGS_TRUE}" ]; then 624 if [ "${FLAGS_withdev}" -eq "${FLAGS_TRUE}" ]; then
598 echo "Developer image created as ${DEVELOPER_IMAGE_NAME}" 625 echo "Developer image created as ${DEVELOPER_IMAGE_NAME}"
599 fi 626 fi
600 627
601 print_time_elapsed 628 print_time_elapsed
602 629
603 echo "To copy to USB keyfob, OUTSIDE the chroot, do something like:" 630 echo "To copy to USB keyfob, OUTSIDE the chroot, do something like:"
604 echo " ./image_to_usb.sh --from=${OUTSIDE_OUTPUT_DIR} --to=/dev/sdX" 631 echo " ./image_to_usb.sh --from=${OUTSIDE_OUTPUT_DIR} --to=/dev/sdX"
605 echo "To convert to VMWare image, OUTSIDE the chroot, do something like:" 632 echo "To convert to VMWare image, OUTSIDE the chroot, do something like:"
606 echo " ./image_to_vmware.sh --from=${OUTSIDE_OUTPUT_DIR}" 633 echo " ./image_to_vmware.sh --from=${OUTSIDE_OUTPUT_DIR}"
607 echo "from the scripts directory where you entered the chroot." 634 echo "from the scripts directory where you entered the chroot."
OLDNEW
« 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