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 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 --image "$DEVELOPER_IMAGE_NAME" -r "$root_fs_dir" -s "$stateful_dir" | 200 --image "$DEVELOPER_IMAGE_NAME" -r "$root_fs_dir" -s "$stateful_dir" |
201 | 201 |
202 # Determine the root dir for developer packages. | 202 # Determine the root dir for developer packages. |
203 local root_dev_dir="$root_fs_dir" | 203 local root_dev_dir="$root_fs_dir" |
204 [ $FLAGS_statefuldev -eq $FLAGS_TRUE ] && \ | 204 [ $FLAGS_statefuldev -eq $FLAGS_TRUE ] && \ |
205 root_dev_dir="$root_fs_dir/usr/local" | 205 root_dev_dir="$root_fs_dir/usr/local" |
206 | 206 |
207 # Install developer packages described in chromeos-dev. | 207 # Install developer packages described in chromeos-dev. |
208 sudo INSTALL_MASK="$INSTALL_MASK" emerge-${BOARD} \ | 208 sudo INSTALL_MASK="$INSTALL_MASK" emerge-${BOARD} \ |
209 --root="$root_dev_dir" --root-deps=rdeps \ | 209 --root="$root_dev_dir" --root-deps=rdeps \ |
210 --getbinpkg --usepkg chromeos-dev $EMERGE_JOBS | 210 --usepkgonly chromeos-dev $EMERGE_JOBS |
211 | 211 |
212 # Re-run ldconfig to fix /etc/ldconfig.so.cache. | 212 # Re-run ldconfig to fix /etc/ldconfig.so.cache. |
213 sudo /sbin/ldconfig -r "$root_fs_dir" | 213 sudo /sbin/ldconfig -r "$root_fs_dir" |
214 | 214 |
215 # Mark the image as a developer image (input to chromeos_startup). | 215 # Mark the image as a developer image (input to chromeos_startup). |
216 sudo mkdir -p "$root_fs_dir/root" | 216 sudo mkdir -p "$root_fs_dir/root" |
217 sudo touch "$root_fs_dir/root/.dev_mode" | 217 sudo touch "$root_fs_dir/root/.dev_mode" |
218 | 218 |
219 # Additional changes to developer image. | 219 # Additional changes to developer image. |
220 | 220 |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
378 sudo mount --bind "${DEV_IMAGE_ROOT}" "${ROOT_FS_DIR}/usr/local" | 378 sudo mount --bind "${DEV_IMAGE_ROOT}" "${ROOT_FS_DIR}/usr/local" |
379 sudo mkdir -p "${ROOT_FS_DIR}/var" | 379 sudo mkdir -p "${ROOT_FS_DIR}/var" |
380 sudo mount --bind "${STATEFUL_DIR}/var" "${ROOT_FS_DIR}/var" | 380 sudo mount --bind "${STATEFUL_DIR}/var" "${ROOT_FS_DIR}/var" |
381 | 381 |
382 # We "emerge --root=$ROOT_FS_DIR --root-deps=rdeps --usepkgonly" all of the | 382 # We "emerge --root=$ROOT_FS_DIR --root-deps=rdeps --usepkgonly" all of the |
383 # runtime packages for chrome os. This builds up a chrome os image from binary | 383 # runtime packages for chrome os. This builds up a chrome os image from binary |
384 # packages with runtime dependencies only. We use INSTALL_MASK to trim the | 384 # packages with runtime dependencies only. We use INSTALL_MASK to trim the |
385 # image size as much as possible. | 385 # image size as much as possible. |
386 sudo INSTALL_MASK="$INSTALL_MASK" emerge-${BOARD} \ | 386 sudo INSTALL_MASK="$INSTALL_MASK" emerge-${BOARD} \ |
387 --root="$ROOT_FS_DIR" --root-deps=rdeps \ | 387 --root="$ROOT_FS_DIR" --root-deps=rdeps \ |
388 --getbinpkg --usepkg chromeos $EMERGE_JOBS | 388 --usepkgonly chromeos $EMERGE_JOBS |
389 | 389 |
390 # Extract the kernel from the root filesystem for use by the GPT image. Legacy | 390 # Extract the kernel from the root filesystem for use by the GPT image. Legacy |
391 # BIOS will use the kernel in the rootfs (via syslinux), Chrome OS BIOS will | 391 # BIOS will use the kernel in the rootfs (via syslinux), Chrome OS BIOS will |
392 # use the kernel partition. | 392 # use the kernel partition. |
393 sudo cp -f "${ROOT_FS_DIR}/boot/vmlinuz" "${OUTPUT_DIR}/vmlinuz.image" | 393 sudo cp -f "${ROOT_FS_DIR}/boot/vmlinuz" "${OUTPUT_DIR}/vmlinuz.image" |
394 | 394 |
395 # Create EFI System Partition to boot stock EFI BIOS (but not ChromeOS EFI | 395 # Create EFI System Partition to boot stock EFI BIOS (but not ChromeOS EFI |
396 # BIOS). We only need this for x86, but it's simpler and safer to keep the disk | 396 # BIOS). We only need this for x86, but it's simpler and safer to keep the disk |
397 # images the same for both x86 and ARM. | 397 # images the same for both x86 and ARM. |
398 ESP_IMG=${OUTPUT_DIR}/esp.image | 398 ESP_IMG=${OUTPUT_DIR}/esp.image |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
480 echo "Done. Image created in ${OUTPUT_DIR}" | 480 echo "Done. Image created in ${OUTPUT_DIR}" |
481 echo "Chromium OS image created as $PRISTINE_IMAGE_NAME" | 481 echo "Chromium OS image created as $PRISTINE_IMAGE_NAME" |
482 if [ "$FLAGS_withdev" -eq "$FLAGS_TRUE" ]; then | 482 if [ "$FLAGS_withdev" -eq "$FLAGS_TRUE" ]; then |
483 echo "Developer image created as $DEVELOPER_IMAGE_NAME" | 483 echo "Developer image created as $DEVELOPER_IMAGE_NAME" |
484 fi | 484 fi |
485 echo "To copy to USB keyfob, OUTSIDE the chroot, do something like:" | 485 echo "To copy to USB keyfob, OUTSIDE the chroot, do something like:" |
486 echo " ./image_to_usb.sh --from=${OUTSIDE_OUTPUT_DIR} --to=/dev/sdX" | 486 echo " ./image_to_usb.sh --from=${OUTSIDE_OUTPUT_DIR} --to=/dev/sdX" |
487 echo "To convert to VMWare image, OUTSIDE the chroot, do something like:" | 487 echo "To convert to VMWare image, OUTSIDE the chroot, do something like:" |
488 echo " ./image_to_vmware.sh --from=${OUTSIDE_OUTPUT_DIR}" | 488 echo " ./image_to_vmware.sh --from=${OUTSIDE_OUTPUT_DIR}" |
489 echo "from the scripts directory where you entered the chroot." | 489 echo "from the scripts directory where you entered the chroot." |
OLD | NEW |