1b904b5dd3
Adds logic to loop through the path debian uses to remove excess firmware binaries that are un-needed for the agent to operate. Change-Id: I95a12215b8c5b2d52f52145f79b5f245138ebfde
32 lines
914 B
Bash
Executable File
32 lines
914 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
|
|
# In Centos Stream, /lib is linked to /lib/firmware, so the first
|
|
# loop will likely go ahead and remove everything, but the || true
|
|
# below will keep it from erroring.
|
|
KNOWN_FIRMWARE_PATH="/lib/firmware/ /usr/lib/firmware/"
|
|
for folder in $KNOWN_FIRMWARE_PATH; do
|
|
for item in ${IPA_REMOVE_FIRMWARE//,/ }; do
|
|
# Attempt removal of item, but don't error
|
|
# if it is not present already.
|
|
rm -rf $folder$item || true
|
|
done
|
|
done
|
|
|
|
# TODO(dtantsur): implement the same for debian-based systems
|
|
case "$DISTRO_NAME" in
|
|
fedora|centos|centos7|rhel|rhel7)
|
|
${YUM:-yum} remove -y postfix gcc make
|
|
${YUM:-yum} clean all
|
|
# Rebuilding the rpm database after removing packages will reduce
|
|
# its size
|
|
rpm --rebuilddb
|
|
;;
|
|
esac
|