From 514faae2db7ac1163deff65b5d3f7d4fcb56e6ea Mon Sep 17 00:00:00 2001 From: Michael Hudson-Doyle Date: Tue, 5 Jun 2018 11:08:33 +1200 Subject: [PATCH] divert /usr/bin/man in minimized images to a script that mentions the unminimize script --- live-build/auto/build | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) 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"