imagedefinition

package
v0.0.0-...-2202fe9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 30, 2024 License: GPL-3.0 Imports: 4 Imported by: 0

README

================
Image Definition
================

The image definition is a YAML file that is consumed by ``ubuntu-image``
that specifies how to build a classic image.

The following specification defines what is supported in the YAML:

.. code:: yaml

    # The name of the image.
    name: <string>
    # The human readable name to use in the image.
    display-name: <string>
    # An integer used to track changes to the image definition file.
    revision: <int> (optional)
    # The architecture of the image to create.
    architecture: amd64 | armhf | arm64 | s390x | ppc64el | riscv64
    # The Ubuntu codename to use as apt sources. Example: jammy
    series: <string>
    # The classification for this image.
    class: cloud | installer | preinstalled
    # An alternative kernel to install in the image. Normally this
    # is just one kernel and defaults to "linux", but we support
    # installing more than one, since installer images can provide
    # multiple kernels to choose from.
    kernel: <string> (optional)
    # gadget defines the boot assets of an image. When building a
    # classic image, the gadget is optionally compiled as part of
    # the state machine run.
    gadget: (optional)
      # An URI pointing to the location of the gadget tree. For
      # gadgets that need to be built this can be a local path
      # to a directory or a URL to be git cloned. These gadget
      # tree builds will automatically have the environment
      # variables ARCH=<architecture> and SERIES=<series>.
      # The values for these environment variables are sourced
      # from this image definition file. For pre-built
      # gadget trees this must be a local path.
      # The URI must begin with either http://, https://, or file://
      url: <string>
      # The type of gadget tree source. Currently supported values
      # are git, directory, and prebuilt. When git is used the url
      # will be cloned and `make` will be run. When directory is
      # used, ubuntu-image will change directories into the specified
      # URL and run `make`. When prebuilt is used, the contents of the
      # URL are simply copied to the gadget directory.
      type: git | directory | prebuilt
      # A git reference to use if building a gadget tree from git.
      ref: <string> (optional)
      # The branch to use if building a gadget tree from git.
      # Defaults to "main"
      branch: <string> (optional)
      # The target to build when running "make". If none is specified
      # make will be called with no target. This key/value pair has
      # no effect when the gadget.type is "prebuilt"
      target: <string> (optional)
    # A path to a model assertion to use when pre-seeding snaps
    # in the image. Must be a local file URI beginning with file://
    # The given path will be interpreted as relative to the path of
    # the image definition file if is not absolute.
    model-assertion: <string> (optional)
    # Defines parameters needed to build the rootfs for a classic
    # image. Currently only building from a seed is supported.
    # Exactly one of the following must be included: seed,
    # archive-tasks, or tarball.
    rootfs:
      # Components are a list of apt sources, such as main,
      # universe, and restricted. Defaults to "main,restricted".
      components: (optional)
        - <string>
        - <string>
      # The archive to use as an apt source. Defaults to "ubuntu".
      archive: <string> (optional)
      # The flavor of Ubuntu to build. Examples: kubuntu, xubuntu.
      # Defaults to "ubuntu".
      flavor: <string> (optional)
      # The mirror for apt sources.
      # Defaults to "http://archive.ubuntu.com/ubuntu/".
      mirror: <string> (optional)
      # Ubuntu offers several pockets, which often imply the
      # inclusion of other pockets. The release pocket only
      # includes itself. The security pocket includes itself
      # and the release pocket. Updates includes updates,
      # security, and release. Proposed includes all pockets.
      # Defaults to "release".
      pocket: release | security | updates | proposed (optional)
      # Used for building an image from a set of archive tasks
      # rather than seeds. Not yet supported.
      archive-tasks: (exactly 1 of archive-tasks, seed or tarball must be specified)
        - <string>
        - <string>
      # The seed to germinate from to create a list of packages
      # to be installed in the image.
      seed: (exactly 1 of archive-tasks, seed or tarball must be specified)
        # A list of git, bzr, or http locations from which to
        # retrieve the seeds. Must be a web address, local file paths
        # are not supported
        urls: (required if seed dict is specified)
          - <string>
          - <string>
        # The names of seeds to use from the germinate output.
        # Examples: server, minimal, cloud-image.
        names: (required if seed dict is specified)
          - <string>
          - <string>
        # Whether to use the --vcs flag when running germinate.
        # Defaults to "true".
        vcs: <boolean> (optional)
        # An alternative branch to use while retrieving seeds
        # from a git or bzr source.
        branch: <string> (optional)
      # Whether to write the sources list as Deb822 formatted entries in 
      # /etc/apt/sources.list.d/ubuntu.sources or not (and thus use the legacy format
      # in /etc/apt/sources.list)
      # Default to "false" for now to not break existing builds but a warning will be
      # displayed and this default will switch at some point in the future.
      # A warning is also displayed if no value was explicitely set for this field.
      sources-list-deb822: <boolean> (optional)
      # Used for pre-built root filesystems rather than germinating
      # from a seed or using a list of archive-tasks. Must be an
      # an uncompressed tar archive or a tar archive with one of the
      # following compression types: bzip2, gzip, xz, zstd.
      tarball: (exactly 1 of archive-tasks, seed or tarball must be specified)
        # The path to the tarball. Currently only local paths beginning with
        # file:// are supported. The given path will be interpreted as relative
        # to the path of the image definition file if is not absolute.
        url: <string> (required if tarball dict is specified)
        # URL to the gpg signature to verify the tarball against.
        gpg: <string> (optional)
        # SHA256 sum of the tarball used to verify it has not
        # been altered.
        sha256sum: <string> (optional)
    # ubuntu-image supports building automatically with some
    # customizations to the image. Note that if customization
    # is specified, at least one of the subkeys should be used
    # This is only supported for classic image building 
    customization: (optional)
      # Components are a list of apt sources, such as main,
      # universe, and restricted. Defaults to "main, restricted, universe".
      # These are used in the resulting img, not to build it.
      components: (optional)
        - <string>
        - <string>
      # Ubuntu offers several pockets, which often imply the
      # inclusion of other pockets. The release pocket only
      # includes itself. The security pocket includes itself
      # and the release pocket. Updates includes updates,
      # security, and release. Proposed includes all pockets.
      # Defaults to "release".
      # This value is in the resulting img, not to build it.
      pocket: release | security | updates | proposed (optional)
      # Used only for installer images
      installer: (optional)
        preseeds: (optional)
          - <string>
          - <string>
        # Only applicable to subiquity based layered images.
        layers: (optional)
          - <string>
          - <string>
      # Used to create a custom cloud-init configuration.
      # Given configuration should be fully valid cloud-init configuration
      # (including file header) 
      cloud-init: (optional)
        # cloud-init yaml metadata
        meta-data: <yaml as a string> (optional)
        # cloud-init yaml metadata
        user-data: <yaml as a string> (optional)
        # cloud-init yaml metadata
        network-config: <yaml as a string> (optional)
      # Extra PPAs to install in the image. Both public and
      # private PPAs are supported. If specifying a private
      # PPA, the auth and fingerprint fields are required.
      # For public PPAs, auth has no effect and fingerprint
      # is optional. These PPAs will be used as a source
      # while creating the rootfs for the classic image.
      extra-ppas: (optional)
        -
          # The name of the PPA in the format "user/ppa-name".
          name: <string>
          # The fingerprint of the GPG signing key for this
          # PPA. Public PPAs have this information available
          # from the Launchpad API, so it can be retrieved
          # automatically. For Private PPAs this must be
          # specified.
          fingerprint: <string> (optional for public PPAs)
          # Authentication for private PPAs in the format
          # "user:password".
          auth: <string> (optional for public PPAs)
          # Whether to leave the PPA source file in the resulting
          # image. Defaults to "true". If set to "false" this
          # PPA will only be used as a source for installing
          # packages during the rootfs build process, and the
          # resulting image will not have this PPA configured.
          keep-enabled: <boolean>
      # A list of extra packages to install in the rootfs beyond
      # what is included in the germinate output.
      extra-packages: (optional)
        -
          name: <string>
      # Extra snaps to preseed in the rootfs of the image.
      extra-snaps: (optional)
        -
          # The name of the snap.
          name: <string>
          # The channel from which to seed the snap.
          # If both the revision and channel are provided
          # the snap revision specified will be installed
          # and updates will come from the channel specified
          channel: <string> (optional)
          # The store to retrieve the snap from. Not yet supported.
          # Defaults to "canonical".
          store: <string> (optional)
          # The revision of the snap to preseed in the rootfs.
          # If both the revision and channel are provided
          # the snap revision specified will be installed
          # and updates will come from the channel specified
          revision: <int> (optional)
      # After the rootfs has been created and before the image
      # artifacts are generated, ubuntu-image can automatically
      # perform some manual customization to the rootfs.
      manual: (optional)
        # Create directories in the rootfs of the image
        make-dirs: (optional)
          -
            # The path to the directory to create
            # Every intermediate directories missing on the path
            # will be created.
            path: <string>
            # Permissions to give to the directory and any missing
            # intermediate directories.
            permissions: <uint32>
        # Copies files from the host system to the rootfs of
        # the image.
        copy-file: (optional)
          -
            # The path to the file to copy.
            # The given path will be interpreted as relative to the
            # path of the image definition file if is not absolute.
            source: <string>
            # The path to use as a destination for the copied
            # file. The location of the rootfs will be prepended
            # to this path automatically.
            destination: <string>
        # Creates empty files in the rootfs of the image.
        touch-file: (optional)
          -
            # The location of the rootfs will be prepended to this
            # path automatically.
            path: <string>
        # Chroots into the rootfs and executes an executable file.
        # This customization state is run after the copy-files state,
        # so files that have been copied into the rootfs are valid
        # targets to be executed.
        execute: (optional)
          -
            # Path inside the rootfs.
            path: <string>
        # Any additional users to add in the rootfs
        # We recommend using cloud-init when possible and fallback
        # on this method if not possible (e.g performance issues)
        add-user: (optional)
          -
            # The name for the user
            name: <string>
            # The UID to assing to this new user
            id: <string> (optional)
            # Password. This can be a plain text or a hashed value.
            # This password will immediately expire and force the user to 
            # renew it at first login.
            password: <string> (optional)
            # Type of password submitted above. Defaults to "hash" 
            password-type: text | hash (optional)
        add-group: (optional)
          -
            # The name of the group to create.
            name: <string>
            # The GID to assign to this group.
            gid: <string> (optional)
      # Set a custom fstab. The existing one (if any) will be truncated.
      fstab: (optional)
        -
          # the value of LABEL= for the fstab entry
          label: <string>
          # where to mount the partition
          mountpoint: <string>
          # the filesystem type
          filesystem-type: <string>
          # options for mounting the filesystem
          mount-options: <string> (optional)
          # whether or not to dump the filesystem
          dump: <bool> (optional)
          # the order to fsck the filesystem
          fsck-order: <int>
    # Define the types of artifacts to create, including the actual images,
    # manifest files, changelogs, and a list of files in the rootfs.
    # If this is not set, only the rootfs will be created.
    artifacts: (optional)
      # Used to specify that ubuntu-image should create a .img file.
      img: (optional)
        -
          # Name to output the .img file.
          name: <string>
          # Volume from the gadget from which to create the image
          volume: <string> (optional for single volume gadgets,
                            required for multi-volume gadgets)
      # Used to specify that ubuntu-image should create a .iso file.
      # Not yet supported.
      iso: (optional)
        -
          # Name to output the .iso file.
          name: <string>
          # Volume from the gadget from which to create the image
          volume: <string> (optional for single volume gadgets,
                            required for multi-volume gadgets)
          # Specify parameters to use when calling `xorriso`. When not
          # provided, ubuntu-image will attempt to create it's own
          # `xorriso` command.
          xorriso-command: <string> (optional)
      # Used to specify that ubuntu-image should create a .qcow2 file.
      # If a .img file is specified for the corresponding volume, the
      # existing .img will be re-used and converted into a qcow2 image.
      # Otherwise, a new raw image will be created and then converted
      # to qcow2.
      qcow2: (optional)
        -
          # Name to output the .qcow2 file.
          name: <string>
          # Volume from the gadget from which to create the image
          volume: <string> (optional for single volume gadgets,
                            required for multi-volume gadgets)
      # A manifest file is a list of all packages and their version
      # numbers that are included in the rootfs of the image.
      manifest:
        # Name to output the manifest file.
        name: <string>
      # A filelist is a list of all files in the rootfs of the image.
      filelist:
        # Name to output the filelist file.
        name: <string>
      # Not yet supported.
      changelog:
        name: <string>
      # A tarball of the rootfs that has been built by ubuntu-image.
      rootfs-tarball:
        # Name to output the tar archive.
        name: <string>
        # Type of compression to use on the tar archive. Defaults
        # to "uncompressed"
        compression: uncompressed (default) | bzip2 | gzip | xz | zstd (optional)

