From 307466b3ee56be7978d202219a6b4666176825d2 Mon Sep 17 00:00:00 2001 From: Pedro Alvarez Date: Wed, 12 Feb 2014 11:40:07 +0000 Subject: 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. --- writeexts.py | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/writeexts.py b/writeexts.py index 9dbc77e6..dd0e8b79 100644 --- a/writeexts.py +++ b/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.''' -- cgit v1.2.1