From 8855f0519193c07d8ba9030b8f2b5aec1744c664 Mon Sep 17 00:00:00 2001 From: Steve Langasek Date: Fri, 9 Sep 2016 15:56:47 -0700 Subject: [PATCH] live-build/ubuntu-cpc/hooks/042-vagrant.binary: fix unmount handling so that the teardown is done properly /before/ we try to make an image from our filesystem, since otherwise /etc/resolv.conf is broken. LP: #1621393. --- debian/changelog | 7 +++++++ live-build/ubuntu-cpc/hooks/042-vagrant.binary | 6 +++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index c664e81a..efecc985 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,11 +1,18 @@ livecd-rootfs (2.430) UNRELEASED; urgency=medium + [ Michael Vogt ] * live-build/ubuntu-core/hooks/01-setup_user.chroot: - do not create "ubuntu" user for ubuntu-core anymore, the console-conf package will create this user now * live-build/ubuntu-core/hooks/02-add_user_to_groups.chroot - dropped + [ Steve Langasek ] + * live-build/ubuntu-cpc/hooks/042-vagrant.binary: fix unmount handling + so that the teardown is done properly /before/ we try to make an + image from our filesystem, since otherwise /etc/resolv.conf is broken. + LP: #1621393. + -- Michael Vogt Fri, 02 Sep 2016 17:03:57 +0200 livecd-rootfs (2.429) yakkety; urgency=medium diff --git a/live-build/ubuntu-cpc/hooks/042-vagrant.binary b/live-build/ubuntu-cpc/hooks/042-vagrant.binary index 6fd02d9c..ca08e44e 100755 --- a/live-build/ubuntu-cpc/hooks/042-vagrant.binary +++ b/live-build/ubuntu-cpc/hooks/042-vagrant.binary @@ -39,7 +39,9 @@ create_derivative "disk" "vagrant" #sets ${derivative_img} mount_disk_image ${derivative_img} ${mount_d} cleanup_vagrant() { - umount_disk_image ${mount_d} + if [ -d "$mount_d" ]; then + umount_disk_image "$mount_d" + fi rm -rf ${box_d} ${seed_d} ${mount_d} ${derivative_img} } trap cleanup_vagrant EXIT @@ -49,6 +51,8 @@ chroot ${mount_d} apt-get update # avoid pulling into a cloud image. chroot ${mount_d} apt-get install --no-install-recommends -y virtualbox-guest-utils chroot ${mount_d} apt-get clean +umount_disk_image "$mount_d" +rmdir "$mount_d" # Used to identify bits suite=$(chroot chroot lsb_release -c -s)