The following sections detail the top-level keys within this definition,
followed by several examples.


name
====

This mandatory meta-data field is not yet used, but must not be blank.
Any characters are permitted, of any (non-zero) length. For example:

.. code:: yaml

    name: ubuntu-server-raspi


display-name
============

This mandatory meta-data field is not yet used, but must not be blank.
Any characters are permitted, of any (non-zero) length. For example:

.. code:: yaml

    display-name: Ubuntu Server for Raspberry Pi


revision
========

This optional meta-data field is not yet used. If specified, it must
be an integer number.


architecture
============

This mandatory field specifies the architecture of the image to be created. It
must be one of the following valid strings:

* amd64
* armhf
* arm64
* s390x
* ppc64el
* riscv64

For example:

.. code:: yaml

    architecture: arm64


series
======

This mandatory field specifies the Ubuntu release name as it should appear in
apt sources. For example, to produce an image for the 20.04 release, this
should be "focal". Example values include:

* bionic
* focal
* jammy
* kinetic

Please consult the `Releases <https://wiki.ubuntu.com/Releases>`_ page for
currently valid release names, but bear in mind that release names must be
specified as they would appear in apt sources, i.e. lower-cased with no numeric
part and no "LTS" suffix.

For example:

.. code:: yaml

    series: jammy


