summaryrefslogtreecommitdiff
path: root/vmdebootstrap
diff options
context:
space:
mode:
authorNeil Williams <codehelp@debian.org>2014-12-27 10:12:07 +0000
committerNeil Williams <codehelp@debian.org>2014-12-27 10:12:07 +0000
commit075e61745a15d15cda9fa756127f7136b813a3ac (patch)
tree2b3445c81a3ff24d9820a55afc8ef5bd811347ab /vmdebootstrap
parent545b3e5065fa1f57540cb01255d911d3c5ef2f96 (diff)
downloadvmdebootstrap-075e61745a15d15cda9fa756127f7136b813a3ac.tar.gz
add mbr back to support extlinux and check for installation of mbr.
Diffstat (limited to 'vmdebootstrap')
-rwxr-xr-xvmdebootstrap8
1 files changed, 6 insertions, 2 deletions
diff --git a/vmdebootstrap b/vmdebootstrap
index 99ef256..500fa77 100755
--- a/vmdebootstrap
+++ b/vmdebootstrap
@@ -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