Deprecate linux-kvm usage

Remove kvm-image altogether.

Previously for minimal image replace_kernel function replaced virtual
images with kvm, and called force_boot_without_initramfs. Now simply
call force_boot_without_initramfs for minimal image without replacing
kernel flavour.

This also means minimal images can now be built for arm64 and armhf.

Signed-off-by: Dimitri John Ledkov <dimitri.ledkov@canonical.com>
xnox/deprecate-kvm
Dimitri John Ledkov 2 years ago
parent e1f18982e6
commit dc59fe83ca

@ -485,10 +485,9 @@ EOF
chroot mountpoint grub-install --target=i386-pc "${loop_device}" chroot mountpoint grub-install --target=i386-pc "${loop_device}"
fi fi
# Use the linux-kvm kernel for minimal images where available # Use initrdless boot for minimal images
# linux-kvm currently only exists for amd64 if [ "${SUBPROJECT:-}" = "minimized" ]; then
if [ "${SUBPROJECT:-}" = "minimized" ] && [ "$ARCH" = "amd64" ]; then force_boot_without_initramfs ${mountpoint}
replace_kernel mountpoint linux-kvm
fi fi
# This call to rewrite the debian package manifest is added here to capture # This call to rewrite the debian package manifest is added here to capture

@ -131,10 +131,9 @@ if [ "${should_install_grub}" -eq 1 ]; then
rm mountpoint/tmp/device.map rm mountpoint/tmp/device.map
fi fi
# Use the linux-kvm kernel for minimal images where available # Use initrdless boot for minimal images
# linux-kvm currently only exists for amd64 if [ "${SUBPROJECT:-}" = "minimized" ]; then
if [ "${SUBPROJECT:-}" = "minimized" ] && [ "$ARCH" = "amd64" ]; then force_boot_without_initramfs ${mountpoint}
replace_kernel mountpoint linux-kvm
fi fi
if [ "$ARCH" = "s390x" ]; then if [ "$ARCH" = "s390x" ]; then

@ -1,63 +0,0 @@
#!/bin/bash -eux
# vi: ts=4 expandtab
#
# Generate KVM image
#
echo "Building KVM image"
IMAGE_STR="# CLOUD_IMG: This file was created/modified by the Cloud Image build process"
case ${SUBPROJECT:-} in
minimized)
echo "Skipping minimized $0 builds"
exit 0
;;
*)
;;
esac
# Only allow amd64 builds for now
case $ARCH in
amd64)
;;
*)
echo "Linux KVM images are not supported for $ARCH yet.";
exit 0;;
esac
. config/functions
mount_d=$(mktemp -d)
create_derivative uefi kvm #sets ${derivative_img}
mount_disk_image ${derivative_img} ${mount_d}
# unmount disk image and remove created folders on exit
# even though we unmount manually before we convert to
# qcow2, we have this here just in case we error out before
# that step
cleanup_kvm() {
if [ -d "$mount_d" ]; then
umount_disk_image "$mount_d"
fi
rm -rf ${mount_d} ${derivative_img}
}
trap cleanup_kvm EXIT
divert_grub "${mount_d}"
replace_kernel ${mount_d} "linux-kvm"
chroot "${mount_d}" update-grub
undivert_grub "${mount_d}"
# Remove indices
env DEBIAN_FRONTEND=noninteractive chroot "${mount_d}" apt-get \
clean
create_manifest ${mount_d} livecd.ubuntu-cpc.disk-kvm.manifest
# unmount disk image to prevent corruption
# and remove it so the trap doesn't try to unmount it again
umount_disk_image ${mount_d}
rm -rf ${mount_d}
convert_to_qcow2 ${derivative_img} livecd.ubuntu-cpc.disk-kvm.img

@ -1,5 +0,0 @@
depends disk-image
base/kvm-image.binary
provides livecd.ubuntu-cpc.disk-kvm.img
provides livecd.ubuntu-cpc.disk-kvm.manifest
provides livecd.ubuntu-cpc.disk-kvm.filelist
Loading…
Cancel
Save