Skip to content

Latest commit

 

History

History
139 lines (99 loc) · 4.96 KB

eve-images.md

File metadata and controls

139 lines (99 loc) · 4.96 KB

EVE Images

In order to launch an EVE instance, a base EVE disk image is required. Eden takes care of retrieving the disk image and launching EVE for you. However, you may want to customize it. For example, you may want to use a different version of the official distribution, you may want to use a different version, you may want to use a different disk image entirely.

This is especially useful as part of the EVE development lifecycle.

Retrieving disk images almost always is performed as part of eden setup. The actual launching of an image is part of eden start.

Where Eden normally gets EVE

The normal EVE flow for eden setup is as follows.

  1. If you do not have a context, get the latest tag for the image lfedge/eve from the docker hub, e.g. 0.0.51, and save that tag in your context
  2. Pull the image lfedge/eve:<tag>
  3. Generate a config directory (inside $PWD/dist/<name>-certs/, where <name> the current context name) with:
    • server certificate for adam
    • server file pointing to the local running adam address
    • device certificate
  4. Run the docker image with the config partition mounted to:
    1. Generate a disk image - raw for RPi, qcow2 for everything else - overriding the config partition with the mounted config directory
    2. Extract the disk image from the docker image, e.g. live.qcow2
  5. Save the extracted disk image to a local cache, normally $PWD/dist/<name>-images/eve/ (where <name> is the current context name).

You now have a disk image, e.g. live.qcow2 ready to run, with the appropriate embedded config partition.

To Run a Custom EVE Image

If you want to run your own custom EVE image, you have two options: generate a docker container with your live image, or just run your live image.

Docker Container

The advantage of the docker container, is that it contains the utility to generate the appropriate format of image combined with the correct config partition. You will not have to do any work to get the config partition "just right" in your image.

To generate the docker container with your image:

  1. Work in the github.com/lf-edge/eve directory
  2. Configure your code as desired
  3. Run make eve, optionally setting the desired hypervisor, e.g. make eve HV=kvm (recommended with eden)

Note: If you build EVE with xen hypervisor (make eve), you should run eden config set default --key eve.hv --value xen before eden setup.

When done, you will be provided with output telling you the docker image name and tag, e.g.

Successfully built a46458b4ce1a
Successfully tagged lfedge/eve:0.0.0-testbranch-b6a6d6fd-kvm-amd64
Tagging lfedge/eve:0.0.0-testbranch-b6a6d6fd-kvm-amd64 as lfedge/eve:0.0.0-testbranch-b6a6d6fd-kvm

Now, run eden setup, but tell eden to use the provided image:

eden setup --eve-tag <tag>

Continuing the above example:

eden setup --eve-tag 0.0.0-testbranch-b6a6d6fd

Or you can save it, by setting it in the file:

eden config set default --key eve.tag --value 0.0.0-testbranch-b6a6d6fd
eden setup

eden now will use the above container image to generate and configure the live disk image.

Changing UEFI

eden uses separate tags for eve and eve-uefi. This means that you can set the tag just for eve, while it will continue to use the default for eve-uefi. This helps with a development cycle where you are changing eve, but do not want to make changes to or rebuild eve-uefi.

On the other hand, you can make changes to eve-uefi, in addition to or independent of eve.

To run eden setup to use just a specific eve-uefi image, or both eve and eve-uefi:

eden setup --eve-uefi-tag <uefi-tag>
eden setup --eve-tag <tag> --eve-uefi-tag <uefi-tag>

Continuing the above example:

eden setup --eve-uefi-tag eve-uefi-special
eden setup --eve-tag 0.0.0-testbranch-b6a6d6fd --eve-uefi-tag eve-uefi-special

Or you can save it, by setting it in the file:

eden config set default --key eve.uefi-tag --value eve-uefi-special
eden setup

Live Image

To generate the live image:

  1. eden setup as normal
  2. Switch to the github.com/lf-edge/eve directory
  3. Configure your code as desired
  4. Run make live, optionally setting the desired hypervisor, e.g. make live HV=kvm (recommended with eden). When building you must include the config directory generated by eden setup by adding make live CONF_DIR=<eden-conf-dir>

When done, you have a live image file to be used, normally in dist/<arch>/<file>, e.g. dist/amd64/live.qcow2.

To launch eden using the provided image:

  1. eden start --image-file=path/to/your/live-image

Overwrite config of EVE

You can add files into config partition of EVE (along with the files that are generated by EdenEden) by copying them into eve-config-dir directory. You can select another directory you want with --eve-config-dir flag of eden setup command. To read more about config files please see EVE configuration readme.