dpkg_deploy plugin

Dpkg deployment element

A ScriptElement implementation for creating debian packages

Default Configuration

The dpkg_deploy default configuration:
#dpkg_deploy default configuration

variables:
  # packages' default value will be automatically replaced with
  # defaultscalculated from the input's split-rules. Replace this
  # with a space-separated list of packages to have more control
  # over what gets generated.
  #
  packages: <PACKAGES>
  buildpkg: |
            for package in %{packages}; do
              /bin/chmod 0755 %{build-root}/$package/DEBIAN
              dpkg-deb --build %{build-root}/$package %{install-root}
            done

config:
  # The element that should be staged into "/". It must contain
  # all the tools required to generate the image
  # base: image-tools.bst

  # The element that should be staged into %{build-root}. It is
  # expected to be the system that you're planning to turn into
  # an image.
  # input: foo-system.bst

  build-commands:
  - |
    %{buildpkg}

Public Data

This plugin uses the public data of the element indicated by config.input to generate debian packages.

split-rules

This plugin consumes the input element’s split-rules to identify which file goes in which package, e.g.

public:
  bst:
    split-rules:
      foo:
      - /sbin/foo
      - /usr/bin/bar
      bar:
      - /etc/quux

dpkg-data

control

The control field is used to generate the control file for each package, e.g.

public:
  bst:
    dpkg-data:
      foo:
        control: |
          Source: foo
          Section: blah
          Build-depends: bar (>= 1337), baz
          ...

name

If the “name” field is present, the generated package will use that field to determine its name. If “name” is not present, the generated package will be named <element_name>-<package_name>

i.e. in an element named foo:

public:
  bst:
    dpkg-data:
      bar:
        name: foobar

will be named “foobar”, while the following data:

public:
  bst:
    dpkg-data:
      bar:
        ...

will create a package named “foo-bar”

package-scripts

preinst, postinst, prerm and postrm scripts will be generated based on data in pacakge-scripts, if it exists. The scripts are formatted as raw text, e.g.

public:
  bst:
    package-scripts:
      foo:
        preinst: |
          #!/usr/bin/bash
          /sbin/ldconfig
      bar:
        postinst: |
          #!/usr/bin/bash
          /usr/share/fonts/generate_fonts.sh