class
=====

This mandatory field specifies the image classification. It is currently
unused, and must be set to the string "preinstalled". In future, the set of
valid strings is intended to be:

* preinstalled
* installer
* cloud

For example:

.. code:: yaml

    class: preinstalled


kernel
======

This optional key specifies an additional kernel to include in the image. If
specified, the value should be a string that represents the name of the
kernel package to be installed.

.. code:: yaml

    kernel: linux-image-generic


gadget
======

This optional field specifies from where the gadget tree will be sourced.
Support is included for prebuilt gadgets, building gadgets from a local
directory, or building gadgets from a git repository. If gadget is not
included in the image definition, but some disk output (img, qcow2, iso)
is included, an error will occur. Gadget should only be excluded if the
only artifact that you will be creating is a rootfs tarball.

Examples
========

Note that not all of these fields are required. An example used to build
Raspberry Pi images is:

.. code:: yaml

  name: ubuntu-server-raspi-arm64
  display-name: Ubuntu Server Raspberry Pi arm64
  revision: 2
  architecture: arm64
  series: noble
  class: preinstalled
  kernel: linux-image-raspi
  gadget:
    url: "https://git.launchpad.net/snap-pi"
    branch: "classic"
    type: "git"
  rootfs:
    archive: ubuntu
    sources-list-deb822: true
    components:
      - main
      - restricted
      - universe
      - multiverse
    mirror: "http://ports.ubuntu.com/ubuntu-ports/"
    pocket: updates
    seed:
      urls:
        - "git://git.launchpad.net/~ubuntu-core-dev/ubuntu-seeds/+git/"
      branch: noble
      names:
        - server
        - server-raspi
        - raspi-common
        - minimal
        - standard
        - cloud-image
        - supported-raspi-common
  customization:
    cloud-init:
      user-data: |
        #cloud-config
        name: ubuntu
        password: ubuntu
    extra-snaps:
      - name: snapd
    fstab:
      - label: "writable"
        mountpoint: "/"
        filesystem-type: "ext4"
        dump: false
        fsck-order: 1
      - label: "system-boot"
        mountpoint: "/boot/firmware"
        filesystem-type: "vfat"
        mount-options: "defaults"
        dump: false
        fsck-order: 1
  artifacts:
    img:
      - name: ubuntu-24.04-preinstalled-server-arm64+raspi.img
    manifest:
      name: ubuntu-24.04-preinstalled-server-arm64+raspi.manifest

