~ubuntubudgie-dev/livecd-rootfs/ubuntu-budgie-proposal.zesty

« back to all changes in this revision

Viewing changes to live-build/ubuntu-cpc/hooks/042-vagrant.binary

  • Committer: Steve Langasek
  • Date: 2016-09-09 22:56:47 UTC
  • Revision ID: steve.langasek@canonical.com-20160909225647-jaqdmr0n2c6c5idh
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.

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
mount_disk_image ${derivative_img} ${mount_d}
40
40
 
41
41
cleanup_vagrant() {
42
 
    umount_disk_image ${mount_d}
 
42
    if [ -d "$mount_d" ]; then
 
43
        umount_disk_image "$mount_d"
 
44
    fi
43
45
    rm -rf ${box_d} ${seed_d} ${mount_d} ${derivative_img}
44
46
}
45
47
trap cleanup_vagrant EXIT
49
51
# avoid pulling into a cloud image.
50
52
chroot ${mount_d} apt-get install --no-install-recommends -y virtualbox-guest-utils
51
53
chroot ${mount_d} apt-get clean
 
54
umount_disk_image "$mount_d"
 
55
rmdir "$mount_d"
52
56
 
53
57
# Used to identify bits
54
58
suite=$(chroot chroot lsb_release -c -s)