Merge branch 'enhance-minimize' into ubuntu/master

* enhance-minimize:
  Install linux-virtual to restore the stripped headers
  Enhance unminimize to transform into a base image for ubuntu-cpc
ubuntu/mantic
Utkarsh Gupta 1 year ago
commit 75db56ce61

@ -292,6 +292,23 @@ if dpkg-query --show --showformat='${db:Status-Status}\n' ubuntu-server 2> /dev/
DEBIAN_FRONTEND=noninteractive apt-get install -y landscape-common
fi
EOF
if [ "$PROJECT" = "ubuntu-cpc" ]; then
# we'd like to transform a minimized image to a base image
# when unminimize is run.
cat >> chroot/usr/local/sbin/unminimize <<'EOF'
# even if ubuntu-server is installed, we should re-install it with --fix-policy --install-recommends
# to ensure all the Recommends of dependencies of ubuntu-server are installed, which aids in transforming
# this minimized image to an equivalent base image.
DEBIAN_FRONTEND=noninteractive apt-get --reinstall --fix-policy --install-recommends install -y ubuntu-server
if dpkg-query --show --showformat='${db:Status-Status}\n' linux-image-virtual 2> /dev/null | grep -q '^installed$'; then
echo "Installing linux-virtual for installing the headers which were stripped in a minimized image"
DEBIAN_FRONTEND=noninteractive apt-get install -y linux-virtual
fi
EOF
fi
if [ "$PROJECT" = "ubuntu-cpc" ] || [ "$PROJECT" = "ubuntu-server" ]; then
cat >> chroot/usr/local/sbin/unminimize <<'EOF'

Loading…
Cancel
Save