diff options
author | Pedro Alvarez <pedro.alvarez@codethink.co.uk> | 2014-02-12 11:40:07 +0000 |
---|---|---|
committer | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2014-03-04 12:08:18 +0000 |
commit | dfc580fe6a757985ee9f8954b530d041b2b5a5b0 (patch) | |
tree | 7db7d992a1b54915d4686828a15190a671c63ef6 /morphlib/writeexts.py | |
parent | eec2d313ea2381427774b7256120a008565aa448 (diff) | |
download | morph-dfc580fe6a757985ee9f8954b530d041b2b5a5b0.tar.gz |
Adding syslinux 'menu.c32' file during the deployment.
We will need this file to enable a bootloader menu to choose between
OS after an upgrade.
Diffstat (limited to 'morphlib/writeexts.py')
-rw-r--r-- | morphlib/writeexts.py | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/morphlib/writeexts.py b/morphlib/writeexts.py index 9dbc77e6..dd0e8b79 100644 --- a/morphlib/writeexts.py +++ b/morphlib/writeexts.py @@ -1,4 +1,4 @@ -# Copyright (C) 2012-2013 Codethink Limited +# Copyright (C) 2012-2014 Codethink Limited # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -76,6 +76,7 @@ class WriteExtension(cliapp.Application): os.symlink(version_label, os.path.join(mp, 'systems', 'default')) if self.bootloader_is_wanted(): self.install_kernel(version_root, temp_root) + self.install_syslinux_menu(mp, version_root) self.install_extlinux(mp) except BaseException, e: sys.stderr.write('Error creating disk image') @@ -254,6 +255,23 @@ class WriteExtension(cliapp.Application): cliapp.runcmd(['sync']) time.sleep(2) + def install_syslinux_menu(self, real_root, version_root): + '''Make syslinux/extlinux menu binary available. + + The syslinux boot menu is compiled to a file named menu.c32. Extlinux + searches a few places for this file but it does not know to look inside + our subvolume, so we copy it to the filesystem root. + + If the file is not available, the bootloader will still work but will + not be able to show a menu. + + ''' + menu_file = os.path.join(version_root, 'orig', + 'usr', 'share', 'syslinux', 'menu.c32') + if os.path.isfile(menu_file): + self.status(msg='Copying menu.c32') + shutil.copy(menu_file, real_root) + def parse_attach_disks(self): '''Parse $ATTACH_DISKS into list of disks to attach.''' |