98-remove_unwanted_files 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. #!/bin/sh
  2. set -e
  3. echo "Removing unwanted files"
  4. # Get POTFILES_DOT_IN
  5. . /usr/share/amnesia/build/variables
  6. find /usr/share/doc -type f -name changelog.gz -delete
  7. find /usr/share/doc -type f -name changelog.Debian.gz -delete
  8. find /usr/share/doc -type f -name NEWS.Debian.gz -delete
  9. # Remove .in files managed by intltool
  10. rm $POTFILES_DOT_IN
  11. # These files are not needed after the Tor Browser has been installed
  12. # (by the 10-tbb hook)
  13. rm /usr/share/tails/tbb-*.txt
  14. # Prevent races between MAC spoofing and interface naming
  15. rm /lib/udev/rules.d/75-persistent-net-generator.rules
  16. # Remove the snakeoil SSL key pair generated by ssl-cert
  17. find /etc/ssl/certs /etc/ssl/private |
  18. while read f; do
  19. if [ "$(readlink -f "$f")" = "/etc/ssl/certs/ssl-cert-snakeoil.pem" ] || \
  20. [ "$(readlink -f "$f")" = "/etc/ssl/private/ssl-cert-snakeoil.key" ]; then
  21. rm "${f}"
  22. fi
  23. done
  24. update-ca-certificates
  25. # Remove the kernel .map files which are only useful for kernel
  26. # debugging (and slightly make things easier for malware, perhaps) and
  27. # otherwise just occupy disk space.
  28. rm -f /boot/*.map /boot/*.map-*