ironic-python-agent-builder/dib/ironic-python-agent-ramdisk/post-install.d/99-remove-extra-packages
Dmitry Tantsur f45996c192 Slim down the pre-built DIB IPA images
* Move remove-extra-packages to post-install since finalise.d
  is running on the final image and the DIB documentation
  recommends avoiding unnecessary actions there.
* Remove a few packages that used to be removed only for Fedora;
  do not try to remove those that aren't on the cloud image.
* Do all uninstallations in pre-install phase, so that it doesn't try
  to remove dependencies of already installed packages.
* Exclude more locale files from the image.
* Exclude the content of /var/log.

Change-Id: Idb7819b1d783f4f5f390cc7621019d3be2fa576f
2019-10-09 09:32:34 +00:00

20 lines
414 B
Bash
Executable File

#!/bin/bash
if [ "${DIB_DEBUG_TRACE:-0}" -gt 0 ]; then
set -x
fi
set -eu
set -o pipefail
rm -rf /tmp/ironic-python-agent
# TODO(dtantsur): implement the same for debian-based systems
case "$DISTRO_NAME" in
fedora|centos|centos7|rhel|rhel7)
${YUM:-yum} clean all
# Rebuilding the rpm database after removing packages will reduce
# its size
rpm --rebuilddb
;;
esac