Add yum element.

The yum element provides for specific customizations
for yum based distros.  The included customization is
a yum cache mounted outside of the chroot so that yum
downloaded packages are reused on subsequent image builds.

Change-Id: I6833c9fdbc83cb09debec6a789082e105c917800
This commit is contained in:
James Slagle 2013-07-31 09:37:57 -04:00
parent 2c73a001b2
commit c9a6aef9f4
4 changed files with 30 additions and 0 deletions

View File

@ -2,3 +2,4 @@ dib-run-parts
dracut-network dracut-network
cache-url cache-url
dkms dkms
yum

10
elements/yum/README.md Normal file
View File

@ -0,0 +1,10 @@
Provide yum specific image building glue.
RHEL/Fedora/CentOS and other yum based distributions need specific yum
customizations.
Customizations include caching of downloaded yum packages outside of the build
chroot so that they can be reused by subsequent image builds. The cache
increases image building speed when building multiple images, especially on
slow connections. This is more effective than using an HTTP proxy as a yum
cache since the same rpm from different mirrors is often requested.

View File

@ -0,0 +1,8 @@
#!/bin/bash
set -e
[ -n "TARGET_ROOT" ]
sudo sed -i 's/keepcache=0/keepcache=1/' $TARGET_ROOT/etc/yum.conf
sudo sed -i 's/cachedir=\/var\/cache\/yum/cachedir=\/tmp\/yum/' $TARGET_ROOT/etc/yum.conf

View File

@ -0,0 +1,11 @@
#!/bin/bash
set -e
[ -n "TARGET_ROOT" ]
YUM_CACHE_DIR=~/.cache/image-create/yum
mkdir -p $YUM_CACHE_DIR
sudo mkdir -p $TMP_MOUNT_PATH/tmp/yum
sudo mount --bind $YUM_CACHE_DIR $TMP_MOUNT_PATH/tmp/yum