diff --git a/live-build/auto/build b/live-build/auto/build index 03b3d486..4a7bc177 100755 --- a/live-build/auto/build +++ b/live-build/auto/build @@ -152,6 +152,10 @@ if [ -f /etc/dpkg/dpkg.cfg.d/excludes ] || [ -f /etc/dpkg/dpkg.cfg.d/excludes.dp echo "/etc/dpkg/dpkg.cfg.d/excludes.dpkg-tmp and restore the files manually." fi fi + +# Remove diverted man binary +rm -f /usr/bin/man +dpkg-divert --quiet --remove --rename /usr/bin/man EOF if [ "$PROJECT" != "ubuntu-base" ]; then @@ -190,7 +194,19 @@ echo "To restore this content, you can run the 'unminimize' command." EOF chmod +x chroot/etc/update-motd.d/60-unminimize - fi + Chroot chroot "dpkg-divert --quiet --add \ + --divert /usr/bin/man.REAL --rename \ + /usr/bin/man" + cat > chroot/usr/bin/man << EOF +#!/bin/sh +echo "This system has been minimized by removing packages and content that are" +echo "not required on a system that users do not log into." +echo "" +echo "To restore this content, including manpages, you can run the 'unminimize'" +echo " command." +EOF + chmod +x chroot/usr/bin/man + fi Chroot chroot "dpkg-divert --quiet --add \ --divert /usr/sbin/update-initramfs.REAL --rename \ /usr/sbin/update-initramfs"