diff options
author | Richard Maw <richard.maw@codethink.co.uk> | 2012-08-06 10:56:58 +0000 |
---|---|---|
committer | Richard Maw <richard.maw@codethink.co.uk> | 2012-08-06 10:56:58 +0000 |
commit | 7def9660122f9b3677076c5b7f0a871abb6ee604 (patch) | |
tree | 691eb6cdd759ae79d3702936ca342b0aea54b9f1 /morphlib | |
parent | b3838be603ed73e89bec046c50a6c416c6a6fbcb (diff) | |
download | morph-7def9660122f9b3677076c5b7f0a871abb6ee604.tar.gz |
systembuilder: select mbr search paths from config
This is primarily so that this can be made testable, but it will also
allow for the mbr to be installed in a non-standard path.
Diffstat (limited to 'morphlib')
-rw-r--r-- | morphlib/plugins/syslinux-disk-systembuilder_plugin.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/morphlib/plugins/syslinux-disk-systembuilder_plugin.py b/morphlib/plugins/syslinux-disk-systembuilder_plugin.py index e9647fd0..8bd5ca11 100644 --- a/morphlib/plugins/syslinux-disk-systembuilder_plugin.py +++ b/morphlib/plugins/syslinux-disk-systembuilder_plugin.py @@ -103,8 +103,7 @@ class SyslinuxDiskBuilder(SystemKindBuilder): # pragma: no cover if arch not in ('x86', 'x86_64'): return with self.build_watch('install-mbr'): - for path in ['/usr/lib/extlinux/mbr.bin', - '/usr/share/syslinux/mbr.bin']: + for path in self.app.settings['syslinux-mbr-search-paths']: if os.path.exists(path): self.app.runcmd(['dd', 'if=' + path, 'of=' + image_name, 'conv=notrunc']) @@ -200,6 +199,11 @@ class SyslinuxDiskBuilderPlugin(cliapp.Plugin): # Only provide this system builder on architectures that are # supported by syslinux. if morphlib.util.arch() in ['x86_64', 'i386', 'i486', 'i586', 'i686']: + self.app.settings.string_list( + ['syslinux-mbr-search-paths'], + 'A list of files to search for to use as the syslinux mbr', + default=['/usr/lib/extlinux/mbr.bin', + '/usr/share/syslinux/mbr.bin']) self.app.system_kind_builder_factory.register(SyslinuxDiskBuilder) def disable(self): |