[Merge] ~itrue/livecd-rootfs:add-nemos-support-v5 into livecd-rootfs:ubuntu/master

Loïc Minier mp+455293 at code.launchpad.net
Tue Nov 7 16:38:26 UTC 2023


Review: Approve

LGTM, if this builds working images we should upload to noble

Diff comments:

> diff --git a/live-build/auto/build b/live-build/auto/build
> index 787ac9c..5ecc33c 100755
> --- a/live-build/auto/build
> +++ b/live-build/auto/build
> @@ -128,6 +128,67 @@ if [ "${IMAGEFORMAT:-}" = "ubuntu-image" ]; then
>  	fi
>  
>  	exit 0
> +elif [ "${IMAGEFORMAT:-}" = "kiwi" ]; then
> +	# Install Kiwi dependencies

# "...and all image definition files"

> +	DEBIAN_FRONTEND=noninteractive apt install -y \
> +		kiwi kiwi-systemdeps nemos-images-${SUITE}
> +
> +	# Kiwi refers to target build configurations as "descriptions". These
> +	# descriptions are XML files (generally called either "appliance.kiwi"
> +	# or "config.xml" and reside in a folder alongside any additional
> +	# scripts and files that are needed by the target system. This can
> +	# include any arbitrary script that will be executed inside a chroot
> +	# environment. The caller must specify the folder the description
> +	# resides in, rather than the file itself, due to the way Kiwi works.
> +
> +	if [ -z "${KIWI_ROOT:-}" ]; then
> +		KIWI_ROOT="/usr/share/kiwi"

always set by /config step, so shouldn't be needed in /build?

> +	fi
> +
> +	# Combine all of the parameters derived in the config script to
> +	# get the full path to the Kiwi description.
> +	KIWI_PROJECT_PATH="${KIWI_ROOT}/${KIWI_PROJECT}"
> +	KIWI_DESCRIPTION="${KIWI_PROJECT_PATH}/${KIWI_PLATFORM}"
> +	if [ ! -e "${KIWI_DESCRIPTION}/appliance.kiwi" ] &&
> +		[ ! -e "${KIWI_DESCRIPTION}/config.xml" ]; then
> +		echo "Kiwi error: appliance description not found in path " \
> +			"\"${KIWI_DESCRIPTION}\""
> +		exit 1
> +	fi
> +
> +	# Kiwi provides a variety of configuration options for the build
> +	# system that are not a part of the image configuration itself, and
> +	# instead need to be managed using a YAML file.
> +	# Check if the platform provides a specific configuration file.
> +	# Otherwise, check if the project provides one.
> +	if [ -e "${KIWI_DESCRIPTION}/kiwi.yaml" ]; then
> +		KIWI_CONFIG="--config ${KIWI_DESCRIPTION}/kiwi.yaml"
> +	elif [ -e "${KIWI_PROJECT_PATH}/kiwi.yaml" ]; then
> +		KIWI_CONFIG="--config ${KIWI_PROJECT_PATH}/kiwi.yaml"
> +	fi
> +
> +	# Kiwi allows the use of different profiles inside the description
> +	# file. This allows different configuration blocks to be disabled or
> +	# enabled at build-time. This is derived from the SUBPROJECT in the
> +	# config script.
> +	if [ -n "${KIWI_PROFILE:-}" ]; then
> +		KIWI_PROFILE="--profile ${KIWI_PROFILE}"
> +	fi
> +
> +	# Run the Kiwi build. Not that the output directory must not exist
> +	# before this runs, otherwise Kiwi will complain and exit
> +	kiwi-ng --debug ${KIWI_CONFIG:-} ${KIWI_PROFILE:-} \
> +		build --description "${KIWI_DESCRIPTION}" \
> +		--target-dir output
> +
> +	# Move the files around so that we have the same output as ubuntu-image
> +	mv output/*.raw "${PREFIX}".img
> +	xz -0 -T4 "${PREFIX}".img
> +
> +	# Also link the output image to a filename that cdimage expects
> +	ln "${PREFIX}".img.xz "livecd.${PROJECT}.disk1.img.xz"
> +
> +	exit 0
>  fi
>  
>  # Setup cleanup function
> diff --git a/live-build/auto/config b/live-build/auto/config
> index 75338ec..30d4fc8 100755
> --- a/live-build/auto/config
> +++ b/live-build/auto/config
> @@ -529,6 +577,48 @@ case $IMAGEFORMAT in
>  		exit 0
>  		;;
>  
> +	kiwi)
> +		if [ -z "${KIWI_PLATFORM}" ]; then
> +			echo "KIWI_PLATFORM must be set when IMAGEFORMAT=kiwi"
> +			exit 1
> +		fi
> +
> +		if [ -z "${KIWI_PROJECT}" ]; then
> +			echo "KIWI_PROJECT must be set when IMAGEFORMAT=kiwi"
> +			exit 1
> +		fi
> +
> +		if [ -z "${SUITE}" ]; then
> +			echo "SUITE must be set when IMAGEFORMAT=kiwi"
> +			exit 1
> +		fi
> +
> +		if [ -z "${KIWI_ROOT}" ]; then
> +			KIWI_ROOT="/usr/share/kiwi/${PROJECT}"
> +		fi
> +
> +		echo "KIWI_PLATFORM=\"${KIWI_PLATFORM}\"" >> config/common
> +		echo "KIWI_PROFILE=\"${KIWI_PROFILE:-}\"" >> config/common
> +		echo "KIWI_PROJECT=\"${KIWI_PROJECT}-${SUITE}\"" >> config/common
> +		echo "KIWI_ROOT=\"${KIWI_ROOT}\"" >> config/common
> +		echo "IMAGEFORMAT=\"${IMAGEFORMAT}\"" >> config/common
> +		echo "SUITE=$SUITE" >> config/common
> +		echo "ARCH=$ARCH" >> config/common
> +
> +		echo "Kiwi configuration:"
> +		echo "  Platform:      ${KIWI_PLATFORM}"
> +		echo "  Project:       ${KIWI_PROJECT}"
> +		echo "  Project root:  ${KIWI_ROOT}"
> +		echo "  Build profile: ${KIWI_PROFILE:-none}"

"none set, using default"

> +
> +		# Fake finished configuration for lb build
> +		mkdir -p .build
> +		touch .build/config
> +
> +		# No further configuration needed
> +		exit 0
> +		;;
> +
>  	none)
>  		# Currently the IMAGEFORMAT none format is used only for ubuntu-image
>  		# targeted image builds which, currently, only target physical devices.


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




More information about the Ubuntu-reviews mailing list