Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(38)

Side by Side Diff: build_image

Issue 6677163: build_image: provide USE flags when installing chromeos-dev (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/crosutils.git@master
Patch Set: Created 9 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 400 matching lines...) Expand 10 before | Expand all | Expand 10 after
411 ${SCRIPTS_DIR}/mount_gpt_image.sh --from "${OUTPUT_DIR}" \ 411 ${SCRIPTS_DIR}/mount_gpt_image.sh --from "${OUTPUT_DIR}" \
412 --image "${image_name}" -r "${ROOT_FS_DIR}" \ 412 --image "${image_name}" -r "${ROOT_FS_DIR}" \
413 -s "${STATEFUL_FS_DIR}" -e "${ESP_FS_DIR}" 413 -s "${STATEFUL_FS_DIR}" -e "${ESP_FS_DIR}"
414 414
415 # Determine the root dir for developer packages. 415 # Determine the root dir for developer packages.
416 local root_dev_dir="${ROOT_FS_DIR}" 416 local root_dev_dir="${ROOT_FS_DIR}"
417 [ ${FLAGS_statefuldev} -eq ${FLAGS_TRUE} ] && \ 417 [ ${FLAGS_statefuldev} -eq ${FLAGS_TRUE} ] && \
418 root_dev_dir="${ROOT_FS_DIR}/usr/local" 418 root_dev_dir="${ROOT_FS_DIR}/usr/local"
419 419
420 # Install developer packages described in chromeos-dev. 420 # Install developer packages described in chromeos-dev.
421 sudo INSTALL_MASK="${INSTALL_MASK}" ${EMERGE_BOARD_CMD} \ 421 sudo USE="${USE} ${EXTRA_USE}" INSTALL_MASK="${INSTALL_MASK}" \
davidjames 2011/04/05 20:09:43 Thanks, can you also add the -E argument to sudo w
422 --root="${root_dev_dir}" --root-deps=rdeps \ 422 ${EMERGE_BOARD_CMD} --root="${root_dev_dir}" --root-deps=rdeps \
423 --usepkgonly -uDNv chromeos-dev ${EMERGE_JOBS} 423 --usepkgonly -uDNv chromeos-dev ${EMERGE_JOBS}
kliegs 2011/04/05 20:14:05 I thought you'd mentioned on IRC the need to remov
424 424
425 if [[ $FLAGS_preserve -eq ${FLAGS_TRUE} ]] ; then 425 if [[ $FLAGS_preserve -eq ${FLAGS_TRUE} ]] ; then
426 # Clean out unused packages 426 # Clean out unused packages
427 sudo INSTALL_MASK="${INSTALL_MASK}" ${EMERGE_BOARD_CMD} \ 427 sudo USE="${USE} ${EXTRA_USE}" INSTALL_MASK="${INSTALL_MASK}" \
428 --root="${ROOT_FS_DIR}" --root-deps=rdeps \ 428 ${EMERGE_BOARD_CMD} --root="${ROOT_FS_DIR}" --root-deps=rdeps \
429 --usepkgonly --depclean ${EMERGE_JOBS} 429 --usepkgonly --depclean ${EMERGE_JOBS}
430 fi 430 fi
431 431
432 # Install the bare necessary files so that the "emerge" command works 432 # Install the bare necessary files so that the "emerge" command works
433 if [ ${FLAGS_statefuldev} -eq ${FLAGS_TRUE} ]; then 433 if [ ${FLAGS_statefuldev} -eq ${FLAGS_TRUE} ]; then
434 sudo cp -a ${root_dev_dir}/share/portage ${ROOT_FS_DIR}/usr/share 434 sudo cp -a ${root_dev_dir}/share/portage ${ROOT_FS_DIR}/usr/share
435 sudo sed -i s,/usr/bin/wget,wget, \ 435 sudo sed -i s,/usr/bin/wget,wget, \
436 ${ROOT_FS_DIR}/usr/share/portage/config/make.globals 436 ${ROOT_FS_DIR}/usr/share/portage/config/make.globals
437 fi 437 fi
438 sudo mkdir -p ${ROOT_FS_DIR}/etc/make.profile 438 sudo mkdir -p ${ROOT_FS_DIR}/etc/make.profile
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
499 echo "Updating base packages on ${image_name}" 499 echo "Updating base packages on ${image_name}"
500 500
501 # Create stateful partition of the same size as the rootfs. 501 # Create stateful partition of the same size as the rootfs.
502 trap "mount_gpt_cleanup" EXIT 502 trap "mount_gpt_cleanup" EXIT
503 503
504 ${SCRIPTS_DIR}/mount_gpt_image.sh --from "${OUTPUT_DIR}" \ 504 ${SCRIPTS_DIR}/mount_gpt_image.sh --from "${OUTPUT_DIR}" \
505 --image "${image_name}" -r "${ROOT_FS_DIR}" \ 505 --image "${image_name}" -r "${ROOT_FS_DIR}" \
506 -s "${STATEFUL_FS_DIR}" -e "${ESP_FS_DIR}" 506 -s "${STATEFUL_FS_DIR}" -e "${ESP_FS_DIR}"
507 507
508 # Emerge updated packages, exactly like when creating base image 508 # Emerge updated packages, exactly like when creating base image
509 sudo USE="${EXTRA_USE}" INSTALL_MASK="${INSTALL_MASK}" ${EMERGE_BOARD_CMD} \ 509 sudo USE="${EXTRA_USE}" INSTALL_MASK="${INSTALL_MASK}" ${EMERGE_BOARD_CMD} \
davidjames 2011/04/05 20:09:43 This should be updated as well to fix the --preser
510 --root="${ROOT_FS_DIR}" --root-deps=rdeps \ 510 --root="${ROOT_FS_DIR}" --root-deps=rdeps \
511 --usepkgonly -uDNv chromeos ${EXTRA_PACKAGES} ${EMERGE_JOBS} 511 --usepkgonly -uDNv chromeos ${EXTRA_PACKAGES} ${EMERGE_JOBS}
512 512
513 # Clean out unused packages 513 # Clean out unused packages
514 sudo INSTALL_MASK="${INSTALL_MASK}" ${EMERGE_BOARD_CMD} \ 514 sudo INSTALL_MASK="${INSTALL_MASK}" ${EMERGE_BOARD_CMD} \
davidjames 2011/04/05 20:09:43 Same here.
515 --root="${ROOT_FS_DIR}" --root-deps=rdeps \ 515 --root="${ROOT_FS_DIR}" --root-deps=rdeps \
516 --usepkgonly --depclean ${EMERGE_JOBS} 516 --usepkgonly --depclean ${EMERGE_JOBS}
517 517
518 trap - EXIT 518 trap - EXIT
519 ${SCRIPTS_DIR}/mount_gpt_image.sh -u -r "${ROOT_FS_DIR}" \ 519 ${SCRIPTS_DIR}/mount_gpt_image.sh -u -r "${ROOT_FS_DIR}" \
520 -s "${STATEFUL_FS_DIR}" -e "${ESP_FS_DIR}" 520 -s "${STATEFUL_FS_DIR}" -e "${ESP_FS_DIR}"
521 } 521 }
522 522
523 zero_free_space() { 523 zero_free_space() {
524 local fs_mount_point=$1 524 local fs_mount_point=$1
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
631 sudo mkdir -p "${ROOT_FS_DIR}/usr/local" 631 sudo mkdir -p "${ROOT_FS_DIR}/usr/local"
632 sudo mount --bind "${DEV_IMAGE_ROOT}" "${ROOT_FS_DIR}/usr/local" 632 sudo mount --bind "${DEV_IMAGE_ROOT}" "${ROOT_FS_DIR}/usr/local"
633 sudo mkdir -p "${ROOT_FS_DIR}/var" 633 sudo mkdir -p "${ROOT_FS_DIR}/var"
634 sudo mount --bind "${STATEFUL_FS_DIR}/var" "${ROOT_FS_DIR}/var" 634 sudo mount --bind "${STATEFUL_FS_DIR}/var" "${ROOT_FS_DIR}/var"
635 sudo mkdir -p "${ROOT_FS_DIR}/dev" 635 sudo mkdir -p "${ROOT_FS_DIR}/dev"
636 636
637 # We "emerge --root=${ROOT_FS_DIR} --root-deps=rdeps --usepkgonly" all of the 637 # We "emerge --root=${ROOT_FS_DIR} --root-deps=rdeps --usepkgonly" all of the
638 # runtime packages for chrome os. This builds up a chrome os image from 638 # runtime packages for chrome os. This builds up a chrome os image from
639 # binary packages with runtime dependencies only. We use INSTALL_MASK to 639 # binary packages with runtime dependencies only. We use INSTALL_MASK to
640 # trim the image size as much as possible. 640 # trim the image size as much as possible.
641 sudo USE="${EXTRA_USE}" INSTALL_MASK="${INSTALL_MASK}" ${EMERGE_BOARD_CMD} \ 641 sudo USE="${EXTRA_USE}" INSTALL_MASK="${INSTALL_MASK}" ${EMERGE_BOARD_CMD} \
davidjames 2011/04/05 20:09:43 Strictly speaking this doesn't need USE flags but
642 --root="${ROOT_FS_DIR}" --root-deps=rdeps \ 642 --root="${ROOT_FS_DIR}" --root-deps=rdeps \
643 --usepkgonly chromeos ${EXTRA_PACKAGES} ${EMERGE_JOBS} 643 --usepkgonly chromeos ${EXTRA_PACKAGES} ${EMERGE_JOBS}
644 644
645 # Set /etc/lsb-release on the image. 645 # Set /etc/lsb-release on the image.
646 "${OVERLAY_CHROMEOS_DIR}/scripts/cros_set_lsb_release" \ 646 "${OVERLAY_CHROMEOS_DIR}/scripts/cros_set_lsb_release" \
647 --root="${ROOT_FS_DIR}" \ 647 --root="${ROOT_FS_DIR}" \
648 --board="${BOARD}" 648 --board="${BOARD}"
649 649
650 # Populates the root filesystem with legacy bootloader templates 650 # Populates the root filesystem with legacy bootloader templates
651 # appropriate for the platform. The autoupdater and installer will 651 # appropriate for the platform. The autoupdater and installer will
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
811 echo "Developer image created as ${DEVELOPER_IMAGE_NAME}" 811 echo "Developer image created as ${DEVELOPER_IMAGE_NAME}"
812 fi 812 fi
813 813
814 print_time_elapsed 814 print_time_elapsed
815 815
816 echo "To copy to USB keyfob, do something like:" 816 echo "To copy to USB keyfob, do something like:"
817 echo " ./image_to_usb.sh --from=${OUTSIDE_OUTPUT_DIR} --to=/dev/sdX" 817 echo " ./image_to_usb.sh --from=${OUTSIDE_OUTPUT_DIR} --to=/dev/sdX"
818 echo "To convert to VMWare image, INSIDE the chroot, do something like:" 818 echo "To convert to VMWare image, INSIDE the chroot, do something like:"
819 echo " ./image_to_vm.sh --from=${OUTSIDE_OUTPUT_DIR} --board=${BOARD}" 819 echo " ./image_to_vm.sh --from=${OUTSIDE_OUTPUT_DIR} --board=${BOARD}"
820 echo "from the scripts directory where you entered the chroot." 820 echo "from the scripts directory where you entered the chroot."
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698