summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPedro Alvarez <pedro.alvarez@codethink.co.uk>2014-02-12 11:40:07 +0000
committerSam Thursfield <sam.thursfield@codethink.co.uk>2014-03-04 12:08:18 +0000
commit307466b3ee56be7978d202219a6b4666176825d2 (patch)
tree667dd2e086437f5cc2f16aea5bc557fdbb6cdd84
parentcc0ceb1a96e685574067fffeb8e9f1f7f23ec8d4 (diff)
downloaddefinitions-307466b3ee56be7978d202219a6b4666176825d2.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.
-rw-r--r--writeexts.py20
1 files changed, 19 insertions, 1 deletions
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.'''