divert /usr/bin/man in minimized images to a script that mentions the unminimize script

ubuntu/cosmic
Michael Hudson-Doyle 7 years ago
parent 7e1bd33544
commit 514faae2db

@ -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,6 +194,18 @@ echo "To restore this content, you can run the 'unminimize' command."
EOF
chmod +x chroot/etc/update-motd.d/60-unminimize
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 \

Loading…
Cancel
Save