diskimage-builder/elements/package-installs
Gregory Haynes d1e32f80a6 Run package-intalls with py3k if we must
Use dib-python to run package-installs using the provided python
version. Automatically detect the python version for our
package-installs-squash since that runs outside the chroot.

Change-Id: I926022bcf8cbcd81b051026ffd5d6477650045ad
2016-01-04 23:37:30 +00:00
..
bin Run package-intalls with py3k if we must 2016-01-04 23:37:30 +00:00
extra-data.d Run package-intalls with py3k if we must 2016-01-04 23:37:30 +00:00
install.d Update packages earlier 2015-04-13 21:50:10 +00:00
post-install.d Standarise tracing for scripts 2015-02-12 10:41:32 +11:00
pre-install.d Standarise tracing for scripts 2015-02-12 10:41:32 +11:00
element-deps Run package-intalls with py3k if we must 2016-01-04 23:37:30 +00:00
README.rst Support arch-specific package-installs 2015-04-24 21:58:05 +00:00

================
package-installs
================

The package-installs element allows for a declarative method of installing and
uninstalling packages for an image build. This is done by creating a
package-installs.yaml or package-installs.json file in the element directory.


example package-installs.yaml::

 libxml2:
 grub2:
   phase: pre-install.d
 networkmanager:
   uninstall: True
 os-collect-config:
   installtype: source
 linux-image-amd64:
   arch: amd64

example package-installs.json::

    {
    "libxml2": null,
    "grub2": {"phase": "pre-install.d"},
    "networkmanager": {"uninstall": true}
    "os-collect-config": {"installtype": "source"}
    }


Setting phase, uninstall, or installtype properties for a package overrides
the following default values::

    phase: install.d
    uninstall: False
    installtype: * (Install package for all installtypes)
    arch: * (Install package for all architectures)

Setting the installtype property causes the package only to be installed if
the specified installtype would be used for the element. See the
diskimage-builder docs for more information on installtypes.

Setting the arch property causes the package only to be installed for the
specified target architecture. See documentation about the ARCH variable
for more information.

DEPRECATED: Adding a file under your elements pre-install.d, install.d, or
post-install.d directories called package-installs-<element-name> will cause
the list of packages in that file to be installed at the beginning of the
respective phase.  If the package name in the file starts with a "-", then
that package will be removed at the end of the install.d phase.