linux-firmware/debian/scripts/remove-firmware

28 lines
542 B
Plaintext
Raw Permalink Normal View History

2023-02-23 21:02:13 +01:00
#!/bin/bash -eu
#
# Remove firmware files and/or directories
#
if [ $# -ne 1 ] ; then
echo "Usage: remove-firmware <dirname>" >&2
exit 2
fi
if ! [ -d "${1}" ] ; then
echo "No such directory: ${1}" >&2
exit 1
fi
echo "Remove firmware files in ${1} ..."
while IFS= read -r item ; do
# Don't quote 'item' to allow globs in remove-firmware.list
# shellcheck disable=SC2086
for fw in "${1:?}"/${item} ; do
if [ -e "${fw}" ] ; then
echo " ${fw}"
rm -rf "${fw}"
fi
done
done < <(sed -E '/^#|^$/d' debian/remove-firmware.list)