summaryrefslogtreecommitdiffstats
path: root/config/chroot_local-hooks/98-remove_unwanted_files
blob: 43433fb38f3b260e28466dba8fce845040a8714f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/sh

set -e

echo "Removing unwanted files"

# Get POTFILES_DOT_IN
. /usr/share/amnesia/build/variables

find /usr/share/doc -type f -name changelog.gz        -delete
find /usr/share/doc -type f -name changelog.Debian.gz -delete
find /usr/share/doc -type f -name NEWS.Debian.gz      -delete

# Remove .in files managed by intltool
rm $POTFILES_DOT_IN

# These files are not needed after the Tor Browser has been installed
# (by the 10-tbb hook)
rm /usr/share/tails/tbb-*.txt

# Prevent races between MAC spoofing and interface naming
rm /lib/udev/rules.d/75-persistent-net-generator.rules

# Remove the snakeoil SSL key pair generated by ssl-cert
find /etc/ssl/certs /etc/ssl/private |
    while read f; do
       if [ "$(readlink -f "$f")" = "/etc/ssl/certs/ssl-cert-snakeoil.pem" ] || \
          [ "$(readlink -f "$f")" = "/etc/ssl/private/ssl-cert-snakeoil.key" ]; then
	   rm "${f}"
       fi
    done
update-ca-certificates

# Remove the kernel .map files which are only useful for kernel
# debugging (and slightly make things easier for malware, perhaps) and
# otherwise just occupy disk space.
rm -f /boot/*.map /boot/*.map-*