Documentation

Overview

Package imagedefinition provides the structure for the image definition that will be parsed from a YAML file.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrKeepEnabledNil = errors.New("KeepEnabled is nil. Thi value cannot be properly used.")
)
View Source
var LegacySourcesListComment = `` /* 270-byte string literal not displayed */

Functions

This section is empty.

Types

type AddGroup

type AddGroup struct {
	GroupName string `yaml:"name" json:"GroupName"`
	GroupID   string `yaml:"id"   json:"GroupID,omitempty"`
}

AddGroup allows users to add a group in the image that is being built

type AddUser

type AddUser struct {
	UserName     string `yaml:"name"          json:"UserName"`
	UserID       string `yaml:"id"            json:"UserID,omitempty"`
	Password     string `yaml:"password"      json:"Password,omitempty"`
	PasswordType string `yaml:"password-type" json:"PasswordType"        default:"hash" jsonschema:"enum=text,enum=hash"`
}

AddUser allows users to add a user in the image that is being built

type Artifact

type Artifact struct {
	Img       *[]Img     `yaml:"img"            json:"Img,omitempty"       is_disk:"true"`
	Iso       *[]Iso     `yaml:"iso"            json:"Iso,omitempty"       is_disk:"true"`
	Qcow2     *[]Qcow2   `yaml:"qcow2"          json:"Qcow2,omitempty"     is_disk:"true"`
	Manifest  *Manifest  `yaml:"manifest"       json:"Manifest,omitempty"  is_disk:"false"`
	Filelist  *Filelist  `yaml:"filelist"       json:"Filelist,omitempty"  is_disk:"false"`
	Changelog *Changelog `yaml:"changelog"      json:"Changelog,omitempty" is_disk:"false"`
	RootfsTar *RootfsTar `yaml:"rootfs-tarball" json:"RootfsTar,omitempty" is_disk:"false"`
}

