summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorNeil Williams <codehelp@debian.org>2015-08-17 13:16:35 +0200
committerNeil Williams <codehelp@debian.org>2015-08-18 11:12:41 +0200
commitbc7ef0f9a3df88424ab594fe13a4322b408f6718 (patch)
treedf2f1f0a7b8fe661a083e059eb923e8a280080bd /bin
parent54212e6812319e288a9ecd1a4d032b23ea9ae4ea (diff)
downloadvmdebootstrap-bc7ef0f9a3df88424ab594fe13a4322b408f6718.tar.gz
check that the ESP is mounted before trying to configure
Diffstat (limited to 'bin')
-rwxr-xr-xbin/vmdebootstrap12
1 files changed, 11 insertions, 1 deletions
diff --git a/bin/vmdebootstrap b/bin/vmdebootstrap
index b13d976..2dc46a4 100755
--- a/bin/vmdebootstrap
+++ b/bin/vmdebootstrap
@@ -260,11 +260,15 @@ class VmDebootstrap(cliapp.Application): # pylint: disable=too-many-public-meth
rootdir = self.mount(rootdev)
filesystem.devices['rootdir'] = rootdir
if self.settings['use-uefi']:
- self.mount(bootdev, uefi.prepare_esp(rootdir, bootdev))
+ self.bootdir = uefi.prepare_esp(rootdir, bootdev)
+ logging.debug("mounting %s", self.bootdir)
+ self.mount(bootdev, self.bootdir)
+ logging.debug(runcmd(['mount']))
elif bootdev:
boottype = self.settings['boottype']
filesystem.mkfs(bootdev, fstype=boottype)
self.bootdir = '%s/%s' % (rootdir, 'boot/')
+ filesystem.devices['bootdir'] = self.bootdir
os.mkdir(self.bootdir)
self.mount(bootdev, self.bootdir)
@@ -278,6 +282,12 @@ class VmDebootstrap(cliapp.Application): # pylint: disable=too-many-public-meth
uefi = self.handlers[Uefi.name]
filesystem = self.handlers[Filesystem.name]
if self.settings['use-uefi']:
+ bootdir = self.bootdir
+ logging.debug("rootdir=%s rootdev=%s bootdir=%s", rootdir, rootdev, bootdir)
+ logging.debug(runcmd(['mount']))
+ if not os.path.ismount(bootdir):
+ self.logging.warning("%s had to be remounted", bootdir)
+ self.mount(bootdir)
grub.install_grub_uefi(rootdir)
uefi.configure_efi(rootdir)
grub.install_extra_grub_uefi(rootdir)