summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorApachez <apachez@gmail.com>2023-08-27 00:55:42 +0200
committerApachez <apachez@gmail.com>2023-08-27 00:55:42 +0200
commitb120f757d6dfb67d4abd5c1c383ad1845aba59d1 (patch)
tree5305932ef4b37eecb7c9945788665a2772aef122
parentee57ffed1a3aacd6b48fa274d85ef75a4cfa0e37 (diff)
downloadvyos-build-b120f757d6dfb67d4abd5c1c383ad1845aba59d1.tar.gz
vyos-build-b120f757d6dfb67d4abd5c1c383ad1845aba59d1.zip
T5511: Cleanup of unused directories (and files) in order to shrink image-size
-rwxr-xr-xdata/live-build-config/hooks/live/80-delete-docs.chroot39
1 files changed, 35 insertions, 4 deletions
diff --git a/data/live-build-config/hooks/live/80-delete-docs.chroot b/data/live-build-config/hooks/live/80-delete-docs.chroot
index 33a6bf74..1f50a9ec 100755
--- a/data/live-build-config/hooks/live/80-delete-docs.chroot
+++ b/data/live-build-config/hooks/live/80-delete-docs.chroot
@@ -1,11 +1,42 @@
#!/bin/bash
-# We do not need any documentation on the system. This frees some space.
-# Copyright/licenses files are ignored for deletion
+# Delete various unused files and directories in order free some space and shrink imagesize.
+
+# We do not need any documentation on the system.
+# Copyright/licenses files are ignored for deletion.
shopt -s extglob
rm -rf /usr/share/doc/*/!(copyright*|README*) /usr/share/doc-base
-# We also do not need any manpages on the system since man-binary is missing.
-# This also frees some space.
+# We do not need any manpages on the system since man-binary is missing.
+rm -rf /usr/local/man
+rm -rf /usr/local/share/man
rm -rf /usr/share/man
+# We do not need any games on the system.
+rm -rf /usr/games
+rm -rf /usr/local/games
+
+# We do not need any caches on the system (will be recreated when needed).
+rm -rf /var/cache/*
+
+# We do not need any log-files on the system (will be recreated when needed).
+rm -rf /var/log/alternatives.log
+rm -rf /var/log/bootstrap.log
+rm -rf /var/log/dpkg.log
+rm -rf /var/log/apt/history.log
+rm -rf /var/log/apt/term.log
+rm -rf /var/log/nginx/access.log
+rm -rf /var/log/nginx/error.log
+rm -rf /var/log/squidguard/squidGuard.log
+rm -rf /var/log/stunnel4/stunnel.log
+
+# We do not need any backup-files on the system.
+rm -rf /etc/sudoers.bak
+rm -rf /etc/xml/catalog.old
+rm -rf /etc/xml/polkitd.xml.old
+rm -rf /etc/xml/xml-core.xml.old
+rm -rf /root/.gnupg/pubring.kbx~
+rm -rf /var/lib/dpkg/diversions-old
+rm -rf /var/lib/dpkg/status-old
+rm -rf /var/lib/sgml-base/supercatalog.old
+