summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Maw <richard.maw@codethink.co.uk>2012-08-06 10:52:21 +0000
committerRichard Maw <richard.maw@codethink.co.uk>2012-08-06 10:52:21 +0000
commitb3838be603ed73e89bec046c50a6c416c6a6fbcb (patch)
treed3b4fae0e7f999dadaeafe7d3a486c7949e52e0b
parenta086d6644ac142ba3a4351d16b4ba369d379d4a9 (diff)
downloadmorph-b3838be603ed73e89bec046c50a6c416c6a6fbcb.tar.gz
Move install_syslinux_mbr into syslinux plugin
This is not used elsewhere, and probably never will.
-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',