| 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 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 325 | 325 |
| 326 # Install development packages. | 326 # Install development packages. |
| 327 if [[ $FLAGS_withdev -eq $FLAGS_TRUE ]] ; then | 327 if [[ $FLAGS_withdev -eq $FLAGS_TRUE ]] ; then |
| 328 sudo INSTALL_MASK="$INSTALL_MASK" emerge-${BOARD} \ | 328 sudo INSTALL_MASK="$INSTALL_MASK" emerge-${BOARD} \ |
| 329 --root="$ROOT_DEV_DIR" --root-deps=rdeps \ | 329 --root="$ROOT_DEV_DIR" --root-deps=rdeps \ |
| 330 --usepkgonly chromeos-dev $EMERGE_JOBS | 330 --usepkgonly chromeos-dev $EMERGE_JOBS |
| 331 | 331 |
| 332 # TODO(sosa@chromium.org) - Re-hide under statefuldev after switch | 332 # TODO(sosa@chromium.org) - Re-hide under statefuldev after switch |
| 333 # Flag will mount /usr/local on target device | 333 # Flag will mount /usr/local on target device |
| 334 sudo mkdir -p "$ROOT_FS_DIR/root" | 334 sudo mkdir -p "$ROOT_FS_DIR/root" |
| 335 sudo touch "$ROOT_FS_DIR/root/.dev_mode" | |
| 336 | 335 |
| 337 # The ldd tool is a useful shell script but lives in glibc; just copy it. | 336 # The ldd tool is a useful shell script but lives in glibc; just copy it. |
| 338 sudo cp -a "$(which ldd)" "${ROOT_DEV_DIR}/usr/bin" | 337 sudo cp -a "$(which ldd)" "${ROOT_DEV_DIR}/usr/bin" |
| 339 fi | 338 fi |
| 340 | 339 |
| 341 if [ -n "$FLAGS_factory_server" ]; then | 340 if [ -n "$FLAGS_factory_server" ]; then |
| 342 sudo INSTALL_MASK="$INSTALL_MASK" emerge-${BOARD} \ | 341 sudo INSTALL_MASK="$INSTALL_MASK" emerge-${BOARD} \ |
| 343 --root="$ROOT_DEV_DIR" --root-deps=rdeps \ | 342 --root="$ROOT_DEV_DIR" --root-deps=rdeps \ |
| 344 --usepkgonly chromeos-factoryinstall $EMERGE_JOBS | 343 --usepkgonly chromeos-factoryinstall $EMERGE_JOBS |
| 345 fi | 344 fi |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 403 menuentry "boot from usb" { | 402 menuentry "boot from usb" { |
| 404 linux /efi/boot/vmlinuz quiet console=tty2 init=/sbin/init boot=local rootwait
root=/dev/sdb3 ro noresume noswap i915.modeset=1 loglevel=1 | 403 linux /efi/boot/vmlinuz quiet console=tty2 init=/sbin/init boot=local rootwait
root=/dev/sdb3 ro noresume noswap i915.modeset=1 loglevel=1 |
| 405 } | 404 } |
| 406 | 405 |
| 407 menuentry "boot from usb with serial debug" { | 406 menuentry "boot from usb with serial debug" { |
| 408 linux /efi/boot/vmlinuz earlyprintk=serial,ttyS0,115200 console=ttyS0,115200 i
nit=/sbin/init boot=local rootwait root=/dev/sdb3 ro noresume noswap i915.modese
t=1 loglevel=7 | 407 linux /efi/boot/vmlinuz earlyprintk=serial,ttyS0,115200 console=ttyS0,115200 i
nit=/sbin/init boot=local rootwait root=/dev/sdb3 ro noresume noswap i915.modese
t=1 loglevel=7 |
| 409 } | 408 } |
| 410 | 409 |
| 411 EOF | 410 EOF |
| 412 | 411 |
| 413 # Run ldconfig for rootfs's ld.so.cache | 412 # By default, dev mode should be activated for either development builds or |
| 414 if [ $FLAGS_statefuldev -eq $FLAGS_TRUE ] ; then | 413 # test builds. |
| 415 # Re-run ldconfig to fix /etc/ldconfig.so.cache | 414 if [[ $FLAGS_withdev -eq $FLAGS_TRUE ]] ||\ |
| 415 [[ $FLAGS_withtest -eq $FLAGS_TRUE ]]; then |
| 416 sudo touch "$ROOT_FS_DIR/root/.dev_mode" |
| 417 |
| 418 # Re-run ldconfig to fix /etc/ldconfig.so.cache. |
| 416 sudo /sbin/ldconfig -r "$ROOT_FS_DIR" | 419 sudo /sbin/ldconfig -r "$ROOT_FS_DIR" |
| 417 | |
| 418 #TODO(sosa@chromium.org) - /usr/bin/xterm symlink not created in stateful. | |
| 419 sudo ln -sf "/usr/local/bin/aterm" "/usr/bin/xterm" | |
| 420 fi | 420 fi |
| 421 | 421 |
| 422 "${SCRIPTS_DIR}/customize_rootfs" \ | 422 "${SCRIPTS_DIR}/customize_rootfs" \ |
| 423 --root="$ROOT_FS_DIR" \ | 423 --root="$ROOT_FS_DIR" \ |
| 424 --target="$ARCH" \ | 424 --target="$ARCH" \ |
| 425 --board="$BOARD" \ | 425 --board="$BOARD" \ |
| 426 $EXTRA_CUSTOMIZE_ROOTFS_FLAGS | 426 $EXTRA_CUSTOMIZE_ROOTFS_FLAGS |
| 427 | 427 |
| 428 # Check that the image has been correctly created. | 428 # Check that the image has been correctly created. |
| 429 "${SCRIPTS_DIR}/test_image" \ | 429 "${SCRIPTS_DIR}/test_image" \ |
| (...skipping 25 matching lines...) Expand all Loading... |
| 455 | 455 |
| 456 OUTSIDE_OUTPUT_DIR="../build/images/${FLAGS_board}/${IMAGE_SUBDIR}" | 456 OUTSIDE_OUTPUT_DIR="../build/images/${FLAGS_board}/${IMAGE_SUBDIR}" |
| 457 echo "Done. Image created in ${OUTPUT_DIR}" | 457 echo "Done. Image created in ${OUTPUT_DIR}" |
| 458 echo "To copy to USB keyfob, OUTSIDE the chroot, do something like:" | 458 echo "To copy to USB keyfob, OUTSIDE the chroot, do something like:" |
| 459 echo " ./image_to_usb.sh --from=${OUTSIDE_OUTPUT_DIR} --to=/dev/sdX" | 459 echo " ./image_to_usb.sh --from=${OUTSIDE_OUTPUT_DIR} --to=/dev/sdX" |
| 460 echo "To convert to VMWare image, OUTSIDE the chroot, do something like:" | 460 echo "To convert to VMWare image, OUTSIDE the chroot, do something like:" |
| 461 echo " ./image_to_vmware.sh --from=${OUTSIDE_OUTPUT_DIR}" | 461 echo " ./image_to_vmware.sh --from=${OUTSIDE_OUTPUT_DIR}" |
| 462 echo "from the scripts directory where you entered the chroot." | 462 echo "from the scripts directory where you entered the chroot." |
| 463 | 463 |
| 464 trap - EXIT | 464 trap - EXIT |
| OLD | NEW |