Snappy Core Image Build Process

Description and steps required to produce the snappy core image.

Triggering a new build

Currently the cdimage server is the machine responsible for triggering a new build for the core rootfs. The build is part of the cdimage cronjob, and currently built with the following parameters:

SUBPROJECT=system-image EXTRA_PPAS=snappy-dev/image for-project ubuntu-core cron.daily-preinstalled --live

Once the build is triggered by cdimage, it calls launchpad to execute the livecd-rootfs code. You can find more about this logic at

livecd-rootfs build jobs

The build jobs for live-cdrootfs are currently part of launchpad, and you can find the logs for ubuntu-core (vivid) at

Example of a build log:

At this stage the livecd-rootfs code that will be executed is the one provided by the livecd-rootfs source package (for the same series). For vivid we have package changes that are not available in the archive, so you might find more information at the livecd-rootfs src package available at

For the hooks and changes required for ubuntu-core, please also check

cdimage rootfs output

Once built, there is also a small logic in cdimage ( to publish the resulted files.

The artifacts are published at the public cdimage server, and for ubuntu-core you can find them at

System Image import

The plain rootfs that gets built as a result of livecd-rootfs doesn't yet contain all the required files for a working snappy core rootfs. This extra logic gets added once the rootfs tarball gets imported by the system-image server code, making it available at the public system-image instance at

You can find out more details about the system-image specific customizations at (look for if options.get("product", "touch") == "core" for ubuntu-core specific changes).

Building the final image

After the image is finally built and imported by cdimage, you can just call ubuntu-device-flash to generate the final image for your target.

For x86/KVM:

$ sudo ubuntu-device-flash core 15.04 --channel edge --output x86.img
Determining oem configuration
Starting download of generic-amd64
40.93 KB / 40.93 KB [===] 100.00 % 97.50 KB/s 
Fetching information from server...
Downloading and setting up...
41.86 MB / 41.86 MB [===] 100.00 % 1.69 MB/s 
95.74 MB / 95.74 MB [===] 100.00 % 1.35 MB/s 
Installing generic-amd64
Starting download of generic-amd64
40.93 KB / 40.93 KB [===] 100.00 % 46.92 KB/s 
New image complete
 Output: x86.img
 Architecture: amd64
 Channel: edge
 Version: 57
Launch by running: kvm -m 768 x86.img

Steps required to locally reproduce the above steps

  1. Find the right arguments/scripts required to run livecd-rootfs by hand (if you don't have access to launchpad)
  2. Reproduce the system-image server modifications locally
  3. Add an option to ubuntu-device-flash to support flashing a custom rootfs

Snappy/CoreImageBuild (last edited 2015-05-11 23:40:42 by rsalveti)