fix(HyperV desktop): Re-enable ability to build HyperV desktop images (LP: #2064280)

We have not built Hyperv desktop images since Jammy and with the re-introduction of HyperV for Noble we have encountered build issues caused by refactoring and removals of code assumed to be redundant but the HyperV desktop images were actually using these code paths.

In bbedffe6 we split the building of cloud images and non cloud to using an ddisk-image-uefi.binary and disk-image-uefi-non-cloud.binary respectively. In e38264ca there was a change which meant that any attempt to build hyperv images would result in incorrect disk size and incorrect disk label.

This has been fixed by ensuring that the ubuntu:desktop-preinstalled $PROJECT:$SUBPROJECT matches and sets the correct disk size and correct disk label.

A change in 76d79466 changed the logic of how the image size for amd64 images were being set. This overrode the sizes set for the desktop images incorrectly.

This commit ensures that any desktop image being created uses the correct image size.
ubuntu-core-lxd-qcow2
Phil Roche 8 months ago committed by Philip Roche
parent e001491e47
commit 48aed40194

@ -9,21 +9,6 @@ case $ARCH in
;; ;;
esac esac
case ${PROJECT:-}:${SUBPROJECT:-} in
ubuntu:)
echo "We don't create EFI images for Ubuntu Desktop."
exit 0
;;
ubuntu)
IMAGE_STR="# DESKTOP_IMG: This file was created/modified by the Desktop Image build process"
FS_LABEL="desktop-rootfs"
IMAGE_SIZE=12884901888 # 12G
;;
*)
IMAGE_STR="# CLOUD_IMG: This file was created/modified by the Cloud Image build process"
FS_LABEL="cloudimg-rootfs"
;;
esac
if [ "$ARCH" = "amd64" ]; then if [ "$ARCH" = "amd64" ]; then
IMAGE_SIZE=3758096384 # bump to 3.5G (3584*1024**2); Since Kinetic amd64 need more then the default 2.2G IMAGE_SIZE=3758096384 # bump to 3.5G (3584*1024**2); Since Kinetic amd64 need more then the default 2.2G
@ -44,6 +29,22 @@ if [ "$ARCH" = "riscv64" ]; then
IMAGE_SIZE=4831838208 # bump to 4.5G (4608*1024**2); initrd creation fails with "No space left" with 3.5G IMAGE_SIZE=4831838208 # bump to 4.5G (4608*1024**2); initrd creation fails with "No space left" with 3.5G
fi fi
case ${PROJECT:-}:${SUBPROJECT:-} in
ubuntu:)
echo "We don't create EFI images for Ubuntu Desktop."
exit 0
;;
ubuntu|ubuntu:desktop-preinstalled)
IMAGE_STR="# DESKTOP_IMG: This file was created/modified by the Desktop Image build process"
FS_LABEL="desktop-rootfs"
IMAGE_SIZE=12884901888 # 12G
;;
*)
IMAGE_STR="# CLOUD_IMG: This file was created/modified by the Cloud Image build process"
FS_LABEL="cloudimg-rootfs"
;;
esac
. config/binary . config/binary
. config/functions . config/functions

Loading…
Cancel
Save