qubes-core-agent.postrm 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. #!/bin/sh
  2. # postrm script for core-agent-linux
  3. #
  4. # see: dh_installdeb(1)
  5. set -e
  6. # The prerm script may be called in the following ways:
  7. # * <postrm> 'remove'
  8. # * <postrm> 'purge'
  9. # * <old-postrm> 'upgrade' <new-version>
  10. # * <disappearer's-postrm> 'disappear' <overwriter> <overwriter-version>
  11. #
  12. # The postrm script is called after the package's files have been removed
  13. # or replaced. The package whose postrm is being called may have previously been
  14. # deconfigured and only be "Unpacked", at which point subsequent package changes
  15. # do not consider its dependencies. Therefore, all postrm actions may only rely
  16. # on essential packages and must gracefully skip any actions that require the
  17. # package's dependencies if those dependencies are unavailable.[48]
  18. #
  19. # * <new-postrm> 'failed-upgrade' <old-version>
  20. #
  21. # Called when the old postrm upgrade action fails. The new package will be
  22. # unpacked, but only essential packages and pre-dependencies can be relied on.
  23. # Pre-dependencies will either be configured or will be "Unpacked" or
  24. # "Half-Configured" but previously had been configured and was never removed.
  25. #
  26. # * <new-postrm> 'abort-install'
  27. # * <new-postrm> 'abort-install' <old-version>
  28. # * <new-postrm> 'abort-upgrade' <old-version>
  29. #
  30. # Called before unpacking the new package as part of the error handling of
  31. # preinst failures. May assume the same state as preinst can assume.
  32. #
  33. # For details, see http://www.debian.org/doc/debian-policy/ or
  34. # https://www.debian.org/doc/debian-policy/ch-maintainerscripts.html or
  35. # the debian-policy package
  36. if [ "${1}" = "remove" ] ; then
  37. /usr/bin/glib-compile-schemas /usr/share/glib-2.0/schemas > /dev/null 2>&1 || :
  38. if [ -L /lib/firmware/updates ]; then
  39. rm /lib/firmware/updates
  40. fi
  41. for srv in qubes-dvm qubes-sysinit qubes-misc-post qubes-netwatcher qubes-network qubes-qrexec-agent; do
  42. systemctl disable ${srv}.service
  43. done
  44. fi
  45. if [ "$1" = "purge" ]; then
  46. dpkg-statoverride --remove /var/lib/qubes/dom0-updates || test $? -eq 2
  47. fi
  48. # dh_installdeb will replace this with shell code automatically
  49. # generated by other debhelper scripts.
  50. #DEBHELPER#
  51. exit 0
  52. # vim: set ts=4 sw=4 sts=4 et :