Create a bootable Fuchsia image

Overview

The mkinstaller script produces a bootable disk image from a build, which can be used to install Fuchsia to a target machine. It supports creating installation images for x64 EFI-based devices (the x64 product configuration), and coreboot-based devices (the chromebook-x64 configuration), depending on what has been built.

Implementation

Mkinstaller can write an image directly to a USB disk, or it can produce a new image file on the host machine, which can then be written to install media using dd or similar. The mkinstaller script determines the images to be written to disk based on ${FUCHSIA_BUILD_DIR}/images.json, and then writes each partition to disk, labelled according to the “name” field of the entry in images.json.

Use the installer

After you complete a build, you can create an installer image with fx mkinstaller /path/to/usb.

Note: To see a full list of options, run fx mkinstaller -h.

Follow the steps below to install Fuchsia:

  1. To access the installer, boot your computer or virtual machine from the USB.

    You should see a blue boot screen.

  2. To access the Fuchsia shell, press alt+tab.

These are the ways you can install Fuchsia:

Automatic installation

  1. Run installer to launch the installer.

    1. installer
    2. Bootloader vendor = Intel Corp.
    3. Please select the disk you want to install Fuchsia to:
    4. [0] /dev/sys/pci/00:17.0/ahci/sata2/block (119G)
    5. Enter a selection (0..0):
    6.  

    You will see a list of disks, along with their sizes.

  1. Type in the number corresponding to the disk you wish to install Fuchsia on, and press ENTER.

    Note: What you type in won’t be displayed until you press ENTER.

    1. Enter a selection (0..0): 0
    2. Using /dev/sys/pci/00:17.0/ahci/sata2/block as installation target.
    3. WARNING: Installing Fuchsia will WIPE YOUR DISK. Make sure you've backed
    4. everything up before proceeding!
    5. Do you wish to proceed? (yes/[no])
    6.  
  2. Confirm that you want to continue. The installer will wipe your disk, set up the Fuchsia partition tables, and install Fuchsia to your disk. The installer will show its progress as it installs, and exit once the installation is complete.

    1. Do you wish to proceed? (yes/[no]) yes
    2. Wiping old partition tables...
    3. Initializing Fuchsia partition tables...
    4. Success.
    5. Partition[src=/dev/sys/pci/00:14.0/xhci/usb-bus/001/001/ifc-000/ums/lun-000/block/part-002/block, pave_type=Bootloader]... OK
    6. Partition[src=/dev/sys/pci/00:14.0/xhci/usb-bus/001/001/ifc-000/ums/lun-000/block/part-003/block, pave_type=Asset { type: Kernel, config: A }, asset=Kernel, config=A]... OK
    7. Partition[src=/dev/sys/pci/00:14.0/xhci/usb-bus/001/001/ifc-000/ums/lun-000/block/part-003/block, pave_type=Asset { type: Kernel, config: A }, asset=Kernel, config=A] [-B]... OK
    8. Partition[src=/dev/sys/pci/00:14.0/xhci/usb-bus/001/001/ifc-000/ums/lun-000/block/part-004/block, pave_type=Asset { type: Kernel, config: Recovery }, asset=Kernel, config=Recovery]... OK
    9. Partition[src=/dev/sys/pci/00:14.0/xhci/usb-bus/001/001/ifc-000/ums/lun-000/block/part-005/block, pave_type=Volume]... OK
    10.  
  3. Unplug the installation USB drive.

  4. Reboot your machine.

    1. dm reboot

