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:
parent
2c73a001b2
commit
c9a6aef9f4
@ -2,3 +2,4 @@ dib-run-parts
|
||||
dracut-network
|
||||
cache-url
|
||||
dkms
|
||||
yum
|
||||
|
10
elements/yum/README.md
Normal file
10
elements/yum/README.md
Normal 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.
|
8
elements/yum/pre-install.d/01-yum-keepcache
Executable file
8
elements/yum/pre-install.d/01-yum-keepcache
Executable 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
|
11
elements/yum/root.d/50-yum-cache
Executable file
11
elements/yum/root.d/50-yum-cache
Executable 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
|
Loading…
Reference in New Issue
Block a user