Artifact contains information about the files that are created during and as a result of the image build process

type Changelog

type Changelog struct {
	ChangelogName string `yaml:"name" json:"ChangelogName"`
}

Changelog specifies the name of the changelog file. If left emtpy no changelog file will be created

type CloudInit

type CloudInit struct {
	MetaData      string `yaml:"meta-data"      json:"MetaData,omitempty"`
	UserData      string `yaml:"user-data"      json:"UserData,omitempty"`
	NetworkConfig string `yaml:"network-config" json:"NetworkConfig,omitempty"`
}

CloudInit provides customizations for running cloud-init

type CopyFile

type CopyFile struct {
	Dest   string `yaml:"destination" json:"Dest"`
	Source string `yaml:"source"      json:"Source"`
}

CopyFile allows users to copy files into the rootfs of an image

type Customization

type Customization struct {
	Components    []string   `yaml:"components"     json:"Components,omitempty"   default:"main,restricted,universe"`
	Pocket        string     `` /* 190-byte string literal not displayed */
	Installer     *Installer `yaml:"installer"      json:"Installer,omitempty"`
	CloudInit     *CloudInit `yaml:"cloud-init"     json:"CloudInit,omitempty"`
	ExtraPPAs     []*PPA     `yaml:"extra-ppas"     json:"ExtraPPAs,omitempty"`
	ExtraPackages []*Package `yaml:"extra-packages" json:"ExtraPackages,omitempty"`
	ExtraSnaps    []*Snap    `yaml:"extra-snaps"    json:"ExtraSnaps,omitempty"`
	Fstab         []*Fstab   `yaml:"fstab"          json:"Fstab,omitempty"`
	Manual        *Manual    `yaml:"manual"         json:"Manual,omitempty"`
}

