[Merge] ~mwhudson/livecd-rootfs/+git/livecd-rootfs:no-snaps-ubuntu-cpc-minimized into livecd-rootfs:ubuntu/master

Michael Hudson-Doyle mwhudsonlp at fastmail.fm
Tue Mar 12 07:43:00 UTC 2019



Diff comments:

> diff --git a/live-build/auto/build b/live-build/auto/build
> index b4bd009..1750608 100755
> --- a/live-build/auto/build
> +++ b/live-build/auto/build
> @@ -226,7 +226,14 @@ if dpkg-query --show --showformat='${db:Status-Status}\n' ubuntu-server 2> /dev/
>  fi
>  EOF
>  fi
> -                cat >> chroot/usr/local/sbin/unminimize <<'EOF'
> +		if [ "$PROJECT" = "ubuntu-cpc" ]; then
> +			cat >> chroot/usr/local/sbin/unminimize <<'EOF'
> +
> +echo "Installing lxd from snap..."
> +snap install lxd
> +EOF
> +		fi

Well, maybe. I had the lxd-installer package clean up after itself at one point[1] but that had the side effect that the second time you invoked lxc, bash complains at you because of bash's caching of binary locations. Maybe having to run hash -r after unminimize it a bit less surprising.

[1] which was harder than I expected because if you run "apt-get remove $package" from a service that's part of $package, the systemd bits inc. cgroup containing the service all get torn down and you end up with dpkg getting interrupted...

> +		cat >> chroot/usr/local/sbin/unminimize <<'EOF'
>  
>  # unminimization succeeded, there is no need to mention it in motd
>  rm -f /etc/update-motd.d/60-unminimize
> diff --git a/live-build/auto/config b/live-build/auto/config
> index 2626229..2896470 100755
> --- a/live-build/auto/config
> +++ b/live-build/auto/config
> @@ -806,7 +806,7 @@ case $PROJECT in
>  	ubuntu-cpc)
>  		if [ "${SUBPROJECT:-}" = minimized ]; then
>  			add_task install cloud-image
> -			add_package install sudo
> +			add_package install sudo lxd-installer

Yes. I didn't want to bother some poor innocent AA with it until this branch got at least some kind of positive feedback :) Did you see the link to the package in the MP description?

>  			# linux-kvm currently only exists for amd64, so fall back to the
>  			# virtual flavour for other architectures
>  			if [ "$ARCH" = "amd64" ]; then
> @@ -895,6 +895,22 @@ esac
>  if [ "$PASSES_TO_LAYERS" != "true" ] && [ -n "${BASE_SEED}" ]; then
>  	snap_from_seed "${BASE_SEED}" config/seeded-snaps
>  fi
> +if [ "$PROJECT:${SUBPROJECT:-}" = ubuntu-cpc:minimized ]; then
> +	# We install a lxc script that installs the snap when invoked. We don't
> +	# want any other snaps to come in without due consideration, so fail the
> +	# build if we see such a snap.
> +	for snap in `cat config/seeded-snaps`; do
> +		case $snap in
> +			lxd)
> +				;;
> +			*)
> +				echo "Unexpected seeded snap for ubuntu-cpc:minimized build: $snap"
> +				exit 1
> +				;;

Yes, and those hooks will probably need fixing. But that can wait until this branch gets approved.

> +		esac
> +	done
> +	rm config/seeded-snaps
> +fi
>  
>  # grab a list of packags to remove for a "minimal" installation from the seed
>  # mirror for this project


-- 
https://code.launchpad.net/~mwhudson/livecd-rootfs/+git/livecd-rootfs/+merge/364222
Your team Ubuntu Core Development Team is subscribed to branch livecd-rootfs:ubuntu/master.



More information about the Ubuntu-reviews mailing list