]> git.siccegge.de Git - forks/vmdebootstrap.git/commitdiff
add mbr back to support extlinux and check for installation of mbr.
authorNeil Williams <codehelp@debian.org>
Sat, 27 Dec 2014 10:12:07 +0000 (10:12 +0000)
committerNeil Williams <codehelp@debian.org>
Sat, 27 Dec 2014 10:12:07 +0000 (10:12 +0000)
vmdebootstrap

index 99ef25622f39e093bd5782cc632c55bb9b211151..500fa77e30a0d4e0d3fe86e2150f85fe5fe76906 100755 (executable)
@@ -158,7 +158,7 @@ class VmDebootstrap(cliapp.Application):  # pylint: disable=too-many-public-meth
             'Create an apt source based on the distribution and mirror selected.')
         self.settings.boolean(
             ['mbr'],
-            'Run install-mbr (no longer done by default)')
+            'Run install-mbr (default if extlinux used)')
         self.settings.boolean(
             ['grub'],
             'Install and configure grub2 - disables extlinux.')
@@ -187,7 +187,7 @@ class VmDebootstrap(cliapp.Application):  # pylint: disable=too-many-public-meth
             if self.settings['image']:
                 self.create_empty_image()
                 self.partition_image()
-                if self.settings['mbr']:
+                if self.settings['mbr'] or self.settings['extlinux']:
                     self.install_mbr()
                 (rootdev, bootdev) = self.setup_kpartx()
                 self.mkfs(rootdev, fstype=roottype)
@@ -340,6 +340,10 @@ class VmDebootstrap(cliapp.Application):  # pylint: disable=too-many-public-meth
         if os.path.exists("/sbin/install-mbr"):
             self.message('Installing MBR')
             self.runcmd(['install-mbr', self.settings['image']])
+        else:
+            msg = "mbr enabled but /sbin/install-mbr not found" 
+            " - please install the mbr package."
+            raise cliapp.AppException(msg)
 
     def setup_kpartx(self):
         bootindex = None