| 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. | 7 # Script to build a bootable keyfob-based chromeos system image. |
| 8 # It uses debootstrap (see https://wiki.ubuntu.com/DebootstrapChroot) to | 8 # It uses debootstrap (see https://wiki.ubuntu.com/DebootstrapChroot) to |
| 9 # create a base file system. It then cusotmizes the file system and adds | 9 # create a base file system. It then cusotmizes the file system and adds |
| 10 # Ubuntu and chromeos specific packages. Finally, it creates a bootable USB | 10 # Ubuntu and chromeos specific packages. Finally, it creates a bootable USB |
| 11 # image from the root fs. | 11 # image from the root fs. |
| 12 # | 12 # |
| 13 # NOTE: This script must be run from the chromeos build chroot environment. | 13 # NOTE: This script must be run from the chromeos build chroot environment. |
| 14 # | 14 # |
| 15 | 15 |
| 16 # Load common constants. This should be the first executable line. | 16 # Load common constants. This should be the first executable line. |
| 17 # The path to common.sh should be relative to your script's location. | 17 # The path to common.sh should be relative to your script's location. |
| 18 . "$(dirname "$0")/common.sh" | 18 . "$(dirname "$0")/common.sh" |
| 19 | 19 |
| 20 # Script must be run inside the chroot | |
| 21 assert_inside_chroot | 20 assert_inside_chroot |
| 21 assert_not_root_user |
| 22 | 22 |
| 23 DEFAULT_PKGLIST="${SRC_ROOT}/package_repo/package-list-prod.txt" | 23 DEFAULT_PKGLIST="${SRC_ROOT}/package_repo/package-list-prod.txt" |
| 24 | 24 |
| 25 # Flags | 25 # Flags |
| 26 DEFINE_integer build_attempt 1 \ | 26 DEFINE_integer build_attempt 1 \ |
| 27 "The build attempt for this image build." | 27 "The build attempt for this image build." |
| 28 DEFINE_string output_root "${DEFAULT_BUILD_ROOT}/images" \ | 28 DEFINE_string output_root "${DEFAULT_BUILD_ROOT}/images" \ |
| 29 "Directory in which to place image result directories (named by version)" | 29 "Directory in which to place image result directories (named by version)" |
| 30 DEFINE_string build_root "$DEFAULT_BUILD_ROOT" \ | 30 DEFINE_string build_root "$DEFAULT_BUILD_ROOT" \ |
| 31 "Root of build output" | 31 "Root of build output" |
| (...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 275 EOF | 275 EOF |
| 276 | 276 |
| 277 OUTSIDE_OUTPUT_DIR="${EXTERNAL_TRUNK_PATH}/src/build/images/${IMAGE_SUBDIR}" | 277 OUTSIDE_OUTPUT_DIR="${EXTERNAL_TRUNK_PATH}/src/build/images/${IMAGE_SUBDIR}" |
| 278 echo "Done. Image created in ${OUTPUT_DIR}" | 278 echo "Done. Image created in ${OUTPUT_DIR}" |
| 279 echo "To copy to USB keyfob, outside the chroot, do something like:" | 279 echo "To copy to USB keyfob, outside the chroot, do something like:" |
| 280 echo " ./image_to_usb.sh --from=${OUTSIDE_OUTPUT_DIR} --to=/dev/sdb" | 280 echo " ./image_to_usb.sh --from=${OUTSIDE_OUTPUT_DIR} --to=/dev/sdb" |
| 281 echo "To convert to VMWare image, outside the chroot, do something like:" | 281 echo "To convert to VMWare image, outside the chroot, do something like:" |
| 282 echo " ./image_to_vmware.sh --from=${OUTSIDE_OUTPUT_DIR}" | 282 echo " ./image_to_vmware.sh --from=${OUTSIDE_OUTPUT_DIR}" |
| 283 | 283 |
| 284 trap - EXIT | 284 trap - EXIT |
| OLD | NEW |