summaryrefslogtreecommitdiff
path: root/vmdebootstrap
diff options
context:
space:
mode:
authorNeil Williams <codehelp@debian.org>2015-05-02 20:52:25 +0100
committerNeil Williams <codehelp@debian.org>2015-05-02 20:52:25 +0100
commit6200c39f9d232d7b4b34b8104b04eab1000dc544 (patch)
tree91cbf568593042e0d4155e4dc53d62f25e1ba02c /vmdebootstrap
parent94d2cded1ec9cb98a2f1f9b0fe34d64fec1cc1f9 (diff)
downloadvmdebootstrap-6200c39f9d232d7b4b34b8104b04eab1000dc544.tar.gz
Set a default boot partition offset with grub
Installing grub with boot partition requires an offset before the first partition. Closes: #782307.
Diffstat (limited to 'vmdebootstrap')
-rwxr-xr-xvmdebootstrap2
1 files changed, 2 insertions, 0 deletions
diff --git a/vmdebootstrap b/vmdebootstrap
index 1b863e8..91dc802 100755
--- a/vmdebootstrap
+++ b/vmdebootstrap
@@ -333,6 +333,8 @@ class VmDebootstrap(cliapp.Application): # pylint: disable=too-many-public-meth
partoffset = self.settings['bootoffset'] / (1024 * 1024)
self.message("Using bootoffset: %smib %s bytes" % (partoffset, self.settings['bootoffset']))
if self.settings['bootsize'] and self.settings['bootsize'] is not '0%':
+ if self.settings['grub'] and not partoffset:
+ partoffset = 1
bootsize = self.settings['bootsize'] / (1024 * 1024)
bootsize += partoffset
self.message("Using bootsize %smib: %s bytes" % (bootsize, self.settings['bootsize']))