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 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
319 # build because vmlinuz_hd.vblock hasn't been created by build_kernel_image.sh | 319 # build because vmlinuz_hd.vblock hasn't been created by build_kernel_image.sh |
320 if [[ "${ARCH}" = "x86" ]]; then | 320 if [[ "${ARCH}" = "x86" ]]; then |
321 sudo cp "${OUTPUT_DIR}/vmlinuz_hd.vblock" "${STATEFUL_FS_DIR}" | 321 sudo cp "${OUTPUT_DIR}/vmlinuz_hd.vblock" "${STATEFUL_FS_DIR}" |
322 fi | 322 fi |
323 | 323 |
324 # START_KERN_A is set by the first call to install the gpt. | 324 # START_KERN_A is set by the first call to install the gpt. |
325 local koffset="$(partoffset ${OUTPUT_DIR}/${image_name} 2)" | 325 local koffset="$(partoffset ${OUTPUT_DIR}/${image_name} 2)" |
326 sudo dd if="${OUTPUT_DIR}/vmlinuz.image" of="${OUTPUT_DIR}/${image_name}" \ | 326 sudo dd if="${OUTPUT_DIR}/vmlinuz.image" of="${OUTPUT_DIR}/${image_name}" \ |
327 conv=notrunc bs=512 seek=${koffset} | 327 conv=notrunc bs=512 seek=${koffset} |
328 | 328 |
329 # Populate the legacy/efi bootloader partition. | 329 # Update the bootloaders. For legacy/efi x86, the EFI system partition |
| 330 # will be updated and for arm, the mbr will be updated (for u-boot). |
330 local kernel_part="--kernel_partition='${OUTPUT_DIR}/vmlinuz.image'" | 331 local kernel_part="--kernel_partition='${OUTPUT_DIR}/vmlinuz.image'" |
| 332 kernel_part="${kernel_part} --install_syslinux" |
331 local bootloader_to="${ESP_FS_IMG}" | 333 local bootloader_to="${ESP_FS_IMG}" |
332 local usb_disk="${FLAGS_usb_disk}" | 334 local usb_disk="${FLAGS_usb_disk}" |
333 local bootloader_to="$(mount | grep ${ESP_FS_DIR} | cut -f1 -d' ')" | 335 local bootloader_to="$(mount | grep ${ESP_FS_DIR} | cut -f1 -d' ')" |
334 if [[ "${ARCH}" == "arm" ]]; then | 336 if [[ "${ARCH}" == "arm" ]]; then |
335 # TODO(wad) mmcblk1p3 is hardcoded for arm for now! | 337 # TODO(wad) mmcblk1p3 is hardcoded for arm for now! |
336 usb_disk="/dev/mmcblk1p3" | 338 usb_disk="/dev/mmcblk1p3" |
337 kernel_part="--kernel_cmdline=\"${FLAGS_arm_extra_bootargs}\" " | 339 kernel_part="--kernel_cmdline=\"${FLAGS_arm_extra_bootargs}\" " |
338 # TODO(wad) Integrate dmtable extraction into the arm build | 340 # TODO(wad) Integrate dmtable extraction into the arm build |
339 # E.g. $(cat ${OUTPUT_DIR}/boot.config | tr -s '\n' ' ')" | 341 # E.g. $(cat ${OUTPUT_DIR}/boot.config | tr -s '\n' ' ')" |
340 local kpart_offset="--kernel_partition_offset=${koffset}" | 342 local kpart_offset="--kernel_partition_offset=${koffset}" |
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
697 echo "Developer image created as ${DEVELOPER_IMAGE_NAME}" | 699 echo "Developer image created as ${DEVELOPER_IMAGE_NAME}" |
698 fi | 700 fi |
699 | 701 |
700 print_time_elapsed | 702 print_time_elapsed |
701 | 703 |
702 echo "To copy to USB keyfob, OUTSIDE the chroot, do something like:" | 704 echo "To copy to USB keyfob, OUTSIDE the chroot, do something like:" |
703 echo " ./image_to_usb.sh --from=${OUTSIDE_OUTPUT_DIR} --to=/dev/sdX" | 705 echo " ./image_to_usb.sh --from=${OUTSIDE_OUTPUT_DIR} --to=/dev/sdX" |
704 echo "To convert to VMWare image, OUTSIDE the chroot, do something like:" | 706 echo "To convert to VMWare image, OUTSIDE the chroot, do something like:" |
705 echo " ./image_to_vmware.sh --from=${OUTSIDE_OUTPUT_DIR}" | 707 echo " ./image_to_vmware.sh --from=${OUTSIDE_OUTPUT_DIR}" |
706 echo "from the scripts directory where you entered the chroot." | 708 echo "from the scripts directory where you entered the chroot." |
OLD | NEW |