diskimage-builder/elements/redhat-common/pre-install.d/02-lsb
Ben Nemec 0eccd2808c Allow source-repositories to be disabled completely
In our official image builds we are only allowed to use resources
that are "blessed" by the build system.  This means that external
things like git repos and tar files are not allowed.  Currently,
even in offline mode source-repositories expects those things to
be available in the cache, so we need a way to disable it entirely.

This change adds an environment variable NO_SOURCE_REPOSITORIES
that does so.  It can be set in an environment.d script so elements
that might rely on a source repository will know it's not available.
The 02-lsb script in redhat-common is one such example and is
updated to handle this case.

Change-Id: I0de63bee6ad79733d6711478c707a9b41593e85f
2014-10-15 12:24:50 -04:00

10 lines
215 B
Bash
Executable file

#!/bin/bash
set -eu
set -o pipefail
if [ -z "${NO_SOURCE_REPOSITORIES:-}" ]; then
install -m 0755 -o root -g root /opt/stack/lsb-release/lsb_release /usr/local/bin
else
install-packages redhat-lsb-core
fi