From 075e61745a15d15cda9fa756127f7136b813a3ac Mon Sep 17 00:00:00 2001 From: Neil Williams Date: Sat, 27 Dec 2014 10:12:07 +0000 Subject: [PATCH] add mbr back to support extlinux and check for installation of mbr. --- vmdebootstrap | 8 ++++++-- 1 file 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 -- 2.39.5