Manual installation

  1. Run lsblk to determine the main disk of the target machine.

    1. lsblk
    2. ID SIZE TYPE LABEL FLAGS DEVICE
    3. 000 28G RE /dev/sys/pci/00:14.0/xhci/usb-bus/001/001/ifc-000/ums/lun-000/block
    4. 001 63M efi-system zedboot-efi RE /dev/sys/pci/00:14.0/xhci/usb-bus/001/001/ifc-000/ums/lun-000/block/part-000/block
    5. 002 1M cros-data efi RE /dev/sys/pci/00:14.0/xhci/usb-bus/001/001/ifc-000/ums/lun-000/block/part-001/block
    6. 003 25M cros-data zircon-a RE /dev/sys/pci/00:14.0/xhci/usb-bus/001/001/ifc-000/ums/lun-000/block/part-002/block
    7. 004 22M cros-data zircon-r RE /dev/sys/pci/00:14.0/xhci/usb-bus/001/001/ifc-000/ums/lun-000/block/part-003/block
    8. 005 321M cros-data storage-sparse RE /dev/sys/pci/00:14.0/xhci/usb-bus/001/001/ifc-000/ums/lun-000/block/part-004/block
    9. 006 119G /dev/sys/pci/00:17.0/ahci/sata2/block
    10.  

    In this case, /dev/sys/pci/00:17.0/ahci/sata2/block is the main disk of the target machine.

  2. Run install-disk-image to wipe and initialize the partition tables on the target machine. Replace /dev/sys/pci/00:17.0/ahci/sata2/block with the path you determined using the lsblk command.

    1. install-disk-image init-partition-tables --block-device /dev/sys/pci/00:17.0/ahci/sata2/block
    2. disk-pave: init-partition-tables operation succeeded.
    3.  
  3. Run lsblk to confirm the state of the disks:

    1. lsblk
    2. ID SIZE TYPE LABEL FLAGS DEVICE
    3. 000 28G RE /dev/sys/pci/00:14.0/xhci/usb-bus/001/001/ifc-000/ums/lun-000/block
    4. 001 63M efi-system zedboot-efi RE /dev/sys/pci/00:14.0/xhci/usb-bus/001/001/ifc-000/ums/lun-000/block/part-000/block
    5. 002 1M cros-data efi RE /dev/sys/pci/00:14.0/xhci/usb-bus/001/001/ifc-000/ums/lun-000/block/part-001/block
    6. 003 25M cros-data zircon-a RE /dev/sys/pci/00:14.0/xhci/usb-bus/001/001/ifc-000/ums/lun-000/block/part-002/block
    7. 004 22M cros-data zircon-r RE /dev/sys/pci/00:14.0/xhci/usb-bus/001/001/ifc-000/ums/lun-000/block/part-003/block
    8. 005 321M cros-data storage-sparse RE /dev/sys/pci/00:14.0/xhci/usb-bus/001/001/ifc-000/ums/lun-000/block/part-004/block
    9. 006 119G /dev/sys/pci/00:17.0/ahci/sata2/block
    10. 052 16M efi-system efi-system /dev/sys/pci/00:17.0/ahci/sata2/block/part-000/block
    11. 053 64M zircon-a zircon-a /dev/sys/pci/00:17.0/ahci/sata2/block/part-001/block
    12. 054 64M zircon-b zircon-b /dev/sys/pci/00:17.0/ahci/sata2/block/part-002/block
    13. 055 96M zircon-r zircon-r /dev/sys/pci/00:17.0/ahci/sata2/block/part-003/block
    14. 056 64K vbmeta_a vbmeta_a /dev/sys/pci/00:17.0/ahci/sata2/block/part-004/block
    15. 057 64K vbmeta_b vbmeta_b /dev/sys/pci/00:17.0/ahci/sata2/block/part-005/block
    16. 058 64K vbmeta_r vbmeta_r /dev/sys/pci/00:17.0/ahci/sata2/block/part-006/block
    17. 059 4K misc misc /dev/sys/pci/00:17.0/ahci/sata2/block/part-007/block
    18. 060 16G fuchsia-fvm fuchsia-fvm /dev/sys/pci/00:17.0/ahci/sata2/block/part-008/block
    19.  
  4. Install the ESP to the disk. Note that the “ID” column in lsblk corresponds to a file in /dev/class/block/. You should replace 002 with the ID of the partition that’s labelled efi, and 052 with the ID of the partition that’s labelled efi-system.

  1. dd if=/dev/class/block/002 of=/dev/class/block/052
  2. 2194+0 records in
  3. 2194+0 records out
  4. 1123328 bytes copied
  1. Install the main kernel image. Replace 003 with the ID of the partition on the USB drive labelled zircon-a.

    Note: A limitation in the block device protocol means we need to dd to an intermediary file before using install-disk-image.

    1. dd if=/dev/class/block/003 of=/tmp/tmp.img
    2. 52520+0 records in
    3. 52520+0 records out
    4. 26890240 bytes copied
    5.  
    6. install-disk-image install-zircona --file /tmp/tmp.img
    7. disk-pave: install-zircona operation succeeded.
    8.  
  2. Install the recovery kernel image. Replace 004 with the ID of the partition on the USB drive labelled zircon-r.

    1. dd if=/dev/class/block/004 of=/tmp/tmp.img
    2. 52520+0 records in
    3. 52520+0 records out
    4. 26890240 bytes copied
    5. install-disk-image install-zirconr --file /tmp/tmp.img
    6. disk-pave: install-zirconr operation succeeded.
  3. Install the Fuchsia volume image. Replace 005 with the ID of the partition on the USB drive labelled storage-sparse.

    Note: this image is much bigger than any of the others - this step may take a while!

    1. dd if=/dev/class/block/005 of=/tmp/tmp.img
    2. 658432+0 records in
    3. 658432+0 records out
    4. 337117184 bytes copied
    5.  
    6. install-disk-image install-fvm --file /tmp/tmp.img
    7. disk-pave: install-fvm operation succeeded.
    8.  
  4. Unplug the installation USB drive.

  5. Reboot your machine.

    1. dm reboot