Current location

narf Source control manager Git

aboutsummaryrefslogtreecommitdiff
blob: 8756aa09b0154ce0caccccced2ae394f2662bbaf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
diff --git a/vmdebootstrap b/vmdebootstrap
index 126475f..a32c8f4 100755
--- a/vmdebootstrap
+++ b/vmdebootstrap
@@ -242,10 +242,12 @@ class VmDebootstrap(cliapp.Application):
         self.message('Creating partitions')
         self.runcmd(['parted', '-s', self.settings['image'],
                      'mklabel', 'msdos'])
+        # Start at 0% instead of 0 to allow parted to leave 1MiB for
+        # GRUB
         if self.settings['bootsize'] and self.settings['bootsize'] is not '0%':
             bootsize = str(self.settings['bootsize'] / (1024 * 1024))
             self.runcmd(['parted', '-s', self.settings['image'],
-                         'mkpart', 'primary', 'fat16', '0', bootsize])
+                         'mkpart', 'primary', 'fat16', '0%', bootsize])
         else:
             bootsize = '0%'
         self.runcmd(['parted', '-s', self.settings['image'],
@@ -486,6 +487,7 @@ class VmDebootstrap(cliapp.Application):
             self.runcmd(['chroot', rootdir, 'update-grub'])
             self.runcmd(['chroot', rootdir, 'grub-install', install_dev])
         except cliapp.AppException as e:
+            self.message(str(e))
             self.message("Failed. Is grub2-common installed? Using extlinux.")
         self.runcmd(['umount', os.path.join(rootdir, 'sys')])
         self.runcmd(['umount', os.path.join(rootdir, 'proc')])