| 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 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 bigger than partition (${FLAGS_rootfs_partition_size} MiB)." | 184 bigger than partition (${FLAGS_rootfs_partition_size} MiB)." |
| 185 fi | 185 fi |
| 186 | 186 |
| 187 EMERGE_BOARD_CMD="emerge-${FLAGS_board}" | 187 EMERGE_BOARD_CMD="emerge-${FLAGS_board}" |
| 188 if [ "${FLAGS_fast}" -eq "${FLAGS_TRUE}" ]; then | 188 if [ "${FLAGS_fast}" -eq "${FLAGS_TRUE}" ]; then |
| 189 echo "Using alternate emerge" | 189 echo "Using alternate emerge" |
| 190 EMERGE_CMD="${GCLIENT_ROOT}/chromite/bin/parallel_emerge" | 190 EMERGE_CMD="${GCLIENT_ROOT}/chromite/bin/parallel_emerge" |
| 191 EMERGE_BOARD_CMD="${EMERGE_CMD} --board=${FLAGS_board}" | 191 EMERGE_BOARD_CMD="${EMERGE_CMD} --board=${FLAGS_board}" |
| 192 fi | 192 fi |
| 193 | 193 |
| 194 OVERLAY_CHROMEOS_DIR="${SRC_ROOT}/third_party/chromiumos-overlay/chromeos/" |
| 195 |
| 194 # Determine build version. | 196 # Determine build version. |
| 195 . ${SRC_ROOT}/third_party/chromiumos-overlay/chromeos/config/chromeos_version.sh | 197 . "${OVERLAY_CHROMEOS_DIR}/config/chromeos_version.sh" |
| 196 | 198 |
| 197 # Configure extra USE or packages for this type of build. | 199 # Configure extra USE or packages for this type of build. |
| 198 EXTRA_PACKAGES="" | 200 EXTRA_PACKAGES="" |
| 199 EXTRA_USE="" | 201 EXTRA_USE="" |
| 200 if [ "${FLAGS_factory_install}" -eq "${FLAGS_TRUE}" ] ; then | 202 if [ "${FLAGS_factory_install}" -eq "${FLAGS_TRUE}" ] ; then |
| 201 # Factory install needs to have the kernel initrmafs enabled, | 203 # Factory install needs to have the kernel initrmafs enabled, |
| 202 # and the factory installer added. | 204 # and the factory installer added. |
| 203 EXTRA_PACKAGES="${EXTRA_PACKAGES} chromeos-base/chromeos-factoryinstall" | 205 EXTRA_PACKAGES="${EXTRA_PACKAGES} chromeos-base/chromeos-factoryinstall" |
| 204 EXTRA_USE="${EXTRA_USE} initramfs" | 206 EXTRA_USE="${EXTRA_USE} initramfs" |
| 205 fi | 207 fi |
| (...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 640 sudo mkdir -p "${ROOT_FS_DIR}/dev" | 642 sudo mkdir -p "${ROOT_FS_DIR}/dev" |
| 641 | 643 |
| 642 # We "emerge --root=${ROOT_FS_DIR} --root-deps=rdeps --usepkgonly" all of the | 644 # We "emerge --root=${ROOT_FS_DIR} --root-deps=rdeps --usepkgonly" all of the |
| 643 # runtime packages for chrome os. This builds up a chrome os image from | 645 # runtime packages for chrome os. This builds up a chrome os image from |
| 644 # binary packages with runtime dependencies only. We use INSTALL_MASK to | 646 # binary packages with runtime dependencies only. We use INSTALL_MASK to |
| 645 # trim the image size as much as possible. | 647 # trim the image size as much as possible. |
| 646 sudo USE="${EXTRA_USE}" INSTALL_MASK="${INSTALL_MASK}" ${EMERGE_BOARD_CMD} \ | 648 sudo USE="${EXTRA_USE}" INSTALL_MASK="${INSTALL_MASK}" ${EMERGE_BOARD_CMD} \ |
| 647 --root="${ROOT_FS_DIR}" --root-deps=rdeps \ | 649 --root="${ROOT_FS_DIR}" --root-deps=rdeps \ |
| 648 --usepkgonly chromeos ${EXTRA_PACKAGES} ${EMERGE_JOBS} | 650 --usepkgonly chromeos ${EXTRA_PACKAGES} ${EMERGE_JOBS} |
| 649 | 651 |
| 650 # Perform any customizations on the root file system that are needed. | 652 # Set /etc/lsb-release on the image. |
| 651 "${SCRIPTS_DIR}/customize_rootfs" \ | 653 "${OVERLAY_CHROMEOS_DIR}/scripts/cros_set_lsb_release" \ |
| 652 --root="${ROOT_FS_DIR}" \ | 654 --root="${ROOT_FS_DIR}" \ |
| 653 --target="${ARCH}" \ | |
| 654 --board="${BOARD}" | 655 --board="${BOARD}" |
| 655 | 656 |
| 656 # Populates the root filesystem with legacy bootloader templates | 657 # Populates the root filesystem with legacy bootloader templates |
| 657 # appropriate for the platform. The autoupdater and installer will | 658 # appropriate for the platform. The autoupdater and installer will |
| 658 # use those templates to update the legacy boot partition (12/ESP) | 659 # use those templates to update the legacy boot partition (12/ESP) |
| 659 # on update. | 660 # on update. |
| 660 # (This script does not populate vmlinuz.A and .B needed by syslinux.) | 661 # (This script does not populate vmlinuz.A and .B needed by syslinux.) |
| 661 enable_rootfs_verification= | 662 enable_rootfs_verification= |
| 662 if [[ ${FLAGS_enable_rootfs_verification} -eq ${FLAGS_TRUE} ]]; then | 663 if [[ ${FLAGS_enable_rootfs_verification} -eq ${FLAGS_TRUE} ]]; then |
| 663 enable_rootfs_verification="--enable_rootfs_verification" | 664 enable_rootfs_verification="--enable_rootfs_verification" |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 819 echo "Developer image created as ${DEVELOPER_IMAGE_NAME}" | 820 echo "Developer image created as ${DEVELOPER_IMAGE_NAME}" |
| 820 fi | 821 fi |
| 821 | 822 |
| 822 print_time_elapsed | 823 print_time_elapsed |
| 823 | 824 |
| 824 echo "To copy to USB keyfob, do something like:" | 825 echo "To copy to USB keyfob, do something like:" |
| 825 echo " ./image_to_usb.sh --from=${OUTSIDE_OUTPUT_DIR} --to=/dev/sdX" | 826 echo " ./image_to_usb.sh --from=${OUTSIDE_OUTPUT_DIR} --to=/dev/sdX" |
| 826 echo "To convert to VMWare image, INSIDE the chroot, do something like:" | 827 echo "To convert to VMWare image, INSIDE the chroot, do something like:" |
| 827 echo " ./image_to_vm.sh --from=${OUTSIDE_OUTPUT_DIR} --board=${BOARD}" | 828 echo " ./image_to_vm.sh --from=${OUTSIDE_OUTPUT_DIR} --board=${BOARD}" |
| 828 echo "from the scripts directory where you entered the chroot." | 829 echo "from the scripts directory where you entered the chroot." |
| OLD | NEW |