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 --usepkgonly chromeos-dev $EMERGE_JOBS | 210 --getbinpkg --usepkg chromeos-dev $EMERGE_JOBS |
Nasser Grainawi
2010/05/21 15:44:10
Isn't this redundant? From 'man emerge':
--getbinp
| |
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 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
371 sudo mount --bind "${DEV_IMAGE_ROOT}" "${ROOT_FS_DIR}/usr/local" | 371 sudo mount --bind "${DEV_IMAGE_ROOT}" "${ROOT_FS_DIR}/usr/local" |
372 sudo mkdir -p "${ROOT_FS_DIR}/var" | 372 sudo mkdir -p "${ROOT_FS_DIR}/var" |
373 sudo mount --bind "${STATEFUL_DIR}/var" "${ROOT_FS_DIR}/var" | 373 sudo mount --bind "${STATEFUL_DIR}/var" "${ROOT_FS_DIR}/var" |
374 | 374 |
375 # We "emerge --root=$ROOT_FS_DIR --root-deps=rdeps --usepkgonly" all of the | 375 # We "emerge --root=$ROOT_FS_DIR --root-deps=rdeps --usepkgonly" all of the |
376 # runtime packages for chrome os. This builds up a chrome os image from binary | 376 # runtime packages for chrome os. This builds up a chrome os image from binary |
377 # packages with runtime dependencies only. We use INSTALL_MASK to trim the | 377 # packages with runtime dependencies only. We use INSTALL_MASK to trim the |
378 # image size as much as possible. | 378 # image size as much as possible. |
379 sudo INSTALL_MASK="$INSTALL_MASK" emerge-${BOARD} \ | 379 sudo INSTALL_MASK="$INSTALL_MASK" emerge-${BOARD} \ |
380 --root="$ROOT_FS_DIR" --root-deps=rdeps \ | 380 --root="$ROOT_FS_DIR" --root-deps=rdeps \ |
381 --usepkgonly chromeos $EMERGE_JOBS | 381 --getbinpkg --usepkg chromeos $EMERGE_JOBS |
382 | 382 |
383 # Extract the kernel from the root filesystem for use by the GPT image. Legacy | 383 # Extract the kernel from the root filesystem for use by the GPT image. Legacy |
384 # BIOS will use the kernel in the rootfs (via syslinux), Chrome OS BIOS will | 384 # BIOS will use the kernel in the rootfs (via syslinux), Chrome OS BIOS will |
385 # use the kernel partition. | 385 # use the kernel partition. |
386 sudo cp -f "${ROOT_FS_DIR}/boot/vmlinuz" "${OUTPUT_DIR}/vmlinuz.image" | 386 sudo cp -f "${ROOT_FS_DIR}/boot/vmlinuz" "${OUTPUT_DIR}/vmlinuz.image" |
387 | 387 |
388 # Create EFI System Partition to boot stock EFI BIOS (but not ChromeOS EFI | 388 # Create EFI System Partition to boot stock EFI BIOS (but not ChromeOS EFI |
389 # BIOS). We only need this for x86, but it's simpler and safer to keep the disk | 389 # BIOS). We only need this for x86, but it's simpler and safer to keep the disk |
390 # images the same for both x86 and ARM. | 390 # images the same for both x86 and ARM. |
391 ESP_IMG=${OUTPUT_DIR}/esp.image | 391 ESP_IMG=${OUTPUT_DIR}/esp.image |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
473 echo "Done. Image created in ${OUTPUT_DIR}" | 473 echo "Done. Image created in ${OUTPUT_DIR}" |
474 echo "Chromium OS image created as $PRISTINE_IMAGE_NAME" | 474 echo "Chromium OS image created as $PRISTINE_IMAGE_NAME" |
475 if [ "$FLAGS_withdev" -eq "$FLAGS_TRUE" ]; then | 475 if [ "$FLAGS_withdev" -eq "$FLAGS_TRUE" ]; then |
476 echo "Developer image created as $DEVELOPER_IMAGE_NAME" | 476 echo "Developer image created as $DEVELOPER_IMAGE_NAME" |
477 fi | 477 fi |
478 echo "To copy to USB keyfob, OUTSIDE the chroot, do something like:" | 478 echo "To copy to USB keyfob, OUTSIDE the chroot, do something like:" |
479 echo " ./image_to_usb.sh --from=${OUTSIDE_OUTPUT_DIR} --to=/dev/sdX" | 479 echo " ./image_to_usb.sh --from=${OUTSIDE_OUTPUT_DIR} --to=/dev/sdX" |
480 echo "To convert to VMWare image, OUTSIDE the chroot, do something like:" | 480 echo "To convert to VMWare image, OUTSIDE the chroot, do something like:" |
481 echo " ./image_to_vmware.sh --from=${OUTSIDE_OUTPUT_DIR}" | 481 echo " ./image_to_vmware.sh --from=${OUTSIDE_OUTPUT_DIR}" |
482 echo "from the scripts directory where you entered the chroot." | 482 echo "from the scripts directory where you entered the chroot." |
OLD | NEW |