From df8518ebe4a429d68e814a7daae2621db132c61d Mon Sep 17 00:00:00 2001 From: Neil Williams Date: Tue, 26 Aug 2014 13:28:06 -0700 Subject: [PATCH] Make x86 calls conditional to allow for use on other linux architectures. --- vmdebootstrap | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/vmdebootstrap b/vmdebootstrap index 7f76b14..5fd2a09 100755 --- a/vmdebootstrap +++ b/vmdebootstrap @@ -242,8 +242,9 @@ class VmDebootstrap(cliapp.Application): 'set', '1', 'boot', 'on']) def install_mbr(self): - self.message('Installing MBR') - self.runcmd(['install-mbr', self.settings['image']]) + if os.path.exists("/sbin/install-mbr"): + self.message('Installing MBR') + self.runcmd(['install-mbr', self.settings['image']]) def setup_kpartx(self): out = self.runcmd(['kpartx', '-avs', self.settings['image']]) @@ -440,6 +441,9 @@ class VmDebootstrap(cliapp.Application): f.write('\nS0:23:respawn:%s\n' % serial_command) def install_extlinux(self, rootdev, rootdir): + if not os.path.exists("/usr/bin/extlinux"): + self.message("extlinux not installed, skipping.") + return self.message('Installing extlinux') def find(pattern): -- 2.39.5