mirror of
https://git.launchpad.net/livecd-rootfs
synced 2025-05-28 11:11:31 +00:00
Unmount the image before we convert to qcow2 to avoid corruption
This commit is contained in:
parent
9bf4c7cb52
commit
514a83b926
@ -32,6 +32,9 @@ create_derivative "disk" "kvm" #sets ${derivative_img}
|
|||||||
mount_disk_image ${derivative_img} ${mount_d}
|
mount_disk_image ${derivative_img} ${mount_d}
|
||||||
|
|
||||||
# unmount disk image and remove created folders on exit
|
# 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() {
|
cleanup_kvm() {
|
||||||
if [ -d "$mount_d" ]; then
|
if [ -d "$mount_d" ]; then
|
||||||
umount_disk_image "$mount_d"
|
umount_disk_image "$mount_d"
|
||||||
@ -61,4 +64,10 @@ env DEBIAN_FRONTEND=noninteractive chroot "${mount_d}" apt-get \
|
|||||||
clean
|
clean
|
||||||
|
|
||||||
create_manifest ${mount_d} livecd.ubuntu-cpc.disk-kvm.manifest
|
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
|
convert_to_qcow2 ${derivative_img} livecd.ubuntu-cpc.disk-kvm.img
|
Loading…
x
Reference in New Issue
Block a user