From 875e3592f77ee8d624eb492eebf229ec09352c57 Mon Sep 17 00:00:00 2001 From: James Westby Date: Fri, 14 Oct 2016 16:41:07 +0100 Subject: [PATCH] Don't delete copyright files. Some licences require that the binaries be shipped with a copy of the license. Debian does this in the copyright files in /usr/share/doc. We need to leave those files there to keep the image distributable. --- mkimage | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mkimage b/mkimage index 6035f31..fd18cca 100755 --- a/mkimage +++ b/mkimage @@ -20,7 +20,6 @@ cp -a $ROOT/debootstrap/* $DEBOOTSTRAP_DIR/scripts export DEBIAN_FRONTEND=noninteractive DIRS_TO_TRIM="/usr/share/man -/usr/share/doc /var/cache/apt /var/lib/apt/lists /usr/share/locale @@ -214,6 +213,8 @@ chroot "$rootfsDir" dpkg --force-all -P $PACKAGES_TO_EXCLUDE for DIR in $DIRS_TO_TRIM; do rm -r "$rootfsDir/$DIR"/* done +find "$rootfsDir/usr/share/doc" -mindepth 1 -not -name copyright -not -type d -delete +find "$rootfsDir/usr/share/doc" -mindepth 1 -type d -empty -delete echo "Total size" du -skh "$rootfsDir" echo "Package sizes"