mirror of
https://git.launchpad.net/livecd-rootfs
synced 2025-02-12 05:37:04 +00:00
Add unminimize script for reverting minimization on running system
This commit is contained in:
parent
bb7e620701
commit
6672dde922
@ -70,6 +70,36 @@ EOF
|
||||
|
||||
# Remove docs installed by bootstrap
|
||||
Chroot chroot dpkg-query -f '${binary:Package}\n' -W | Chroot chroot xargs apt-get install --reinstall
|
||||
|
||||
# Add unminimizer script which restores default image behavior
|
||||
mkdir -p chroot/usr/local/sbin
|
||||
cat > chroot/usr/local/sbin/unminimize <<'EOF'
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
if [ -f /etc/dpkg/dpkg.cfg.d/excludes ] || [ -f /etc/dpkg/dpkg.cfg.d/excludes.dpkg-tmp ]; then
|
||||
echo "Re-enabling installation of all documentation in dpkg..."
|
||||
if [ -f /etc/dpkg/dpkg.cfg.d/excludes ]; then
|
||||
mv /etc/dpkg/dpkg.cfg.d/excludes /etc/dpkg/dpkg.cfg.d/excludes.dpkg-tmp
|
||||
fi
|
||||
echo "Updating package list and upgrading packages..."
|
||||
apt-get update
|
||||
# apt-get upgrade asks for confirmation before upgrading packages to let the user stop here
|
||||
apt-get upgrade
|
||||
echo "Restoring system documentation..."
|
||||
echo "Reinstalling packages with files in /usr/share/man/ ..."
|
||||
dpkg -S /usr/share/man/ |sed 's|, |\n|g;s|: [^:]*$||' | DEBIAN_FRONTEND=noninteractive xargs apt-get install --reinstall -y
|
||||
echo "Reinstalling packages with system documentaion in /usr/share/doc/ .."
|
||||
dpkg --verify | awk '/..5...... \/usr\/share\/doc/ {print $2}' | sed 's|/[^/]*$||' | sort |uniq \
|
||||
| xargs dpkg -S | sed 's|, |\n|g;s|: [^:]*$||' | uniq | DEBIAN_FRONTEND=noninteractive xargs apt-get install --reinstall -y
|
||||
if dpkg --verify > /dev/null; then
|
||||
echo "Documentation has been restored successfully."
|
||||
rm /etc/dpkg/dpkg.cfg.d/excludes.dpkg-tmp
|
||||
fi
|
||||
fi
|
||||
EOF
|
||||
chmod +x chroot/usr/local/sbin/unminimize
|
||||
fi
|
||||
|
||||
Chroot chroot "dpkg-divert --quiet --add \
|
||||
|
Loading…
x
Reference in New Issue
Block a user