aboutsummaryrefslogtreecommitdiffstats
path: root/stage0
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2021-07-02 19:03:44 +0200
committerSven Gothel <[email protected]>2021-07-02 19:03:44 +0200
commit4cba577252c687374b5b92135a0ef0f0e5db66ed (patch)
tree0b4032697fbb7c4df84ab7150da94fa2bbeb2cdf /stage0
parent7545621fb6f8171bb146739e703184bcab3f19dd (diff)
Size reduction: apt-get install always use 'Recommends 0' & 'Suggests 0', drop cache; dpkg: Remove doc, man, ..
Diffstat (limited to 'stage0')
-rwxr-xr-xstage0/00-configure-apt/00-run.sh4
-rw-r--r--stage0/00-configure-apt/files/00default-selection2
-rw-r--r--stage0/00-configure-apt/files/01_nodoc25
-rw-r--r--stage0/00-configure-apt/files/02nocache9
4 files changed, 40 insertions, 0 deletions
diff --git a/stage0/00-configure-apt/00-run.sh b/stage0/00-configure-apt/00-run.sh
index 651d154..d57ce73 100755
--- a/stage0/00-configure-apt/00-run.sh
+++ b/stage0/00-configure-apt/00-run.sh
@@ -11,6 +11,10 @@ if [ -n "$APT_PROXY" ]; then
else
rm -f "${ROOTFS_DIR}/etc/apt/apt.conf.d/51cache"
fi
+install -m 644 files/00default-selection "${ROOTFS_DIR}/etc/apt/apt.conf.d/00default-selection"
+install -m 644 files/02nocache "${ROOTFS_DIR}/etc/apt/apt.conf.d/02nocache"
+
+install -m 644 files/01_nodoc "${ROOTFS_DIR}/etc/dpkg/dpkg.cfg.d/01_nodoc"
on_chroot apt-key add - < files/raspberrypi.gpg.key
on_chroot << EOF
diff --git a/stage0/00-configure-apt/files/00default-selection b/stage0/00-configure-apt/files/00default-selection
new file mode 100644
index 0000000..0aa044c
--- /dev/null
+++ b/stage0/00-configure-apt/files/00default-selection
@@ -0,0 +1,2 @@
+APT::Install-Recommends "0";
+APT::Install-Suggests "0";
diff --git a/stage0/00-configure-apt/files/01_nodoc b/stage0/00-configure-apt/files/01_nodoc
new file mode 100644
index 0000000..8c0833b
--- /dev/null
+++ b/stage0/00-configure-apt/files/01_nodoc
@@ -0,0 +1,25 @@
+# /etc/dpkg/dpkg.cfg.d/01_nodoc
+# https://wiki.ubuntu.com/ReducingDiskFootprint#Documentation
+
+# Keep in sync:
+# stage0/00-configure-apt/files/01_nodoc
+# export-image/04-finalise/01-run.sh
+
+path-exclude /usr/share/doc/*
+# we need to keep copyright files for legal reasons
+path-include /usr/share/doc/*/copyright
+path-exclude /usr/share/man/*
+path-exclude /usr/share/groff/*
+path-exclude /usr/share/info/*
+# lintian stuff is small, but really unnecessary
+path-exclude /usr/share/lintian/*
+path-exclude /usr/share/linda/*
+
+path-exclude /usr/share/locale/*
+path-include /usr/share/locale/en*
+path-include /usr/share/locale/de*
+#path-include /usr/share/locale/es*
+path-include /usr/share/locale/se*
+path-include /usr/share/locale/fr*
+#path-include /usr/share/locale/zh*
+
diff --git a/stage0/00-configure-apt/files/02nocache b/stage0/00-configure-apt/files/02nocache
new file mode 100644
index 0000000..401aee8
--- /dev/null
+++ b/stage0/00-configure-apt/files/02nocache
@@ -0,0 +1,9 @@
+# /etc/apt/apt.conf.d/02nocache
+# https://wiki.ubuntu.com/ReducingDiskFootprint#Documentation
+
+Dir::Cache {
+ srcpkgcache "";
+ pkgcache "";
+}
+
+