You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
livecd-rootfs/live-build/ubuntu-server/hooks/01-unminimize.chroot_early

31 lines
1.0 KiB

#!/bin/bash
set -ex
case ${PASS} in
ubuntu-server-minimal.ubuntu-server)
;;
*)
exit 0
;;
esac
# The unminimize script will try to install the lxd snap using the shim script
# /usr/sbin/lxd from the lxd-installer package.
# We can't do that at this stage so just neuter the lxd command (the snap
# will get properly seeded by generic machinery).
if [ -f "/usr/sbin/lxd" ]; then
rm --verbose --force /usr/sbin/lxd
ln -s /bin/true /usr/sbin/lxd
yes | /usr/local/sbin/unminimize
# unminimize also uninstalls lxd-installer package
# and also removed `/usr/sbin/lxd` as a result so we don't need to restore
else
# if /usr/sbin/lxd doesn't exist when lxd-installer package isn't installed so we can mock the command
# to avoid the unminimize script failing
ln -s /bin/true /usr/sbin/lxd
yes | /usr/local/sbin/unminimize
# as the lxd-installer package was not installed and thus not removed the mock
# /usr/sbin/lxd will still be present so we need to remove it
rm --verbose --force /usr/sbin/lxd
fi