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 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
370 sudo losetup "${ESP_LOOP_DEV}" "${ESP_IMG}" | 370 sudo losetup "${ESP_LOOP_DEV}" "${ESP_IMG}" |
371 sudo mount "${ESP_LOOP_DEV}" "${ESP_DIR}" | 371 sudo mount "${ESP_LOOP_DEV}" "${ESP_DIR}" |
372 sudo mkdir -p "${ESP_DIR}/efi/boot" | 372 sudo mkdir -p "${ESP_DIR}/efi/boot" |
373 sudo grub-mkimage -p /efi/boot -o "${ESP_DIR}/efi/boot/bootx64.efi" \ | 373 sudo grub-mkimage -p /efi/boot -o "${ESP_DIR}/efi/boot/bootx64.efi" \ |
374 part_gpt fat ext2 normal boot sh chain configfile linux | 374 part_gpt fat ext2 normal boot sh chain configfile linux |
375 sudo cp "${ROOT_FS_DIR}/boot/vmlinuz" "${ESP_DIR}/efi/boot/vmlinuz" | 375 sudo cp "${ROOT_FS_DIR}/boot/vmlinuz" "${ESP_DIR}/efi/boot/vmlinuz" |
376 cat <<EOF | sudo dd of="${ESP_DIR}/efi/boot/grub.cfg" | 376 cat <<EOF | sudo dd of="${ESP_DIR}/efi/boot/grub.cfg" |
377 set timeout=2 | 377 set timeout=2 |
378 set default=0 | 378 set default=0 |
379 | 379 |
380 menuentry "serial debug" { | |
381 linux /efi/boot/vmlinuz earlyprintk=serial,ttyS0,115200 i915.modeset=0 console
=ttyS0,115200 acpi=off init=/sbin/init boot=local rootwait root=/dev/sda3 ro nor
esume noswap loglevel=7 | |
382 } | |
383 | |
384 menuentry "normal" { | 380 menuentry "normal" { |
385 linux /efi/boot/vmlinuz quiet console=tty2 init=/sbin/init boot=local rootwait
root=/dev/sda3 ro noresume noswap i915.modeset=1 loglevel=1 | 381 linux /efi/boot/vmlinuz quiet console=tty2 init=/sbin/init boot=local rootwait
root=/dev/sda3 ro noresume noswap i915.modeset=1 loglevel=1 |
386 } | 382 } |
387 | 383 |
| 384 menuentry "serial debug" { |
| 385 linux /efi/boot/vmlinuz earlyprintk=serial,ttyS0,115200 console=ttyS0,115200 i
nit=/sbin/init boot=local rootwait root=/dev/sda3 ro noresume noswap i915.modese
t=1 loglevel=7 |
| 386 } |
| 387 |
388 EOF | 388 EOF |
389 | 389 |
390 # Enable dev mode on the target system and re-run ldconfig | 390 # Enable dev mode on the target system and re-run ldconfig |
391 # for rootfs's ld.so.cache | 391 # for rootfs's ld.so.cache |
392 if [ $FLAGS_statefuldev -eq $FLAGS_TRUE ] ; then | 392 if [ $FLAGS_statefuldev -eq $FLAGS_TRUE ] ; then |
393 # Flag will mount /usr/local on target device | 393 # Flag will mount /usr/local on target device |
394 sudo mkdir -p "$ROOT_FS_DIR/root" | 394 sudo mkdir -p "$ROOT_FS_DIR/root" |
395 sudo touch "$ROOT_FS_DIR/root/.dev_mode" | 395 sudo touch "$ROOT_FS_DIR/root/.dev_mode" |
396 | 396 |
397 # Re-run ldconfig to fix /etc/ldconfig.so.cache | 397 # Re-run ldconfig to fix /etc/ldconfig.so.cache |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
431 | 431 |
432 OUTSIDE_OUTPUT_DIR="../build/images/${FLAGS_board}/${IMAGE_SUBDIR}" | 432 OUTSIDE_OUTPUT_DIR="../build/images/${FLAGS_board}/${IMAGE_SUBDIR}" |
433 echo "Done. Image created in ${OUTPUT_DIR}" | 433 echo "Done. Image created in ${OUTPUT_DIR}" |
434 echo "To copy to USB keyfob, OUTSIDE the chroot, do something like:" | 434 echo "To copy to USB keyfob, OUTSIDE the chroot, do something like:" |
435 echo " ./image_to_usb.sh --from=${OUTSIDE_OUTPUT_DIR} --to=/dev/sdb" | 435 echo " ./image_to_usb.sh --from=${OUTSIDE_OUTPUT_DIR} --to=/dev/sdb" |
436 echo "To convert to VMWare image, OUTSIDE the chroot, do something like:" | 436 echo "To convert to VMWare image, OUTSIDE the chroot, do something like:" |
437 echo " ./image_to_vmware.sh --from=${OUTSIDE_OUTPUT_DIR}" | 437 echo " ./image_to_vmware.sh --from=${OUTSIDE_OUTPUT_DIR}" |
438 echo "from the scripts directory where you entered the chroot." | 438 echo "from the scripts directory where you entered the chroot." |
439 | 439 |
440 trap - EXIT | 440 trap - EXIT |
OLD | NEW |