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.

  1. 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.

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. 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.

  2. Unplug the installation USB drive.

  3. Reboot your machine.

Manual installation

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

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

  1. 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. Run lsblk to confirm the state of the disks:
  1. 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. 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. Install the recovery kernel image. Replace 004 with the ID of the partition on the USB drive labelled zircon-r.
  1. 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. Unplug the installation USB drive.

  2. Reboot your machine.