| 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. |
| 11 | 11 |
| 12 # Load common constants. This should be the first executable line. | 12 # Load common constants. This should be the first executable line. |
| 13 # The path to common.sh should be relative to your script's location. | 13 # The path to common.sh should be relative to your script's location. |
| 14 . "$(dirname "$0")/common.sh" | 14 . "$(dirname "$0")/common.sh" |
| 15 | 15 |
| 16 # Script must be run inside the chroot. | 16 # Script must be run inside the chroot. |
| 17 assert_inside_chroot | 17 restart_in_chroot_if_needed $* |
| 18 | 18 |
| 19 get_default_board | 19 get_default_board |
| 20 | 20 |
| 21 # Flags. | 21 # Flags. |
| 22 DEFINE_string board "$DEFAULT_BOARD" \ | 22 DEFINE_string board "$DEFAULT_BOARD" \ |
| 23 "The board to build an image for." | 23 "The board to build an image for." |
| 24 DEFINE_string build_root "/build" \ | 24 DEFINE_string build_root "/build" \ |
| 25 "The root location for board sysroots." | 25 "The root location for board sysroots." |
| 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." |
| (...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 449 | 449 |
| 450 OUTSIDE_OUTPUT_DIR="../build/images/${FLAGS_board}/${IMAGE_SUBDIR}" | 450 OUTSIDE_OUTPUT_DIR="../build/images/${FLAGS_board}/${IMAGE_SUBDIR}" |
| 451 echo "Done. Image created in ${OUTPUT_DIR}" | 451 echo "Done. Image created in ${OUTPUT_DIR}" |
| 452 echo "To copy to USB keyfob, OUTSIDE the chroot, do something like:" | 452 echo "To copy to USB keyfob, OUTSIDE the chroot, do something like:" |
| 453 echo " ./image_to_usb.sh --from=${OUTSIDE_OUTPUT_DIR} --to=/dev/sdX" | 453 echo " ./image_to_usb.sh --from=${OUTSIDE_OUTPUT_DIR} --to=/dev/sdX" |
| 454 echo "To convert to VMWare image, OUTSIDE the chroot, do something like:" | 454 echo "To convert to VMWare image, OUTSIDE the chroot, do something like:" |
| 455 echo " ./image_to_vmware.sh --from=${OUTSIDE_OUTPUT_DIR}" | 455 echo " ./image_to_vmware.sh --from=${OUTSIDE_OUTPUT_DIR}" |
| 456 echo "from the scripts directory where you entered the chroot." | 456 echo "from the scripts directory where you entered the chroot." |
| 457 | 457 |
| 458 trap - EXIT | 458 trap - EXIT |
| OLD | NEW |