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

Side by Side Diff: build_image

Issue 2914004: Use --fast by default in build_image when --jobs is enabled. (Closed) Base URL: ssh://git@chromiumos-git/crosutils.git
Patch Set: Created 10 years, 5 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 | common.sh » ('j') | 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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 if [ -z "${FLAGS_board}" ] ; then 85 if [ -z "${FLAGS_board}" ] ; then
86 error "--board is required." 86 error "--board is required."
87 exit 1 87 exit 1
88 fi 88 fi
89 89
90 if [ "${FLAGS_rootfs_size}" -gt "${FLAGS_rootfs_partition_size}" ] ; then 90 if [ "${FLAGS_rootfs_size}" -gt "${FLAGS_rootfs_partition_size}" ] ; then
91 error "rootfs (${FLAGS_rootfs_size} MB) is bigger than partition (${FLAGS_root fs_partition_size} MB)." 91 error "rootfs (${FLAGS_rootfs_size} MB) is bigger than partition (${FLAGS_root fs_partition_size} MB)."
92 exit 1 92 exit 1
93 fi 93 fi
94 94
95 if [ ${FLAGS_jobs} -ne -1 ]; then
96 EMERGE_JOBS="--jobs=${FLAGS_jobs}"
97 FLAGS_fast=${FLAGS_TRUE}
98 fi
99
95 EMERGE_BOARD_CMD="emerge-${FLAGS_board}" 100 EMERGE_BOARD_CMD="emerge-${FLAGS_board}"
96 if [ "${FLAGS_fast}" -eq "${FLAGS_TRUE}" ]; then 101 if [ "${FLAGS_fast}" -eq "${FLAGS_TRUE}" ]; then
97 echo "Using alternate emerge" 102 echo "Using alternate emerge"
98 EMERGE_BOARD_CMD="${SCRIPTS_DIR}/parallel_emerge --board=${FLAGS_board}" 103 EMERGE_BOARD_CMD="${SCRIPTS_DIR}/parallel_emerge --board=${FLAGS_board}"
99 fi 104 fi
100 105
101 # Determine build version. 106 # Determine build version.
102 . "${SCRIPTS_DIR}/chromeos_version.sh" 107 . "${SCRIPTS_DIR}/chromeos_version.sh"
103 108
104 # Use canonical path since some tools (e.g. mount) do not like symlinks. 109 # Use canonical path since some tools (e.g. mount) do not like symlinks.
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 if [[ ${FLAGS_installmask} -eq ${FLAGS_TRUE} ]] ; then 159 if [[ ${FLAGS_installmask} -eq ${FLAGS_TRUE} ]] ; then
155 INSTALL_MASK="${DEFAULT_INSTALL_MASK}" 160 INSTALL_MASK="${DEFAULT_INSTALL_MASK}"
156 fi 161 fi
157 162
158 # Reduce the size of factory install shim. 163 # Reduce the size of factory install shim.
159 # TODO: Build a separated ebuild for the factory install shim to reduce size. 164 # TODO: Build a separated ebuild for the factory install shim to reduce size.
160 if [[ ${FLAGS_factory_install} -eq ${FLAGS_TRUE} ]] ; then 165 if [[ ${FLAGS_factory_install} -eq ${FLAGS_TRUE} ]] ; then
161 INSTALL_MASK="${INSTALL_MASK} ${FACTORY_INSTALL_MASK}" 166 INSTALL_MASK="${INSTALL_MASK} ${FACTORY_INSTALL_MASK}"
162 fi 167 fi
163 168
164 if [[ ${FLAGS_jobs} -ne -1 ]]; then
165 EMERGE_JOBS="--jobs=${FLAGS_jobs}"
166 fi
167
168 # Figure out ARCH from the given toolchain. 169 # Figure out ARCH from the given toolchain.
169 # TODO: Move to common.sh as a function after scripts are switched over. 170 # TODO: Move to common.sh as a function after scripts are switched over.
170 TC_ARCH=$(echo "${CHOST}" | awk -F'-' '{ print $1 }') 171 TC_ARCH=$(echo "${CHOST}" | awk -F'-' '{ print $1 }')
171 case "${TC_ARCH}" in 172 case "${TC_ARCH}" in
172 arm*) 173 arm*)
173 ARCH="arm" 174 ARCH="arm"
174 ;; 175 ;;
175 *86) 176 *86)
176 ARCH="x86" 177 ARCH="x86"
177 ;; 178 ;;
(...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after
694 echo "Developer image created as ${DEVELOPER_IMAGE_NAME}" 695 echo "Developer image created as ${DEVELOPER_IMAGE_NAME}"
695 fi 696 fi
696 697
697 print_time_elapsed 698 print_time_elapsed
698 699
699 echo "To copy to USB keyfob, OUTSIDE the chroot, do something like:" 700 echo "To copy to USB keyfob, OUTSIDE the chroot, do something like:"
700 echo " ./image_to_usb.sh --from=${OUTSIDE_OUTPUT_DIR} --to=/dev/sdX" 701 echo " ./image_to_usb.sh --from=${OUTSIDE_OUTPUT_DIR} --to=/dev/sdX"
701 echo "To convert to VMWare image, OUTSIDE the chroot, do something like:" 702 echo "To convert to VMWare image, OUTSIDE the chroot, do something like:"
702 echo " ./image_to_vmware.sh --from=${OUTSIDE_OUTPUT_DIR}" 703 echo " ./image_to_vmware.sh --from=${OUTSIDE_OUTPUT_DIR}"
703 echo "from the scripts directory where you entered the chroot." 704 echo "from the scripts directory where you entered the chroot."
OLDNEW
« no previous file with comments | « no previous file | common.sh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698