| 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 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 372 "bootm C0008000" > ${MBR_SCRIPT} | 372 "bootm C0008000" > ${MBR_SCRIPT} |
| 373 MKIMAGE="${BOARD_ROOT}/u-boot/mkimage" | 373 MKIMAGE="${BOARD_ROOT}/u-boot/mkimage" |
| 374 if [[ -f "$MKIMAGE".gz ]]; then | 374 if [[ -f "$MKIMAGE".gz ]]; then |
| 375 sudo gunzip "$MKIMAGE".gz | 375 sudo gunzip "$MKIMAGE".gz |
| 376 fi | 376 fi |
| 377 if [[ -x "$MKIMAGE" ]]; then | 377 if [[ -x "$MKIMAGE" ]]; then |
| 378 MBR_SCRIPT_UIMG="${MBR_SCRIPT}.uimg" | 378 MBR_SCRIPT_UIMG="${MBR_SCRIPT}.uimg" |
| 379 "$MKIMAGE" -A "${ARCH}" -O linux -T script -a 0 -e 0 -n "COS boot" \ | 379 "$MKIMAGE" -A "${ARCH}" -O linux -T script -a 0 -e 0 -n "COS boot" \ |
| 380 -d ${MBR_SCRIPT} ${MBR_SCRIPT_UIMG} | 380 -d ${MBR_SCRIPT} ${MBR_SCRIPT_UIMG} |
| 381 dd bs=1 count=`stat --printf="%s" ${MBR_SCRIPT_UIMG}` \ | 381 dd bs=1 count=`stat --printf="%s" ${MBR_SCRIPT_UIMG}` \ |
| 382 if="$MBR_SCRIPT_UIMG" of="$MBR_IMG" | 382 if="$MBR_SCRIPT_UIMG" of="$MBR_IMG" conv=notrunc |
| 383 hexdump -v -C "$MBR_IMG" | 383 hexdump -v -C "$MBR_IMG" |
| 384 else | 384 else |
| 385 echo "Error: u-boot mkimage not found or not executable." | 385 echo "Error: u-boot mkimage not found or not executable." |
| 386 fi | 386 fi |
| 387 fi | 387 fi |
| 388 | 388 |
| 389 OUTSIDE_OUTPUT_DIR="../build/images/${FLAGS_board}/${IMAGE_SUBDIR}" | 389 OUTSIDE_OUTPUT_DIR="../build/images/${FLAGS_board}/${IMAGE_SUBDIR}" |
| 390 echo "Done. Image created in ${OUTPUT_DIR}" | 390 echo "Done. Image created in ${OUTPUT_DIR}" |
| 391 echo "To copy to USB keyfob, OUTSIDE the chroot, do something like:" | 391 echo "To copy to USB keyfob, OUTSIDE the chroot, do something like:" |
| 392 echo " ./image_to_usb.sh --from=${OUTSIDE_OUTPUT_DIR} --to=/dev/sdb" | 392 echo " ./image_to_usb.sh --from=${OUTSIDE_OUTPUT_DIR} --to=/dev/sdb" |
| 393 echo "To convert to VMWare image, OUTSIDE the chroot, do something like:" | 393 echo "To convert to VMWare image, OUTSIDE the chroot, do something like:" |
| 394 echo " ./image_to_vmware.sh --from=${OUTSIDE_OUTPUT_DIR}" | 394 echo " ./image_to_vmware.sh --from=${OUTSIDE_OUTPUT_DIR}" |
| 395 echo "from the scripts directory where you entered the chroot." | 395 echo "from the scripts directory where you entered the chroot." |
| 396 | 396 |
| 397 trap - EXIT | 397 trap - EXIT |
| OLD | NEW |