diskimage-builder/elements/package-installs
Pino Toscano 7f410aaff2 package-installs: work with Python < 2.7
subprocess.check_output() has been introduced in Python 2.7, so the
script will fail when trying to install stuff in guests with Python 2.6
and older (like RHEL 6 / CentOS 6, for example).

Thus gracefully fallback to subprocess.Popen() when
subprocess.check_output() is not available.

Change-Id: I335148397932177810f095a942b993b249991107
Closes-Bug: #1415240
2015-02-25 17:46:08 +01:00
..
bin package-installs: work with Python < 2.7 2015-02-25 17:46:08 +01:00
extra-data.d Use sudo -E when squashing package installs files 2015-02-04 13:25:48 -05:00
install.d Rework package-installs to collapse on build host 2014-12-11 00:05:32 -08:00
post-install.d Rework package-installs to collapse on build host 2014-12-11 00:05:32 -08:00
pre-install.d Rework package-installs to collapse on build host 2014-12-11 00:05:32 -08:00
README.rst Create docs site containing element READMEs 2015-02-10 11:45:35 -08:00
element-deps package-installs for pre-install.d/post-install.d 2014-08-14 21:18:19 -04:00

README.rst

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

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)

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.

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.