diff options
author | Neil Williams <codehelp@debian.org> | 2016-07-31 22:23:18 +0100 |
---|---|---|
committer | Neil Williams <codehelp@debian.org> | 2016-07-31 22:23:18 +0100 |
commit | 479f2395ba42813e284a15e442c38b8536155ce8 (patch) | |
tree | c49d7d93f896a2285fecc7d9d14cd21a2ab7370a /bin | |
parent | 5c0f1d11fb1bdeceffc0aa28e19673c82663a9ab (diff) | |
download | vmdebootstrap-479f2395ba42813e284a15e442c38b8536155ce8.tar.gz |
Update and expand the build tests
Still issues to fix with some of the scenarios
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/vmdebootstrap | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/bin/vmdebootstrap b/bin/vmdebootstrap index 799fbd3..cb98cd4 100755 --- a/bin/vmdebootstrap +++ b/bin/vmdebootstrap @@ -228,11 +228,12 @@ class VmDebootstrap(cliapp.Application): # pylint: disable=too-many-public-meth if self.settings['swap'] > 0: base.message("Creating swap space") runcmd(['mkswap', filesystem.devices['swapdev']]) - # stable or oldstable, use ^metadata_csum + # stable or oldstable, use ^metadata_csum only for ext* opt = None if distro.was_oldstable(datetime.date(2015, 4, 26)) or \ distro.was_stable(datetime.date(2015, 4, 26)): - opt = "^metadata_csum" + if self.settings['roottype'] in ['ext2', 'ext3', 'ext4']: + opt = "^metadata_csum" filesystem.mkfs(rootdev, fstype=roottype, opt=opt) rootdir = self.mount(rootdev) filesystem.devices['rootdir'] = rootdir @@ -567,18 +568,20 @@ class VmDebootstrap(cliapp.Application): # pylint: disable=too-many-public-meth # Umount in the reverse mount order if self.settings['image']: self.umount() + time.sleep(2) # tidy up loop mounting issues on failure. out = runcmd(['losetup', '-a']) rootdev = filesystem.devices['rootdev'] if rootdev: - runcmd(['dmsetup', 'remove', rootdev]], ignore_fail=True) + runcmd(['dmsetup', 'remove', rootdev], ignore_fail=True) device = [line.decode('utf-8').split()[0][:-1] for line in out.splitlines() if self.settings['image'] in line.decode('utf-8')] if device: runcmd(['losetup', '-d', "%s" % device[0]], ignore_fail=True) runcmd(['kpartx', '-d', self.settings['image']], ignore_fail=True) + time.sleep(2) for dirname in self.remove_dirs: shutil.rmtree(dirname) |