Customization defines the customization section of the image definition file.

type DependentKeyError

type DependentKeyError struct {
	gojsonschema.ResultErrorFields
}

DependentKeyError implements gojsonschema.ErrorType. It is used for custom errors for keys that depend on other keys being specified

func NewDependentKeyError

func NewDependentKeyError(context *gojsonschema.JsonContext, value interface{}, details gojsonschema.ErrorDetails) *DependentKeyError

NewDependentKeyError fails the image definition parsing when one field depends on another being specified

type Execute

type Execute struct {
	ExecutePath string `yaml:"path" json:"ExecutePath"`
}

Execute allows users to execute a script in the rootfs of an image

type Filelist

type Filelist struct {
	FilelistName string `yaml:"name" json:"FilelistName"`
}

Filelist specifies the name of the filelist file. If left emtpy no filelist file will be created

type Fstab

type Fstab struct {
	Label        string `yaml:"label"           json:"Label"`
	Mountpoint   string `yaml:"mountpoint"      json:"Mountpoint"`
	FSType       string `yaml:"filesystem-type" json:"FSType"`
	MountOptions string `yaml:"mount-options"   json:"MountOptions" default:"defaults"`
	Dump         bool   `yaml:"dump"            json:"Dump,omitempty"`
	FsckOrder    int    `yaml:"fsck-order"      json:"FsckOrder"`
}

Fstab defines the information that gets rendered into an fstab

type Gadget

type Gadget struct {
	Ref          string `yaml:"ref"    json:"Ref,omitempty"`
	GadgetTarget string `yaml:"target" json:"GadgetTarget,omitempty"`
	GadgetBranch string `yaml:"branch" json:"GadgetBranch,omitempty"`
	GadgetType   string `yaml:"type"   json:"GadgetType"             jsonschema:"enum=git,enum=directory,enum=prebuilt"`
	GadgetURL    string `yaml:"url"    json:"GadgetURL,omitempty"    jsonschema:"type=string,format=uri"`
}

Gadget defines the gadget section of the image definition file

type ImageDefinition

type ImageDefinition struct {
	ImageName      string         `yaml:"name"            json:"ImageName"`
	DisplayName    string         `yaml:"display-name"    json:"DisplayName"`
	Revision       int            `yaml:"revision"        json:"Revision,omitempty"`
	Architecture   string         `yaml:"architecture"    json:"Architecture"`
	Series         string         `yaml:"series"          json:"Series"`
	Kernel         string         `yaml:"kernel"          json:"Kernel,omitempty"`
	Gadget         *Gadget        `yaml:"gadget"          json:"Gadget,omitempty"`
	ModelAssertion string         `yaml:"model-assertion" json:"ModelAssertion,omitempty" jsonschema:"type=string,format=uri"`
	Rootfs         *Rootfs        `yaml:"rootfs"          json:"Rootfs"`
	Customization  *Customization `yaml:"customization"   json:"Customization,omitempty"`
	Artifacts      *Artifact      `yaml:"artifacts"       json:"Artifacts,omitempty"`
	Class          string         `yaml:"class"           json:"Class"                    jsonschema:"enum=preinstalled,enum=cloud,enum=installer"`
}

ImageDefinition is the parent struct for the data contained within a classic image definition file

func (*ImageDefinition) Deb822BuildSourcesList

func (i *ImageDefinition) Deb822BuildSourcesList() string

deb822SourcesList returns the content of /etc/apt/sources.list.d/ubuntu.sources to be used during the build process

func (*ImageDefinition) Deb822TargetSourcesList

func (i *ImageDefinition) Deb822TargetSourcesList() string

deb822SourcesList returns the content of /etc/apt/sources.list.d/ubuntu.sources for the target image

