From: Neil Williams Date: Sat, 27 Dec 2014 10:12:07 +0000 (+0000) Subject: add mbr back to support extlinux and check for installation of mbr. X-Git-Url: https://git.siccegge.de//index.cgi?p=forks%2Fvmdebootstrap.git;a=commitdiff_plain;h=075e61745a15d15cda9fa756127f7136b813a3ac add mbr back to support extlinux and check for installation of mbr. --- 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