mirror of
https://git.launchpad.net/livecd-rootfs
synced 2025-02-13 06:17:08 +00:00
It was reported and confirmed in LP bug #1875400 (https://bugs.launchpad.net/cloud-images/+bug/1875400) that on the public KVM cloud image there exists a large list of packages marked for auto-removal. This should never be the case on a released cloud image. These packages are marked for auto-removal because in the KVM image binary hook we removed both initramfs-tools and busybox-initramfs packages. Due to package dependencies this also removed: busybox-initramfs* cloud-initramfs-copymods* cloud-initramfs-dyn-netconf* cryptsetup-initramfs* initramfs-tools* initramfs-tools-core* multipath-tools* overlayroot* sg3-utils-udev* ubuntu-server* But it did not remove all the packages that the above list depended on. This resulted in all those packages being marked for auto-removal because they were not manually installed nor did they have any manually installed packages that depended on them. The removal of initramfs-tools and busybox-initramfs was to avoid the generation of initramfs in images that should boot initramfsless. This requirement is obsolete now because the initramfsless boot handling is now handled via setting GRUB_FORCE_PARTUUID in /etc/default/grub.d/40-force-partuuid.cfg. In test images I have verified that GRUB_FORCE_PARTUUID is set and that boot speeds have not regressed. LP: #1880170
67 lines
1.5 KiB
Bash
Executable File
67 lines
1.5 KiB
Bash
Executable File
#!/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}"
|
|
|
|
env DEBIAN_FRONTEND=noninteractive chroot "${mount_d}" rm \
|
|
-rf /boot/initrd.img-* /boot/initrd.img
|
|
|
|
# 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
|