diff --git a/diskimage_builder/elements/base/README.rst b/diskimage_builder/elements/base/README.rst index 1984ea86..f105048f 100644 --- a/diskimage_builder/elements/base/README.rst +++ b/diskimage_builder/elements/base/README.rst @@ -20,6 +20,14 @@ customize cloud-init's management of `/etc/hosts`: preserve diskimage-builder's current default behavior in the future, set the variable to "localhost" explicitly.) +The 'DIB_AVOID_PACKAGES_UPDATE' environment variable can be used to +avoid updating all packages, useful when wanting to avoid release +update. + + * 'DIB_AVOID_PACKAGES_UPDATE' default is '0', all packages will be updated. + + * set 'DIB_AVOID_PACKAGES_UPDATE' to '1' to avoid updating all packages. + Notes: * If you are getting warnings during the build about your locale diff --git a/diskimage_builder/elements/base/environment.d/10-base-defaults b/diskimage_builder/elements/base/environment.d/10-base-defaults new file mode 100644 index 00000000..b555a262 --- /dev/null +++ b/diskimage_builder/elements/base/environment.d/10-base-defaults @@ -0,0 +1 @@ +export DIB_AVOID_PACKAGES_UPDATE=${DIB_AVOID_PACKAGES_UPDATE:-0} \ No newline at end of file diff --git a/diskimage_builder/elements/base/install.d/00-up-to-date b/diskimage_builder/elements/base/install.d/00-up-to-date index d2b45d74..996ba275 100755 --- a/diskimage_builder/elements/base/install.d/00-up-to-date +++ b/diskimage_builder/elements/base/install.d/00-up-to-date @@ -8,4 +8,6 @@ fi set -eu set -o pipefail -install-packages -u +if [ ${DIB_AVOID_PACKAGES_UPDATE} -eq 0 ]; then + install-packages -u +fi