diskimage-builder/elements/yum-minimal
Ian Wienand 349e8db2f7 yum-minimal: pre-install base packages
We were getting some subtle issues in fedora-minimal builds that
turned out to be because /var/run was not a symlink to /run.

Upon further investigation, it turns out that yum is creating a
/var/run directory for it's pid file when it starts working in the
empty chroot (which I verified by stracing it)

---
5905  stat("/home/ubuntu/tmp/dib-tmp/image.Ac4VZZsl/mnt/var/run", 0x7ffddffa0330) = -1 ENOENT (No such file or directory)
5905  mkdir("/home/ubuntu/tmp/dib-tmp/image.Ac4VZZsl/mnt/var/run", 0755) = 0
5905  open("/home/ubuntu/tmp/dib-tmp/image.Ac4VZZsl/mnt/var/run/yum.pid", O_WRONLY|O_CREAT|O_EXCL, 0644) = 6
---

Because this happens *before* we install "filesystem" (the package),
we mess up it's symlinking.

To work-around this, pre-install the trio of base packages (setup,
basesystem, filesystem) with rpm from outside the chroot.

Change-Id: I411b6ec9d91d95d3a0f98e76853086af3b70abe8
2016-02-11 15:42:10 +11:00
..
install.d yum-minimal: do not configure eth0 & eth1 for DHCP automatically 2015-12-22 08:39:04 +11:00
pre-install.d Add a yum-minimal element that just uses yum 2015-04-14 13:39:18 -04:00
root.d yum-minimal: pre-install base packages 2016-02-11 15:42:10 +11:00
element-deps Add a yum-minimal element that just uses yum 2015-04-14 13:39:18 -04:00
package-installs.yaml yum-minimal : install selinux policy packages 2015-12-22 08:45:20 +11:00
pkg-map Add a yum-minimal element that just uses yum 2015-04-14 13:39:18 -04:00
README.rst yum-minimal: do not configure eth0 & eth1 for DHCP automatically 2015-12-22 08:39:04 +11:00

===========
yum-minimal
===========
Base element for creating minimal yum-based images.

This element is incomplete by itself, you'll want to use the centos-minimal
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`.