diskimage-builder/elements/pkg-map
Ian Wienand 5abb4a4f12 Initial centos7 support
Initial support for a centos7 image.

This is separate to rhel7 because the major differences are things
like repo and image locations, which are always going to be different.
We should merge any real changes into the redhat-common layers.

Apart from the added support files in centos7/*, the other change is
mostly modifications to redhat-common's extract-image to handle
different partition layouts of the centos7 image.

Change-Id: I943abe5ff0a803f36eda266a79af0d9220edcae7
2014-07-16 10:43:05 +10:00
..
bin Initial centos7 support 2014-07-16 10:43:05 +10:00
extra-data.d Add pkg-map element. 2014-05-28 12:21:44 -04:00
README.md Add pkg-map element. 2014-05-28 12:21:44 -04:00

Map package names to distro specific packages.

Provides the following:

  • bin/pkg-map

    usage: pkg-map [-h] [--element ELEMENT] [--distro DISTRO]

    Translate package name to distro specific name.

    optional arguments: -h, --help show this help message and exit --element ELEMENT The element (namespace) to use for translation. --distro DISTRO The distro name to use for translation. Defaults to DISTRO_NAME

  • Any element may create its own pkg-map JSON config file using the one of 3 sections for the distro/family/ and or default. The family is set automatically within pkg-map based on the supplied distro name. Families include:

    • redhat: includes centos, fedora, and rhel distros
    • debian: includes debian and ubuntu distros
    • suse: includes the opensuse distro

    The most specific section takes priority. Example for Nova and Glance (NOTE: using fictitious package names for Fedora to provide a good example!)

    Example format: { "distro": { "fedora": { "nova_package": "openstack-compute", "glance_package": "openstack-image" } }, "family": { "redhat": { "nova_package": "openstack-nova", "glance_package": "openstack-glance" } }, "default": { "nova_package": "nova", "glance_package": "glance" } }

    Example commands using this format:

    pkg-map --element nova-compute --distro fedora nova_package

    Returns: openstack-compute

    pkg-map --element nova-compute --distro rhel nova_package

    Returns: openstack-nova

    pkg-map --element nova-compute --distro ubuntu nova_package

    Returns: nova

  • This output can be used to filter what other tools actually install (install-packages can be modified to use this for example)

  • Individual pkg-map files live within each element. For example if you are created an Apache element your pkg-map JSON file should be created at elements/apache/pkg-map.