From 91da6ab885add99b9ed8ceee3bea195a3fd6b03e Mon Sep 17 00:00:00 2001 From: Jay Faulkner Date: Tue, 27 Jul 2021 10:45:50 -0700 Subject: [PATCH] Permit specification of extra bootstrap packages This change permits the yum-minimal element to be used in downstream custom distributions, which may have additional packages containing repo config or GPG keys needed. This could also be utilized at a later time to move the distribution-specific logic in this method to each distribution element separately. Change-Id: Ic1434bb2fe7301086cf11ba6bd7f2ee187c5e6c8 --- diskimage_builder/elements/yum-minimal/README.rst | 5 +++++ .../elements/yum-minimal/root.d/08-yum-chroot | 4 ++-- ...ecify-bootstrap-packages-via-env-22f5c6982c09f16a.yaml | 8 ++++++++ 3 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 releasenotes/notes/specify-bootstrap-packages-via-env-22f5c6982c09f16a.yaml diff --git a/diskimage_builder/elements/yum-minimal/README.rst b/diskimage_builder/elements/yum-minimal/README.rst index 2c4d95f9..2f9ce6be 100644 --- a/diskimage_builder/elements/yum-minimal/README.rst +++ b/diskimage_builder/elements/yum-minimal/README.rst @@ -22,3 +22,8 @@ image. If you wish to include extra repositories, set ``DIB_YUM_MINIMAL_EXTRA_REPOS`` to a directory with the ``.repo`` files. The repo files will not be removed from the final image. + +If you are bootstrapping a custom or unsupported OS, and need to install +additional packages to setup the base chroot, set +``DIB_YUM_MINIMAL_BOOTSTRAP_PACKAGES`` to the list of additional packages to +install. diff --git a/diskimage_builder/elements/yum-minimal/root.d/08-yum-chroot b/diskimage_builder/elements/yum-minimal/root.d/08-yum-chroot index e3f6ac15..8a7556eb 100755 --- a/diskimage_builder/elements/yum-minimal/root.d/08-yum-chroot +++ b/diskimage_builder/elements/yum-minimal/root.d/08-yum-chroot @@ -71,8 +71,8 @@ function _install_repos { # is that they are only installed in one big transaction with the # rest of the system? but we don't want to use yum to do this # (see above) so ... - packages="basesystem filesystem setup " - + packages="${DIB_YUM_MINIMAL_BOOTSTRAP_PACKAGES:-} " + packages+="basesystem filesystem setup " if [[ ${DISTRO_NAME} = fedora && ${DIB_RELEASE} -gt 29 ]]; then packages+="fedora-release-cloud fedora-release-common " else diff --git a/releasenotes/notes/specify-bootstrap-packages-via-env-22f5c6982c09f16a.yaml b/releasenotes/notes/specify-bootstrap-packages-via-env-22f5c6982c09f16a.yaml new file mode 100644 index 00000000..e6aeed93 --- /dev/null +++ b/releasenotes/notes/specify-bootstrap-packages-via-env-22f5c6982c09f16a.yaml @@ -0,0 +1,8 @@ +--- +features: + - | + Now, users of the ``yum-minimal`` element can specify additional packages + to install while creating the initial chroot by setting + ``DIB_YUM_MINIMAL_BOOTSTRAP_PACKAGES``. This can be useful for adding + support for new linux distributions that use yum. +