func (*ImageDefinition) LegacyBuildSourcesList

func (i *ImageDefinition) LegacyBuildSourcesList() string

LegacyBuildSourcesList returns the content of the /etc/apt/sources.list to be used during the build process

func (*ImageDefinition) LegacyTargetSourcesList

func (i *ImageDefinition) LegacyTargetSourcesList() string

LegacyTargetSourcesList returns the content of the /etc/apt/sources.list for the target image

type Img

type Img struct {
	ImgName   string `yaml:"name"   json:"ImgName"`
	ImgVolume string `yaml:"volume" json:"ImgVolume"`
}

Img specifies the name of the resulting .img file. If left emtpy no .img file will be created

type Installer

type Installer struct {
	Preseeds []string `yaml:"preseeds" json:"Preseeds,omitempty"`
	Layers   []string `yaml:"layers"   json:"Layers,omitempty"`
}

Installer provides customization options specific to installer images

type InvalidPPAError

type InvalidPPAError struct {
	gojsonschema.ResultErrorFields
}

InvalidPPAError implements gojsonschema.ErrorType. It is used for custom errors when a private PPA does not have a fingerprint specified

func NewInvalidPPAError

func NewInvalidPPAError(context *gojsonschema.JsonContext, value interface{}, details gojsonschema.ErrorDetails) *InvalidPPAError

NewInvalidPPAError fails the image definition parsing when a private PPA is configured with no fingerprint

type Iso

type Iso struct {
	IsoName   string `yaml:"name"            json:"IsoName"`
	IsoVolume string `yaml:"volume"          json:"IsoVolume"`
	Command   string `yaml:"xorriso-command" json:"Command,omitempty"`
}

Iso specifies the name of the resulting .iso file and optionally the xorrisofs command used to create it. If left emtpy no .iso file will be created

type MakeDirs

type MakeDirs struct {
	Path        string `yaml:"path" json:"Path"`
	Permissions uint32 `yaml:"permissions"      json:"Permissions" default:"0755"`
}

MakeDirs allows users to copy files into the rootfs of an image

type Manifest

type Manifest struct {
	ManifestName string `yaml:"name" json:"ManifestName"`
}

Manifest specifies the name of the manifest file. If left emtpy no manifest file will be created

type Manual

type Manual struct {
	MakeDirs  []*MakeDirs  `yaml:"make-dirs"  json:"MakeDirs,omitempty"`
	CopyFile  []*CopyFile  `yaml:"copy-file"  json:"CopyFile,omitempty"`
	Execute   []*Execute   `yaml:"execute"    json:"Execute,omitempty"`
	TouchFile []*TouchFile `yaml:"touch-file" json:"TouchFile,omitempty"`
	AddGroup  []*AddGroup  `yaml:"add-group"  json:"AddGroup,omitempty"`
	AddUser   []*AddUser   `yaml:"add-user"   json:"AddUser,omitempty"`
}

Manual provides manual customization options

type MissingURLError

type MissingURLError struct {
	gojsonschema.ResultErrorFields
}

MissingURLError implements gojsonschema.ErrorType. It is used for custom errors for fields that require a url based on the value of other fields based on the values in other fields

func NewMissingURLError

func NewMissingURLError(context *gojsonschema.JsonContext, value interface{}, details gojsonschema.ErrorDetails) *MissingURLError

NewMissingURLError fails the image definition parsing when a dict requires a URL conditionally based on the value of other keys in the dict but does not have one included

type PPA

type PPA struct {
	Name        string `yaml:"name"         json:"PPAName"               jsonschema:"pattern=^[a-zA-Z0-9_.+-]+/[a-zA-Z0-9_.+-]+$"`
	Auth        string `yaml:"auth"         json:"Auth,omitempty"        jsonschema:"pattern=^[a-zA-Z0-9_.+-]+:[a-zA-Z0-9]+$"`
	Fingerprint string `yaml:"fingerprint"  json:"Fingerprint,omitempty"`
	KeepEnabled *bool  `yaml:"keep-enabled" json:"KeepEnabled"           default:"true"`
}

