OLD | NEW |
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 19 matching lines...) Expand all Loading... |
30 DEFINE_boolean replace $FLAGS_FALSE \ | 30 DEFINE_boolean replace $FLAGS_FALSE \ |
31 "Overwrite existing output, if any." | 31 "Overwrite existing output, if any." |
32 DEFINE_boolean withdev $FLAGS_TRUE \ | 32 DEFINE_boolean withdev $FLAGS_TRUE \ |
33 "Include useful developer friendly utilities in the image." | 33 "Include useful developer friendly utilities in the image." |
34 DEFINE_boolean installmask $FLAGS_TRUE \ | 34 DEFINE_boolean installmask $FLAGS_TRUE \ |
35 "Use INSTALL_MASK to shrink the resulting image." | 35 "Use INSTALL_MASK to shrink the resulting image." |
36 DEFINE_integer jobs -1 \ | 36 DEFINE_integer jobs -1 \ |
37 "How many packages to build in parallel at maximum." | 37 "How many packages to build in parallel at maximum." |
38 DEFINE_boolean statefuldev $FLAGS_FALSE \ | 38 DEFINE_boolean statefuldev $FLAGS_FALSE \ |
39 "Install development packages on stateful partition -- still experimental" | 39 "Install development packages on stateful partition -- still experimental" |
| 40 DEFINE_string to "" \ |
| 41 "The target image file or device" |
40 DEFINE_boolean withtest $FLAGS_FALSE \ | 42 DEFINE_boolean withtest $FLAGS_FALSE \ |
41 "Include packages required for testing and prepare image for testing" | 43 "Include packages required for testing and prepare image for testing" |
42 | 44 |
43 # Parse command line. | 45 # Parse command line. |
44 FLAGS "$@" || exit 1 | 46 FLAGS "$@" || exit 1 |
45 eval set -- "${FLAGS_ARGV}" | 47 eval set -- "${FLAGS_ARGV}" |
46 | 48 |
47 # Only now can we die on error. shflags functions leak non-zero error codes, | 49 # Only now can we die on error. shflags functions leak non-zero error codes, |
48 # so will die prematurely if 'set -e' is specified before now. | 50 # so will die prematurely if 'set -e' is specified before now. |
49 set -e | 51 set -e |
(...skipping 12 matching lines...) Expand all Loading... |
62 | 64 |
63 # Determine build version. | 65 # Determine build version. |
64 . "${SCRIPTS_DIR}/chromeos_version.sh" | 66 . "${SCRIPTS_DIR}/chromeos_version.sh" |
65 | 67 |
66 # Use canonical path since some tools (e.g. mount) do not like symlinks. | 68 # Use canonical path since some tools (e.g. mount) do not like symlinks. |
67 # Append build attempt to output directory. | 69 # Append build attempt to output directory. |
68 IMAGE_SUBDIR="${CHROMEOS_VERSION_STRING}-a${FLAGS_build_attempt}" | 70 IMAGE_SUBDIR="${CHROMEOS_VERSION_STRING}-a${FLAGS_build_attempt}" |
69 OUTPUT_DIR="${FLAGS_output_root}/${FLAGS_board}/${IMAGE_SUBDIR}" | 71 OUTPUT_DIR="${FLAGS_output_root}/${FLAGS_board}/${IMAGE_SUBDIR}" |
70 ROOT_FS_DIR="${OUTPUT_DIR}/rootfs" | 72 ROOT_FS_DIR="${OUTPUT_DIR}/rootfs" |
71 ROOT_FS_IMG="${OUTPUT_DIR}/rootfs.image" | 73 ROOT_FS_IMG="${OUTPUT_DIR}/rootfs.image" |
72 OUTPUT_IMG="${OUTPUT_DIR}/chromiumos_image.bin" | 74 OUTPUT_IMG=${FLAGS_to:-${OUTPUT_DIR}/chromiumos_image.bin} |
73 | 75 |
74 BOARD="${FLAGS_board}" | 76 BOARD="${FLAGS_board}" |
75 BOARD_ROOT="${FLAGS_build_root}/${BOARD}" | 77 BOARD_ROOT="${FLAGS_build_root}/${BOARD}" |
76 | 78 |
77 LOOP_DEV= | 79 LOOP_DEV= |
78 | 80 |
79 # What cross-build are we targeting? | 81 # What cross-build are we targeting? |
80 . "${BOARD_ROOT}/etc/make.conf.board_setup" | 82 . "${BOARD_ROOT}/etc/make.conf.board_setup" |
81 LIBC_VERSION=${LIBC_VERSION:-"2.10.1-r1"} | 83 LIBC_VERSION=${LIBC_VERSION:-"2.10.1-r1"} |
82 | 84 |
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
362 | 364 |
363 OUTSIDE_OUTPUT_DIR="../build/images/${FLAGS_board}/${IMAGE_SUBDIR}" | 365 OUTSIDE_OUTPUT_DIR="../build/images/${FLAGS_board}/${IMAGE_SUBDIR}" |
364 echo "Done. Image created in ${OUTPUT_DIR}" | 366 echo "Done. Image created in ${OUTPUT_DIR}" |
365 echo "To copy to USB keyfob, OUTSIDE the chroot, do something like:" | 367 echo "To copy to USB keyfob, OUTSIDE the chroot, do something like:" |
366 echo " ./image_to_usb.sh --from=${OUTSIDE_OUTPUT_DIR} --to=/dev/sdb" | 368 echo " ./image_to_usb.sh --from=${OUTSIDE_OUTPUT_DIR} --to=/dev/sdb" |
367 echo "To convert to VMWare image, OUTSIDE the chroot, do something like:" | 369 echo "To convert to VMWare image, OUTSIDE the chroot, do something like:" |
368 echo " ./image_to_vmware.sh --from=${OUTSIDE_OUTPUT_DIR}" | 370 echo " ./image_to_vmware.sh --from=${OUTSIDE_OUTPUT_DIR}" |
369 echo "from the scripts directory where you entered the chroot." | 371 echo "from the scripts directory where you entered the chroot." |
370 | 372 |
371 trap - EXIT | 373 trap - EXIT |
OLD | NEW |