Drop man pages and most of the documentation from minimized images

/usr/share/doc/*/copyright and changelog.Debian.gz files are still kept
core-include-dmsetup
Balint Reczey 7 years ago
parent c2d66c7d96
commit 9dd178a0e5

@ -37,6 +37,27 @@ Expire-Date: 0
rm -f chroot/etc/localtime chroot/etc/timezone
fi
if [ "$SUBPROJECT" = minimize ]; then
# set up dpkg filters to skip installing docs on minimized system
mkdir -p chroot/etc/dpkg/dpkg.cfg.d
cat > chroot/etc/dpkg/dpkg.cfg.d/excludes <<EOF
# Drop all man pages
path-exclude=/usr/share/man/*
# Drop all documentation ...
path-exclude=/usr/share/doc/*
# ... except copyright files ...
path-include=/usr/share/doc/*/copyright
# ... and Debian changelogs
path-include=/usr/share/doc/*/changelog.Debian.*
EOF
# Remove docs installed by bootstrap
Chroot chroot dpkg-query -f '${binary:Package}\n' -W | Chroot chroot xargs apt-get install --reinstall
fi
Chroot chroot "dpkg-divert --quiet --add \
--divert /usr/sbin/update-initramfs.REAL --rename \
/usr/sbin/update-initramfs"

Loading…
Cancel
Save