summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--morphlib/fsutils.py9
-rw-r--r--morphlib/plugins/syslinux-disk-systembuilder_plugin.py7
2 files changed, 6 insertions, 10 deletions
diff --git a/morphlib/fsutils.py b/morphlib/fsutils.py
index 45fb9e2f..9786e387 100644
--- a/morphlib/fsutils.py
+++ b/morphlib/fsutils.py
@@ -28,15 +28,6 @@ def partition_image(runcmd, image_name):
runcmd(['sfdisk', image_name], feed_stdin='1,,83,*\n')
-def install_syslinux_mbr(runcmd, image_name):
- for path in ['/usr/lib/extlinux/mbr.bin',
- '/usr/share/syslinux/mbr.bin']:
- if os.path.exists(path):
- runcmd(['dd', 'if=' + path, 'of=' + image_name,
- 'conv=notrunc'])
- break
-
-
def setup_device_mapping(runcmd, image_name):
findstart = re.compile(r"start=\s+(\d+),")
out = runcmd(['sfdisk', '-d', image_name])
diff --git a/morphlib/plugins/syslinux-disk-systembuilder_plugin.py b/morphlib/plugins/syslinux-disk-systembuilder_plugin.py
index f6ebf059..e9647fd0 100644
--- a/morphlib/plugins/syslinux-disk-systembuilder_plugin.py
+++ b/morphlib/plugins/syslinux-disk-systembuilder_plugin.py
@@ -103,7 +103,12 @@ class SyslinuxDiskBuilder(SystemKindBuilder): # pragma: no cover
if arch not in ('x86', 'x86_64'):
return
with self.build_watch('install-mbr'):
- morphlib.fsutils.install_syslinux_mbr(self.app.runcmd, image_name)
+ for path in ['/usr/lib/extlinux/mbr.bin',
+ '/usr/share/syslinux/mbr.bin']:
+ if os.path.exists(path):
+ self.app.runcmd(['dd', 'if=' + path, 'of=' + image_name,
+ 'conv=notrunc'])
+ break
def _setup_device_mapping(self, image_name):
self.app.status(msg='Device mapping partitions in %(filename)s',