PPA contains information about a public or private PPA

type Package

type Package struct {
	PackageName string `yaml:"name" json:"PackageName"`
}

Package contains information about packages

type PathNotAbsoluteError

type PathNotAbsoluteError struct {
	gojsonschema.ResultErrorFields
}

PathNotAbsoluteError implements gojsonschema.ErrorType. It is used for custom errors for fields that should be absolute but are not

func NewPathNotAbsoluteError

func NewPathNotAbsoluteError(context *gojsonschema.JsonContext, value interface{}, details gojsonschema.ErrorDetails) *PathNotAbsoluteError

NewPathNotAbsoluteError fails the image definition parsing when a relative path is given

type Qcow2

type Qcow2 struct {
	Qcow2Name   string `yaml:"name"   json:"Qcow2Name"`
	Qcow2Volume string `yaml:"volume" json:"Qcow2Volume"`
}

Qcow2 specifies the name of the resulting .qcow2 file If left emtpy no .qcow2 file will be created

type Rootfs

type Rootfs struct {
	Components        []string `yaml:"components"    json:"Components,omitempty"   default:"main,restricted"`
	Archive           string   `yaml:"archive"       json:"Archive"                default:"ubuntu"`
	Flavor            string   `yaml:"flavor"        json:"Flavor"                 default:"ubuntu"`
	Mirror            string   `yaml:"mirror"        json:"Mirror"                 default:"http://archive.ubuntu.com/ubuntu/"`
	Pocket            string   `` /* 189-byte string literal not displayed */
	Seed              *Seed    `yaml:"seed"          json:"Seed,omitempty"         jsonschema:"oneof_required=Seed"`
	Tarball           *Tarball `yaml:"tarball"       json:"Tarball,omitempty"      jsonschema:"oneof_required=Tarball"`
	ArchiveTasks      []string `yaml:"archive-tasks" json:"ArchiveTasks,omitempty" jsonschema:"oneof_required=ArchiveTasks"`
	SourcesListDeb822 *bool    `yaml:"sources-list-deb822" json:"SourcesListDeb822" default:"false"`
}

Rootfs defines the rootfs section of the image definition file

type RootfsTar

type RootfsTar struct {
	RootfsTarName string `yaml:"name"        json:"RootfsTarName"`
	Compression   string `` /* 132-byte string literal not displayed */
}

RootfsTar specifies the name of a tarball to create from the rootfs build steps and the compression to use on it

type Seed

type Seed struct {
	SeedBranch string   `yaml:"branch" json:"SeedBranch,omitempty"`
	SeedURLs   []string `yaml:"urls"   json:"SeedURLs"             jsonschema:"type=array,format=uri"`
	Names      []string `yaml:"names"  json:"Names"`
	Vcs        *bool    `yaml:"vcs"    json:"Vcs"                  default:"true"`
}

Seed defines the seed section of rootfs, which is used to build a rootfs via seed germination

type Snap

type Snap struct {
	SnapName     string `yaml:"name"     json:"SnapName"`
	SnapRevision int    `yaml:"revision" json:"SnapRevision,omitempty" jsonschema:"type=integer"`
	Store        string `yaml:"store"    json:"Store"                  default:"canonical"`
	Channel      string `yaml:"channel"  json:"Channel"                default:"stable"`
}

Snap contains information about snaps

type Tarball

type Tarball struct {
	TarballURL string `yaml:"url"       json:"TarballURL"          jsonschema:"type=string,format=uri"`
	GPG        string `yaml:"gpg"       json:"GPG,omitempty"       jsonschema:"type=string,format=uri"`
	SHA256sum  string `yaml:"sha256sum" json:"SHA256sum,omitempty" jsonschema:"minLength=64,maxLength=64"`
}

Tarball defines the tarball section of rootfs, which is used to create images from a pre-built rootfs

type TouchFile

type TouchFile struct {
	TouchPath string `yaml:"path" json:"TouchPath"`
}

TouchFile allows users to touch a file in the rootfs of an image

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL