lp:cloud-utils

Created by Scott Moser on 2011-05-27 and last modified on 2016-10-24
Get this branch:
bzr branch lp:cloud-utils
Members of cloud-utils development can upload to this branch. Log in for directions.

Branch merges

Related bugs

Related blueprints

Branch information

Owner:
cloud-utils development
Project:
cloud-utils
Status:
Development

Recent revisions

313. By Scott Moser on 2016-10-24

mount-image-callback: update usage to mention 'mchroot'

312. By Scott Moser on 2016-10-24

mount-image-callback: support 'chroot' to lxd containers

This adds support for mount-image-callback to do its magic on a
local lxd container.

  $ lxc init ubuntu-daily:xenial mic-test
  $ sudo mount-image-callback mic-test -- apt-get update -q
  $ sudo ./bin/mount-image-callback lxd:mic-test --system-resolvconf -- \
       mchroot apt-get update -q

In doing so, it adds some helpers to the PATH before executing the
command provided:
  uns-switch: switch to the appropriate lxc namespace
  mchroot: chroot into the _MOUNTPOINT_ (automatically calls uns-switch)

311. By Scott Moser on 2016-10-05

test/test-mic: tests for unmounting unexpected mounts and system-mounts.

these 2 tests verify that
 - "unexpected" mounts under the mount point get unmounted.
   mounts not made by mount-image-callback should still get unmounted.
 - tests that --system-mounts works as expected.

310. By Scott Moser on 2016-10-05

bin/mount-image-callback: do unmounts in reverse order.

This still uses umount_r which unmounts under the mount point
recursively. The reason for doing it in reverse order is so
that umount_r can be expected to have done something.

Rather than
  mount -o loop img my-dir
  mount --bind /dev my-dir/dev
  mount --bind /sys my-dir/sys
Then
  umount_r my-dir
We do:
  umount_r my-dir/sys
  umount_r my-dir/dev
  umount_r my-dir

309. By Scott Moser on 2016-10-05

remove unused variable

308. By Scott Moser on 2016-10-05

test: improve test-mic to create both GPT and MBR disks

307. By Scott Moser on 2016-10-05

separate nbd out of main.

This is really all just cosmetic, moving the big hunk of main
that handled mounting a nbd device via qemu-nbd into a set of functions.

Also:
 - use 'mount -o loop,ro' on unpartitioned image mounts when
   the user passed --read-only.
 - only attempt mount -o loop if --part=0 or --part=auto
 - remove 'mp_is_tmp'. Instead just clean up tempdir.

306. By Scott Moser on 2016-10-04

debian/control: update standards version

305. By Scott Moser on 2016-10-04

debian/copyright: fix lintian file-without-copyright-information.

304. By Scott Moser on 2016-10-04

mount-image-callback: try mounting overlay rather than checking first

The logic to determine if mount would work was flawed in it assumed
that both or neither of the following would succeed:
  modprobe --quiet --use-blacklist fstype
  mount -t fstype would succeed

That logic failed when modprobe could not load the module due to
being in a chroot or some other reason. The change here is to just
do try the mount. In order to avoid confusing output about trying
to mount overlayfs we first try mounting overlay. If that fails
and 'overlay' seems present in /proc/filesystems, then do not bother
trying to mount overlayfs.

Branch metadata

Branch format:
Branch format 7
Repository format:
Bazaar repository format 2a (needs bzr 1.16 or later)
This branch contains Public information 
Everyone can see this information.