diff --git a/dib/ironic-python-agent-ramdisk/post-install.d/99-remove-extra-packages b/dib/ironic-python-agent-ramdisk/post-install.d/99-remove-extra-packages index 072688d..25e0674 100755 --- a/dib/ironic-python-agent-ramdisk/post-install.d/99-remove-extra-packages +++ b/dib/ironic-python-agent-ramdisk/post-install.d/99-remove-extra-packages @@ -7,11 +7,16 @@ set -eu set -o pipefail rm -rf /tmp/ironic-python-agent - -for item in ${IPA_REMOVE_FIRMWARE//,/ }; do - # Attempt removal of item, but don't error - # if it is not present already. - rm -rf /usr/lib/firmware/$item || true +# 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 diff --git a/releasenotes/notes/excess-firmware-removal-debian-06c49a8604122b1c.yaml b/releasenotes/notes/excess-firmware-removal-debian-06c49a8604122b1c.yaml new file mode 100644 index 0000000..4ba000a --- /dev/null +++ b/releasenotes/notes/excess-firmware-removal-debian-06c49a8604122b1c.yaml @@ -0,0 +1,5 @@ +--- +features: + - | + Excess hardware firmware on Debian based agent ramdisks is now automatically + removed.