Changes to 'refs/tags/livecd-tools-17.1'
by Brian C. Lane
Tag 'livecd-tools-17.1' created by Brian C. Lane <bcl(a)redhat.com> at 2011-09-01 18:56 +0000
Tag as livecd-tools-17.1
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
iQEVAwUATl/VeBF+jBaO/jp/AQKfKwf9FvpJWgGuSIzEPXAYhG6sAY4teUeu8ee2
5a0xwECEm5LcARMLZBhBfrgJwBkO9QbqzVYs2k82Y9GMx7fo2O89fxVco/wnBTv6
GH99dXOEC49o8br5QfkUnlzLqZyQsELDEp0DSVUjk/7PajRdHE2gKHS9r2yeNswl
hwmq5K4uUTgt+SHrBR9AGa6NBxRNT2XPQWemjAiNVVWhG9onkVxg/QVgrasuyok1
+lMdBs0s/9nzOCbaIOoUoaYKTJ6kjn/szNn3hPNFccKphJPPbdVd/8H0zkh0ZPoh
ocXX1beM4uB1AXghniUFtZKa30wPzcmNvpPyC3AiKu8eMYoNmUf6QQ==
=Fm4e
-----END PGP SIGNATURE-----
Changes since livecd-tools-17.0:
Brian C. Lane (6):
Use rsync to copy if available
Use copyFile on the iso
Add new syslinux.cfg template (#734173)
Skip bind mounts when source isn't there
Add title and product args (#669120)
Version 17.1
---
Makefile | 2
imgcreate/creator.py | 5 +
imgcreate/live.py | 151 ++++++++++++++++++++++++++++----------------
tools/livecd-creator | 25 ++++++-
tools/livecd-iso-to-disk.sh | 6 +
5 files changed, 133 insertions(+), 56 deletions(-)
---
12 years, 8 months
Makefile
by Brian C. Lane
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
New commits:
commit 78f99ee279696ce62b182cd1647600b3ddf22401
Author: Brian C. Lane <bcl(a)redhat.com>
Date: Thu Sep 1 11:56:40 2011 -0700
Version 17.1
diff --git a/Makefile b/Makefile
index a334fe6..d47a466 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,5 @@
-VERSION = 17.0
+VERSION = 17.1
INSTALL = /usr/bin/install -c
INSTALL_PROGRAM = ${INSTALL}
12 years, 8 months
Branch 'f16-branch' - 3 commits - imgcreate/creator.py imgcreate/live.py tools/livecd-creator
by Brian C. Lane
imgcreate/creator.py | 5 +
imgcreate/live.py | 151 +++++++++++++++++++++++++++++++++------------------
tools/livecd-creator | 25 ++++++++
3 files changed, 127 insertions(+), 54 deletions(-)
New commits:
commit 4ed7acda0536f7ca8e77ac7454905882cc1dd9a1
Author: Brian C. Lane <bcl(a)redhat.com>
Date: Wed Aug 31 17:37:20 2011 -0700
Add title and product args (#669120)
Pass --title to set the syslinux.cfg title string
Pass --product to set the syslinux.cfg string used as part of each
kernel boot stanza.
If they are not passed it will try to split the fslabel on - and use
the first 2 elements (eg. Livecd Fedora). If that fails it will use
Linux for both.
diff --git a/imgcreate/live.py b/imgcreate/live.py
index f7d3be8..721b609 100755
--- a/imgcreate/live.py
+++ b/imgcreate/live.py
@@ -39,7 +39,8 @@ class LiveImageCreatorBase(LoopImageCreator):
"""
- def __init__(self, ks, name, fslabel=None, releasever=None, tmpdir="/tmp"):
+ def __init__(self, ks, name, fslabel=None, releasever=None, tmpdir="/tmp",
+ title="Linux", product="Linux"):
"""Initialise a LiveImageCreator instance.
This method takes the same arguments as LoopImageCreator.__init__().
@@ -82,6 +83,9 @@ class LiveImageCreatorBase(LoopImageCreator):
self._isofstype = "iso9660"
self.base_on = False
+ self.title = title
+ self.product = product
+
#
# Hooks for subclasses
#
@@ -456,10 +460,10 @@ class x86LiveImageCreator(LiveImageCreatorBase):
default %(menu)s
timeout %(timeout)d
menu background %(background)s
-menu autoboot Starting %(name)s in # second{,s}. Press any key to interrupt.
+menu autoboot Starting %(title)s in # second{,s}. Press any key to interrupt.
menu clear
-menu title @PRODUCT@ @VERSION@
+menu title %(title)s
menu vshift 8
menu rows 18
menu margin 8
@@ -535,11 +539,11 @@ menu separator
default = self.__is_default_kernel(kernel, kernels)
if default:
- long = ""
+ long = self.product
elif kernel.startswith("kernel-"):
- long = "%s(%s)" % (self.name, kernel[7:])
+ long = "%s (%s)" % (self.product, kernel[7:])
else:
- long = "%s(%s)" % (self.name, kernel)
+ long = "%s (%s)" % (self.product, kernel)
# tell dracut not to ask for LUKS passwords or activate mdraid sets
if isDracut:
@@ -625,7 +629,7 @@ menu separator
cfg = self.__get_basic_syslinux_config(menu = menu,
background = background,
- name = self.name,
+ title = self.title,
timeout = self._timeout * 10)
cfg += "menu separator\n"
diff --git a/tools/livecd-creator b/tools/livecd-creator
index d997095..6b2c799 100755
--- a/tools/livecd-creator
+++ b/tools/livecd-creator
@@ -42,6 +42,10 @@ def parse_options(args):
help="Add packages to an existing live CD iso9660 image.")
imgopt.add_option("-f", "--fslabel", type="string", dest="fslabel",
help="File system label (default based on config name)")
+ imgopt.add_option("", "--title", type="string", dest="title",
+ help="Title used by syslinux.cfg file"),
+ imgopt.add_option("", "--product", type="string", dest="product",
+ help="Product name used in syslinux.cfg boot stanzas and countdown"),
# Provided for img-create compatibility
imgopt.add_option("-n", "--name", type="string", dest="fslabel",
help=optparse.SUPPRESS_HELP)
@@ -142,13 +146,32 @@ def main():
logging.info("Using label '%s' and name '%s'" % (fslabel, name))
+ if options.title:
+ title = options.title
+ else:
+ try:
+ title = " ".join(name.split("-")[:2])
+ title = title.title()
+ except:
+ title = "Linux"
+ if options.product:
+ product = options.product
+ else:
+ try:
+ product = " ".join(name.split("-")[:2])
+ product = product.title()
+ except:
+ product = "Linux"
+ logging.info("Using title '%s' and product '%s'" % (title, product))
+
ks = imgcreate.read_kickstart(options.kscfg)
if options.image_type == 'livecd':
creator = imgcreate.LiveImageCreator(ks, name,
fslabel=fslabel,
releasever=options.releasever,
- tmpdir=os.path.abspath(options.tmpdir))
+ tmpdir=os.path.abspath(options.tmpdir),
+ title=title, product=product)
elif options.image_type == 'image':
creator = imgcreate.LoopImageCreator(ks, name,
fslabel=fslabel,
commit 71e619ea90b2d029ae48f6bb65c1b33b443c78a7
Author: Brian C. Lane <bcl(a)redhat.com>
Date: Wed Aug 31 14:45:02 2011 -0700
Skip bind mounts when source isn't there
When running on a system w/o SELinux enabled the selinux bind mount
fails. Instead just skip them if the source of the mount isn't present
in the host system.
diff --git a/imgcreate/creator.py b/imgcreate/creator.py
index 0492c81..deb9d95 100644
--- a/imgcreate/creator.py
+++ b/imgcreate/creator.py
@@ -500,7 +500,10 @@ class ImageCreator(object):
("/dev/pts", None), ("/dev/shm", None),
(self.__selinux_mountpoint, self.__selinux_mountpoint),
(cachesrc, "/var/cache/yum")]:
- self.__bindmounts.append(BindChrootMount(f, self._instroot, dest))
+ if os.path.exists(f):
+ self.__bindmounts.append(BindChrootMount(f, self._instroot, dest))
+ else:
+ logging.warn("Skipping (%s,%s) because source doesn't exist." % (f, dest))
self._do_bindmounts()
commit e60448cc79e57867184585bdf70f8493b4195864
Author: Brian C. Lane <bcl(a)redhat.com>
Date: Wed Aug 31 10:43:13 2011 -0700
Add new syslinux.cfg template (#734173)
Move basicvideo and xdriver into extra argument
Add help section to kernel stanzas
Move basic and check into troubleshooting menu
diff --git a/imgcreate/live.py b/imgcreate/live.py
index 6ad9c5b..f7d3be8 100755
--- a/imgcreate/live.py
+++ b/imgcreate/live.py
@@ -455,21 +455,34 @@ class x86LiveImageCreator(LiveImageCreatorBase):
return """
default %(menu)s
timeout %(timeout)d
-
-%(background)s
-menu title Welcome to %(name)s!
-menu color border 0 #ffffffff #00000000
-menu color sel 7 #ffffffff #ff000000
-menu color title 0 #ffffffff #00000000
-menu color tabmsg 0 #ffffffff #00000000
-menu color unsel 0 #ffffffff #00000000
-menu color hotsel 0 #ff000000 #ffffffff
-menu color hotkey 7 #ffffffff #ff000000
-menu color timeout_msg 0 #ffffffff #00000000
-menu color timeout 0 #ffffffff #00000000
-menu color cmdline 0 #ffffffff #00000000
-menu hidden
-menu hiddenrow 5
+menu background %(background)s
+menu autoboot Starting %(name)s in # second{,s}. Press any key to interrupt.
+
+menu clear
+menu title @PRODUCT@ @VERSION@
+menu vshift 8
+menu rows 18
+menu margin 8
+#menu hidden
+menu helpmsgrow 15
+menu tabmsgrow 13
+
+menu color border * #00000000 #00000000 none
+menu color sel 0 #ffffffff #00000000 none
+menu color title 0 #ff7ba3d0 #00000000 none
+menu color tabmsg 0 #ff3a6496 #00000000 none
+menu color unsel 0 #84b8ffff #00000000 none
+menu color hotsel 0 #84b8ffff #00000000 none
+menu color hotkey 0 #ffffffff #00000000 none
+menu color help 0 #ffffffff #00000000 none
+menu color scrollbar 0 #ffffffff #ff355594 none
+menu color timeout 0 #ffffffff #00000000 none
+menu color timeout_msg 0 #ffffffff #00000000 none
+menu color cmdmark 0 #84b8ffff #00000000 none
+menu color cmdline 0 #ffffffff #00000000 none
+
+menu tabmsg Press Tab for full configuration options on menu items.
+menu separator
""" % args
def __get_image_stanza(self, is_xen, isDracut, **args):
@@ -482,13 +495,18 @@ menu hiddenrow 5
template = """label %(short)s
menu label %(long)s
kernel vmlinuz%(index)s
- append initrd=initrd%(index)s.img root=%(rootlabel)s rootfstype=%(isofstype)s %(liveargs)s %(xdriver)s %(extra)s
+ append initrd=initrd%(index)s.img root=%(rootlabel)s rootfstype=%(isofstype)s %(liveargs)s %(extra)s
"""
else:
template = """label %(short)s
menu label %(long)s
kernel mboot.c32
- append xen%(index)s.gz --- vmlinuz%(index)s root=%(rootlabel)s rootfstype=%(isofstype)s %(liveargs)s %(xdriver)s %(extra)s --- initrd%(index)s.img
+ append xen%(index)s.gz --- vmlinuz%(index)s root=%(rootlabel)s rootfstype=%(isofstype)s %(liveargs)s %(extra)s --- initrd%(index)s.img
+"""
+ if args.get("help"):
+ template += """ text help
+ %(help)s
+ endtext
"""
return template % args
@@ -503,7 +521,10 @@ menu hiddenrow 5
checkisomd5 = self._has_checkisomd5()
- cfg = ""
+ # Stanzas for insertion into the config template
+ linux = []
+ basic = []
+ check = []
index = "0"
for version in versions:
@@ -514,16 +535,11 @@ menu hiddenrow 5
default = self.__is_default_kernel(kernel, kernels)
if default:
- long = "Boot"
+ long = ""
elif kernel.startswith("kernel-"):
- long = "Boot %s(%s)" % (self.name, kernel[7:])
+ long = "%s(%s)" % (self.name, kernel[7:])
else:
- long = "Boot %s(%s)" % (self.name, kernel)
-
- # Basic video driver
- basic = "system with basic video driver"
- xdriver = "xdriver=vesa nomodeset"
-
+ long = "%s(%s)" % (self.name, kernel)
# tell dracut not to ask for LUKS passwords or activate mdraid sets
if isDracut:
@@ -531,46 +547,45 @@ menu hiddenrow 5
else:
kern_opts = kernel_options
- cfg += self.__get_image_stanza(is_xen, isDracut,
+ linux.append(self.__get_image_stanza(is_xen, isDracut,
fslabel = self.fslabel,
isofstype = "auto",
liveargs = kern_opts,
- long = long,
+ long = "^Start " + long,
short = "linux" + index,
- basicvideo = "",
- xdriver = "",
extra = "",
- index = index)
+ help = "",
+ index = index))
if default:
- cfg += "menu default\n"
+ linux[-1] += " menu default\n"
- cfg += self.__get_image_stanza(is_xen, isDracut,
+ basic.append(self.__get_image_stanza(is_xen, isDracut,
fslabel = self.fslabel,
isofstype = "auto",
liveargs = kern_opts,
- long = long + " (Basic Video)",
- short = "linux" + index,
- basicvideo = basic,
- xdriver = xdriver,
- extra = "",
- index = index)
+ long = "Start " + long + " in ^basic graphics mode.",
+ short = "basic" + index,
+ extra = "xdriver=vesa nomodeset",
+ help = "Try this option out if you're having trouble starting.",
+ index = index))
if checkisomd5:
- cfg += self.__get_image_stanza(is_xen, isDracut,
+ check.append(self.__get_image_stanza(is_xen, isDracut,
fslabel = self.fslabel,
isofstype = "auto",
liveargs = kern_opts,
- long = "Verify and " + long,
- short = "rd.live.check" + index,
- basicvideo = "",
- xdriver = "",
+ long = "^Test this media & start " + long,
+ short = "check" + index,
extra = "rd.live.check",
- index = index)
+ help = "",
+ index = index))
+ else:
+ check.append(None)
index = str(int(index) + 1)
- return cfg
+ return (linux, basic, check)
def __get_memtest_stanza(self, isodir):
memtest = glob.glob(self._instroot + "/boot/memtest86*")
@@ -580,13 +595,18 @@ menu hiddenrow 5
shutil.copyfile(memtest[0], isodir + "/isolinux/memtest")
return """label memtest
- menu label Memory Test
+ menu label Run a ^memory test.
+ text help
+ If your system is having issues, an problem with your
+ system's memory may be the cause. Use this utility to
+ see if the memory is working correctly.
+ endtext
kernel memtest
"""
def __get_local_stanza(self, isodir):
return """label local
- menu label Boot from local drive
+ menu label Boot from ^local drive
localboot 0xffff
"""
@@ -601,18 +621,41 @@ menu hiddenrow 5
background = ""
if self.__copy_syslinux_background(isodir + "/isolinux/splash.jpg"):
- background = "menu background splash.jpg"
+ background = "splash.jpg"
cfg = self.__get_basic_syslinux_config(menu = menu,
background = background,
name = self.name,
timeout = self._timeout * 10)
+ cfg += "menu separator\n"
+
+ linux, basic, check = self.__get_image_stanzas(isodir)
+ # Add linux stanzas to main menu
+ for s in linux:
+ cfg += s
+ cfg += "menu separator\n"
+
+ cfg += """menu begin ^Troubleshooting
+ menu title Troubleshooting
+"""
+ # Add basic video and check to submenu
+ for b, c in zip(basic, check):
+ cfg += b
+ if c:
+ cfg += c
- cfg += self.__get_image_stanzas(isodir)
cfg += self.__get_memtest_stanza(isodir)
+ cfg += "menu separator\n"
+
cfg += self.__get_local_stanza(isodir)
cfg += self._get_isolinux_stanzas(isodir)
+ cfg += """menu separator
+label returntomain
+ menu label Return to ^main menu.
+ menu exit
+menu end
+"""
cfgf = open(isodir + "/isolinux/isolinux.cfg", "w")
cfgf.write(cfg)
cfgf.close()
12 years, 8 months
3 commits - imgcreate/creator.py imgcreate/live.py tools/livecd-creator
by Brian C. Lane
imgcreate/creator.py | 5 +
imgcreate/live.py | 151 +++++++++++++++++++++++++++++++++------------------
tools/livecd-creator | 25 ++++++++
3 files changed, 127 insertions(+), 54 deletions(-)
New commits:
commit 807bff3450212a6ecc5802252752ef37febfe115
Author: Brian C. Lane <bcl(a)redhat.com>
Date: Wed Aug 31 17:37:20 2011 -0700
Add title and product args (#669120)
Pass --title to set the syslinux.cfg title string
Pass --product to set the syslinux.cfg string used as part of each
kernel boot stanza.
If they are not passed it will try to split the fslabel on - and use
the first 2 elements (eg. Livecd Fedora). If that fails it will use
Linux for both.
diff --git a/imgcreate/live.py b/imgcreate/live.py
index f7d3be8..721b609 100755
--- a/imgcreate/live.py
+++ b/imgcreate/live.py
@@ -39,7 +39,8 @@ class LiveImageCreatorBase(LoopImageCreator):
"""
- def __init__(self, ks, name, fslabel=None, releasever=None, tmpdir="/tmp"):
+ def __init__(self, ks, name, fslabel=None, releasever=None, tmpdir="/tmp",
+ title="Linux", product="Linux"):
"""Initialise a LiveImageCreator instance.
This method takes the same arguments as LoopImageCreator.__init__().
@@ -82,6 +83,9 @@ class LiveImageCreatorBase(LoopImageCreator):
self._isofstype = "iso9660"
self.base_on = False
+ self.title = title
+ self.product = product
+
#
# Hooks for subclasses
#
@@ -456,10 +460,10 @@ class x86LiveImageCreator(LiveImageCreatorBase):
default %(menu)s
timeout %(timeout)d
menu background %(background)s
-menu autoboot Starting %(name)s in # second{,s}. Press any key to interrupt.
+menu autoboot Starting %(title)s in # second{,s}. Press any key to interrupt.
menu clear
-menu title @PRODUCT@ @VERSION@
+menu title %(title)s
menu vshift 8
menu rows 18
menu margin 8
@@ -535,11 +539,11 @@ menu separator
default = self.__is_default_kernel(kernel, kernels)
if default:
- long = ""
+ long = self.product
elif kernel.startswith("kernel-"):
- long = "%s(%s)" % (self.name, kernel[7:])
+ long = "%s (%s)" % (self.product, kernel[7:])
else:
- long = "%s(%s)" % (self.name, kernel)
+ long = "%s (%s)" % (self.product, kernel)
# tell dracut not to ask for LUKS passwords or activate mdraid sets
if isDracut:
@@ -625,7 +629,7 @@ menu separator
cfg = self.__get_basic_syslinux_config(menu = menu,
background = background,
- name = self.name,
+ title = self.title,
timeout = self._timeout * 10)
cfg += "menu separator\n"
diff --git a/tools/livecd-creator b/tools/livecd-creator
index d997095..6b2c799 100755
--- a/tools/livecd-creator
+++ b/tools/livecd-creator
@@ -42,6 +42,10 @@ def parse_options(args):
help="Add packages to an existing live CD iso9660 image.")
imgopt.add_option("-f", "--fslabel", type="string", dest="fslabel",
help="File system label (default based on config name)")
+ imgopt.add_option("", "--title", type="string", dest="title",
+ help="Title used by syslinux.cfg file"),
+ imgopt.add_option("", "--product", type="string", dest="product",
+ help="Product name used in syslinux.cfg boot stanzas and countdown"),
# Provided for img-create compatibility
imgopt.add_option("-n", "--name", type="string", dest="fslabel",
help=optparse.SUPPRESS_HELP)
@@ -142,13 +146,32 @@ def main():
logging.info("Using label '%s' and name '%s'" % (fslabel, name))
+ if options.title:
+ title = options.title
+ else:
+ try:
+ title = " ".join(name.split("-")[:2])
+ title = title.title()
+ except:
+ title = "Linux"
+ if options.product:
+ product = options.product
+ else:
+ try:
+ product = " ".join(name.split("-")[:2])
+ product = product.title()
+ except:
+ product = "Linux"
+ logging.info("Using title '%s' and product '%s'" % (title, product))
+
ks = imgcreate.read_kickstart(options.kscfg)
if options.image_type == 'livecd':
creator = imgcreate.LiveImageCreator(ks, name,
fslabel=fslabel,
releasever=options.releasever,
- tmpdir=os.path.abspath(options.tmpdir))
+ tmpdir=os.path.abspath(options.tmpdir),
+ title=title, product=product)
elif options.image_type == 'image':
creator = imgcreate.LoopImageCreator(ks, name,
fslabel=fslabel,
commit 7a90b7e306b96e1fa1a4091c61f734d7d921d6ef
Author: Brian C. Lane <bcl(a)redhat.com>
Date: Wed Aug 31 14:45:02 2011 -0700
Skip bind mounts when source isn't there
When running on a system w/o SELinux enabled the selinux bind mount
fails. Instead just skip them if the source of the mount isn't present
in the host system.
diff --git a/imgcreate/creator.py b/imgcreate/creator.py
index 0492c81..deb9d95 100644
--- a/imgcreate/creator.py
+++ b/imgcreate/creator.py
@@ -500,7 +500,10 @@ class ImageCreator(object):
("/dev/pts", None), ("/dev/shm", None),
(self.__selinux_mountpoint, self.__selinux_mountpoint),
(cachesrc, "/var/cache/yum")]:
- self.__bindmounts.append(BindChrootMount(f, self._instroot, dest))
+ if os.path.exists(f):
+ self.__bindmounts.append(BindChrootMount(f, self._instroot, dest))
+ else:
+ logging.warn("Skipping (%s,%s) because source doesn't exist." % (f, dest))
self._do_bindmounts()
commit ab889bf22a2dad7e1afc8be352292b9c352f92ea
Author: Brian C. Lane <bcl(a)redhat.com>
Date: Wed Aug 31 10:43:13 2011 -0700
Add new syslinux.cfg template (#734173)
Move basicvideo and xdriver into extra argument
Add help section to kernel stanzas
Move basic and check into troubleshooting menu
diff --git a/imgcreate/live.py b/imgcreate/live.py
index 6ad9c5b..f7d3be8 100755
--- a/imgcreate/live.py
+++ b/imgcreate/live.py
@@ -455,21 +455,34 @@ class x86LiveImageCreator(LiveImageCreatorBase):
return """
default %(menu)s
timeout %(timeout)d
-
-%(background)s
-menu title Welcome to %(name)s!
-menu color border 0 #ffffffff #00000000
-menu color sel 7 #ffffffff #ff000000
-menu color title 0 #ffffffff #00000000
-menu color tabmsg 0 #ffffffff #00000000
-menu color unsel 0 #ffffffff #00000000
-menu color hotsel 0 #ff000000 #ffffffff
-menu color hotkey 7 #ffffffff #ff000000
-menu color timeout_msg 0 #ffffffff #00000000
-menu color timeout 0 #ffffffff #00000000
-menu color cmdline 0 #ffffffff #00000000
-menu hidden
-menu hiddenrow 5
+menu background %(background)s
+menu autoboot Starting %(name)s in # second{,s}. Press any key to interrupt.
+
+menu clear
+menu title @PRODUCT@ @VERSION@
+menu vshift 8
+menu rows 18
+menu margin 8
+#menu hidden
+menu helpmsgrow 15
+menu tabmsgrow 13
+
+menu color border * #00000000 #00000000 none
+menu color sel 0 #ffffffff #00000000 none
+menu color title 0 #ff7ba3d0 #00000000 none
+menu color tabmsg 0 #ff3a6496 #00000000 none
+menu color unsel 0 #84b8ffff #00000000 none
+menu color hotsel 0 #84b8ffff #00000000 none
+menu color hotkey 0 #ffffffff #00000000 none
+menu color help 0 #ffffffff #00000000 none
+menu color scrollbar 0 #ffffffff #ff355594 none
+menu color timeout 0 #ffffffff #00000000 none
+menu color timeout_msg 0 #ffffffff #00000000 none
+menu color cmdmark 0 #84b8ffff #00000000 none
+menu color cmdline 0 #ffffffff #00000000 none
+
+menu tabmsg Press Tab for full configuration options on menu items.
+menu separator
""" % args
def __get_image_stanza(self, is_xen, isDracut, **args):
@@ -482,13 +495,18 @@ menu hiddenrow 5
template = """label %(short)s
menu label %(long)s
kernel vmlinuz%(index)s
- append initrd=initrd%(index)s.img root=%(rootlabel)s rootfstype=%(isofstype)s %(liveargs)s %(xdriver)s %(extra)s
+ append initrd=initrd%(index)s.img root=%(rootlabel)s rootfstype=%(isofstype)s %(liveargs)s %(extra)s
"""
else:
template = """label %(short)s
menu label %(long)s
kernel mboot.c32
- append xen%(index)s.gz --- vmlinuz%(index)s root=%(rootlabel)s rootfstype=%(isofstype)s %(liveargs)s %(xdriver)s %(extra)s --- initrd%(index)s.img
+ append xen%(index)s.gz --- vmlinuz%(index)s root=%(rootlabel)s rootfstype=%(isofstype)s %(liveargs)s %(extra)s --- initrd%(index)s.img
+"""
+ if args.get("help"):
+ template += """ text help
+ %(help)s
+ endtext
"""
return template % args
@@ -503,7 +521,10 @@ menu hiddenrow 5
checkisomd5 = self._has_checkisomd5()
- cfg = ""
+ # Stanzas for insertion into the config template
+ linux = []
+ basic = []
+ check = []
index = "0"
for version in versions:
@@ -514,16 +535,11 @@ menu hiddenrow 5
default = self.__is_default_kernel(kernel, kernels)
if default:
- long = "Boot"
+ long = ""
elif kernel.startswith("kernel-"):
- long = "Boot %s(%s)" % (self.name, kernel[7:])
+ long = "%s(%s)" % (self.name, kernel[7:])
else:
- long = "Boot %s(%s)" % (self.name, kernel)
-
- # Basic video driver
- basic = "system with basic video driver"
- xdriver = "xdriver=vesa nomodeset"
-
+ long = "%s(%s)" % (self.name, kernel)
# tell dracut not to ask for LUKS passwords or activate mdraid sets
if isDracut:
@@ -531,46 +547,45 @@ menu hiddenrow 5
else:
kern_opts = kernel_options
- cfg += self.__get_image_stanza(is_xen, isDracut,
+ linux.append(self.__get_image_stanza(is_xen, isDracut,
fslabel = self.fslabel,
isofstype = "auto",
liveargs = kern_opts,
- long = long,
+ long = "^Start " + long,
short = "linux" + index,
- basicvideo = "",
- xdriver = "",
extra = "",
- index = index)
+ help = "",
+ index = index))
if default:
- cfg += "menu default\n"
+ linux[-1] += " menu default\n"
- cfg += self.__get_image_stanza(is_xen, isDracut,
+ basic.append(self.__get_image_stanza(is_xen, isDracut,
fslabel = self.fslabel,
isofstype = "auto",
liveargs = kern_opts,
- long = long + " (Basic Video)",
- short = "linux" + index,
- basicvideo = basic,
- xdriver = xdriver,
- extra = "",
- index = index)
+ long = "Start " + long + " in ^basic graphics mode.",
+ short = "basic" + index,
+ extra = "xdriver=vesa nomodeset",
+ help = "Try this option out if you're having trouble starting.",
+ index = index))
if checkisomd5:
- cfg += self.__get_image_stanza(is_xen, isDracut,
+ check.append(self.__get_image_stanza(is_xen, isDracut,
fslabel = self.fslabel,
isofstype = "auto",
liveargs = kern_opts,
- long = "Verify and " + long,
- short = "rd.live.check" + index,
- basicvideo = "",
- xdriver = "",
+ long = "^Test this media & start " + long,
+ short = "check" + index,
extra = "rd.live.check",
- index = index)
+ help = "",
+ index = index))
+ else:
+ check.append(None)
index = str(int(index) + 1)
- return cfg
+ return (linux, basic, check)
def __get_memtest_stanza(self, isodir):
memtest = glob.glob(self._instroot + "/boot/memtest86*")
@@ -580,13 +595,18 @@ menu hiddenrow 5
shutil.copyfile(memtest[0], isodir + "/isolinux/memtest")
return """label memtest
- menu label Memory Test
+ menu label Run a ^memory test.
+ text help
+ If your system is having issues, an problem with your
+ system's memory may be the cause. Use this utility to
+ see if the memory is working correctly.
+ endtext
kernel memtest
"""
def __get_local_stanza(self, isodir):
return """label local
- menu label Boot from local drive
+ menu label Boot from ^local drive
localboot 0xffff
"""
@@ -601,18 +621,41 @@ menu hiddenrow 5
background = ""
if self.__copy_syslinux_background(isodir + "/isolinux/splash.jpg"):
- background = "menu background splash.jpg"
+ background = "splash.jpg"
cfg = self.__get_basic_syslinux_config(menu = menu,
background = background,
name = self.name,
timeout = self._timeout * 10)
+ cfg += "menu separator\n"
+
+ linux, basic, check = self.__get_image_stanzas(isodir)
+ # Add linux stanzas to main menu
+ for s in linux:
+ cfg += s
+ cfg += "menu separator\n"
+
+ cfg += """menu begin ^Troubleshooting
+ menu title Troubleshooting
+"""
+ # Add basic video and check to submenu
+ for b, c in zip(basic, check):
+ cfg += b
+ if c:
+ cfg += c
- cfg += self.__get_image_stanzas(isodir)
cfg += self.__get_memtest_stanza(isodir)
+ cfg += "menu separator\n"
+
cfg += self.__get_local_stanza(isodir)
cfg += self._get_isolinux_stanzas(isodir)
+ cfg += """menu separator
+label returntomain
+ menu label Return to ^main menu.
+ menu exit
+menu end
+"""
cfgf = open(isodir + "/isolinux/isolinux.cfg", "w")
cfgf.write(cfg)
cfgf.close()
12 years, 8 months