Skip to content
Snippets Groups Projects
Commit 85533b1f authored by Mario Limonciello's avatar Mario Limonciello
Browse files

debian/preinst: do a better job cleaning up artifacts

When converting to transition package, the EFI binary stopped getting
cleaned up.

Also in some cases the directories are continuing to exist in /var/lib
or /var/cache, so explicitly clean those up as well.
parent d065e8b9
No related branches found
No related tags found
No related merge requests found
......@@ -5,5 +5,21 @@
set -e
rm -f /var/cache/fwupdate/done
EFIDIR=$(dpkg-vendor --query vendor | awk '{ print tolower($$0) }')
if [ "${DPKG_MAINTSCRIPT_ARCH}" = "amd64" ]; then
EFI_NAME=x64
elif [ "${DPKG_MAINTSCRIPT_ARCH}" = "i386" ]; then
EFI_NAME=ia32
elif [ "${DPKG_MAINTSCRIPT_ARCH}" = "arm64" ]; then
EFI_NAME=aa64
elif [ "${DPKG_MAINTSCRIPT_ARCH}" = "armhf" ]; then
EFI_NAME=arm
fi
rm -f /boot/efi/EFI/$EFIDIR/fwup$EFI_NAME.efi
rm -f /var/lib/fwupdate/done
rm -f /var/cache/fwupdate/done
for dir in /boot/efi/EFI/$EFIDIR/fw /var/cache/fwupdate /var/lib/fwupdate; do
if [ -d $dir ]; then
rmdir --parents --ignore-fail-on-non-empty $dir || true
fi
done
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment