[Merge] livecd-rootfs:ui-by-default into livecd-rootfs:ubuntu/master

Ɓukasz Zemczak mp+434682 at code.launchpad.net
Fri Dec 16 10:12:25 UTC 2022


Thanks for the review!

Diff comments:

> diff --git a/live-build/auto/build b/live-build/auto/build
> index 4a0dd31..1466615 100755
> --- a/live-build/auto/build
> +++ b/live-build/auto/build
> @@ -100,20 +104,18 @@ if [ "${IMAGEFORMAT:-}" = "ubuntu-image" ]; then
>  		xz -0 -T4 "$PREFIX".img
>  		mv output/seed.manifest "$PREFIX".manifest
>  	else
> -		# First we need to build the gadget tree
> -		make -C "config/$PREFIX-gadget" \
> -			ARCH=$ARCH SERIES=$SUITE $GADGET_TARGET
> +		env SNAPPY_STORE_NO_CDN=1 \

hm, indeed. Left it as-is because I didn't want to taint the environment outside of this call. But since basically ubuntu-image is the last call livecd-rootfs does, it really makes no sense do not do that!

>  		ubuntu-image classic $UBUNTU_IMAGE_ARGS \
> -			-s $SUITE -p $PROJECT -a $ARCH --subarch $SUBARCH \
> -			-O output config/$PREFIX-gadget/install
> -		# XXX: currently we only have one image generated, but really
> -		#  we should be supporting more than one for models that
> -		#  define those.
> -		mv output/*.img "$PREFIX".img
> -		xz -0 -T4 "$PREFIX".img
> -		# Also link the output image to a filename that cdimage expects
> -		ln "$PREFIX".img.xz livecd.ubuntu-cpc.disk1.img.xz
> -		mv output/filesystem.manifest "$PREFIX".manifest
> +			-O output "$PREFIX".yaml
> +		# Since the output of the ubuntu-image call can vary based on what
> +		# kind of an image we build, the safest bet is to 'export' all the
> +		# artifacts from the output directory. The image definition file
> +		# should be what defines what is expected, so that we don't have
> +		# to tweak livecd-rootfs everytime a different type of artifact
> +		# is needed.
> +		for artifact in output/*; do
> +			mv $artifact $PREFIX.$(basename $artifact)
> +		done
>  	fi
>  
>  	exit 0
> diff --git a/live-build/auto/config b/live-build/auto/config
> index 1722e98..7401b94 100755
> --- a/live-build/auto/config
> +++ b/live-build/auto/config
> @@ -496,37 +488,13 @@ case $IMAGEFORMAT in
>  		else
>  			# classic images
>  
> -			# Certain models have different names but are built from the same source gadget tree
> -			case $MODEL in
> -				pi-arm64|pi3-arm64)
> -					MODEL=pi
> -					;;
> -				intel-iot)
> -					MODEL=pc
> -					;;
> -			esac
> +			DEFINITION="$PROJECT-$MODEL.yaml"
>  
> -			GADGET_TARGET="server"
> -			if [ "$SUBPROJECT" = "desktop-preinstalled" ]; then
> -				GADGET_TARGET="desktop"
> -			fi
> -
> -			UBUNTU_IMAGE_ARGS="$UBUNTU_IMAGE_ARGS${SUBPROJECT:+ --subproject \"$SUBPROJECT\"}"
> -			UBUNTU_IMAGE_ARGS="$UBUNTU_IMAGE_ARGS${PROPOSED:+ --with-proposed}"
> -			UBUNTU_IMAGE_ARGS="$UBUNTU_IMAGE_ARGS${EXTRA_PPAS:+ --extra-ppas \"$EXTRA_PPAS\"}"
> -
> -			# We need to look in two places for the gadget tree:
> -			# - Launchpad hosted gadgets will be in the snap-gadget repo
> -			# - Github hosted gadgets are mirrored into a github-mirror repo
> -			BRANCH="classic"
> -			git clone git://git.launchpad.net/~canonical-foundations/snap-$MODEL/+git/snap-$MODEL -b $BRANCH config/$PREFIX-gadget || git clone git://git.launchpad.net/~canonical-foundations/snap-$MODEL/+git/github-mirror -b $BRANCH config/$PREFIX-gadget || git clone git://git.launchpad.net/~canonical-foundations/snap-$MODEL/+git/github-mirror-$ARCH -b $BRANCH config/$PREFIX-gadget
> -
> -			echo "IMAGEFORMAT=$IMAGEFORMAT" >> config/common
> -			echo "SUITE=$SUITE" >> config/common
> -			echo "GADGET_TARGET=$GADGET_TARGET" >> config/common
> -			echo "UBUNTU_IMAGE_ARGS=\"$UBUNTU_IMAGE_ARGS\"" >> config/common
> -
> -			echo "Configured ubuntu-image for the following gadget model: $MODEL"
> +			git clone git://git.launchpad.net/ubuntu-images -b $SERIES image-definitions

The name can be still adjusted, but Michael seemed to be +1 on it!

> +			cp image-definitions/$DEFINITION "$PREFIX".yaml
> +			echo "Configured ubuntu-image for the following image-definition:"
> +			cat "$PREFIX".yaml
> +			echo "----------------------------------------------------------"
>  		fi
>  
>  		# Save the model name used for building, mostly for any model-specific hook execution


-- 
https://code.launchpad.net/~ubuntu-core-dev/livecd-rootfs/+git/livecd-rootfs/+merge/434682
Your team Ubuntu Core Development Team is requested to review the proposed merge of livecd-rootfs:ui-by-default into livecd-rootfs:ubuntu/master.




More information about the Ubuntu-reviews mailing list