Improve resize2fs call for root.img resize

1. Do not start GUI session - to reduce startup time
2. Use user="root" instead of sudo - not all templates have sudo
installed (for example fedora-21-minimal)
3. Add missing wait=True - otherwise VM may be shutdown during the
operation.

QubesOS/qubes-issues#1268
This commit is contained in:
Marek Marczykowski-Górecki 2015-11-07 04:19:20 +01:00
parent cfe782f04a
commit cf6c6baded
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -58,8 +58,9 @@ class QubesResizableVmWithResize2fs(QubesResizableVm):
def resize_root_img(self, size): def resize_root_img(self, size):
super(QubesResizableVmWithResize2fs, self).resize_root_img(size) super(QubesResizableVmWithResize2fs, self).resize_root_img(size)
self.start() self.start(start_guid=False)
self.run("sudo resize2fs /dev/mapper/dmroot") self.run("resize2fs /dev/mapper/dmroot", user="root", wait=True,
gui=False)
self.shutdown() self.shutdown()