Merge "Remove yum chroot caching"
This commit is contained in:
commit
f3d0d6e8ec
@ -6,13 +6,9 @@ Create a minimal image based on CentOS 7.
|
||||
Use of this element will require 'yum' and 'yum-utils' to be installed on
|
||||
Ubuntu and Debian. Nothing additional is needed on Fedora or CentOS.
|
||||
|
||||
The `DIB_OFFLINE` or more specific `DIB_YUMCHROOT_USE_CACHE`
|
||||
variables can be set to prefer the use of a pre-cached root filesystem
|
||||
tarball.
|
||||
|
||||
By default, `DIB_YUM_MINIMAL_CREATE_INTERFACES` is set to enable the
|
||||
creation of `/etc/sysconfig/network-scripts/ifcfg-eth[0|1]` scripts to
|
||||
enable DHCP on the `eth0` & `eth1` interfaces. If you do not have
|
||||
By default, ``DIB_YUM_MINIMAL_CREATE_INTERFACES`` is set to enable the
|
||||
creation of ``/etc/sysconfig/network-scripts/ifcfg-eth[0|1]`` scripts to
|
||||
enable DHCP on the ``eth0`` & ``eth1`` interfaces. If you do not have
|
||||
these interfaces, or if you are using something else to setup the
|
||||
network such as cloud-init, glean or network-manager, you would want
|
||||
to set this to `0`.
|
||||
to set this to ``0``.
|
||||
|
@ -11,10 +11,6 @@ Due to a bug in the released version of urlgrabber, on many systems an
|
||||
installation of urlgrabber from git is required. The git repository
|
||||
can be found here: http://yum.baseurl.org/gitweb?p=urlgrabber.git;a=summary
|
||||
|
||||
The `DIB_OFFLINE` or more specific `DIB_YUMCHROOT_USE_CACHE`
|
||||
variables can be set to prefer the use of a pre-cached root filesystem
|
||||
tarball.
|
||||
|
||||
This element sets the `DIB_RELEASE` var to 'fedora'. The release of fedora
|
||||
to be installed can be controlled through the `DIB_RELEASE` variable, which
|
||||
defaults to '21'.
|
||||
This element sets the ``DIB_RELEASE`` var to 'fedora'. The release of
|
||||
fedora to be installed can be controlled through the ``DIB_RELEASE``
|
||||
variable, which defaults the latest supported release.
|
||||
|
@ -9,10 +9,6 @@ or fedora-minimal elements to get an actual base image.
|
||||
Use of this element will require 'yum' and 'yum-utils' to be installed on
|
||||
Ubuntu and Debian. Nothing additional is needed on Fedora or CentOS.
|
||||
|
||||
The `DIB_OFFLINE` or more specific `DIB_YUMCHROOT_USE_CACHE`
|
||||
variables can be set to prefer the use of a pre-cached root filesystem
|
||||
tarball.
|
||||
|
||||
If you wish to have DHCP networking setup for eth0 & eth1 via
|
||||
/etc/sysconfig/network-config scripts/ifcfg-eth[0|1], set the
|
||||
environment variable `DIB_YUM_MINIMAL_CREATE_INTERFACES` to `1`.
|
||||
|
@ -31,8 +31,6 @@ if [ $ARCH = amd64 ]; then
|
||||
ARCH=x86_64
|
||||
fi
|
||||
# Calling elements will need to set DISTRO_NAME and DIB_RELEASE
|
||||
DIB_YUMCHROOT_EXTRA_ARGS=${DIB_YUMCHROOT_EXTRA_ARGS:-}
|
||||
YUMCHROOT_TARBALL=$DIB_IMAGE_CACHE/yumchroot-${DISTRO_NAME}-${DIB_RELEASE}-${ARCH}.tar.gz
|
||||
# TODO Maybe deal with DIB_DISTRIBUTION_MIRROR
|
||||
http_proxy=${http_proxy:-}
|
||||
YUM=${YUM:-yum}
|
||||
@ -189,10 +187,6 @@ function _install_pkg_manager {
|
||||
$TARGET_ROOT/etc/yum.repos.d/*repo
|
||||
}
|
||||
|
||||
if [ -n "$DIB_OFFLINE" -o -n "${DIB_YUMCHROOT_USE_CACHE:-}" ] && [ -f $YUMCHROOT_TARBALL ] ; then
|
||||
echo $YUMCHROOT_TARBALL found in cache. Using.
|
||||
sudo tar -C $TARGET_ROOT --numeric-owner -xzf $YUMCHROOT_TARBALL
|
||||
else
|
||||
# Note this is not usually done for root.d elements (see
|
||||
# lib/common-functions:mount_proc_dev_sys) but it's important that
|
||||
# we have things like /dev/urandom around inside the chroot for
|
||||
@ -286,10 +280,4 @@ else
|
||||
sudo mv $newfile $(echo $newfile | sed 's/.rpmnew$//')
|
||||
done
|
||||
|
||||
echo Caching result in $YUMCHROOT_TARBALL
|
||||
sudo tar --numeric-owner \
|
||||
-C $TARGET_ROOT \
|
||||
-zcf $YUMCHROOT_TARBALL --exclude='./tmp/*' .
|
||||
fi
|
||||
|
||||
sudo rm -f ${TARGET_ROOT}/.extra_settings
|
||||
|
@ -0,0 +1,9 @@
|
||||
---
|
||||
deprecations:
|
||||
- The ``DIB_YUMCHROOT_USE_CACHE`` variable has been removed and the
|
||||
Fedora and CentOS ``-minimal`` initial chroot will always be
|
||||
created by the package manager. The default creation of a chroot
|
||||
tarball is stopped for these elements. This unused option was
|
||||
unsafe; there is no guarantee that the base system will not change
|
||||
even between runs. Getting the package manager to reuse the cache
|
||||
for the initial chroot install is future work.
|
Loading…
Reference in New Issue
Block a user