]> xenbits.xensource.com Git - xen.git/commit
tools/pygrub: Make pygrub understand default entry in string format
authorBoris Ostrovsky <boris.ostrovsky@oracle.com>
Fri, 27 Jun 2014 14:07:31 +0000 (10:07 -0400)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Fri, 27 Feb 2015 15:16:04 +0000 (15:16 +0000)
commit3f9d2e1863a2301a219ed9f34f6857df019555ee
tree0c2969a7f2378b65c2664d18765d87e00452ba8f
parent9c6425b06a1efdb3f48357313f72c61e003436cc
tools/pygrub: Make pygrub understand default entry in string format

Currently pygrub can only correctly parse grub2's default attribute when it is
specified as a number. If it is set to ${saved_entry} or ${next_entry} then
the first image (i.e. entry number 0) is selected. If any other value is
specified (typically this would be the string in menuentry) pygrub will crash.

This patch will allow pygrub to interpret default attribute if it is specified
as a string (note that in case of submenus only the leaf string will be
considered).

Also issue a warning if default is set to ${saved_entry} or ${next_entry}.

Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
(cherry picked from commit d1b93ea2615bd789ee28901f1f1c05ffb319cb61)
tools/pygrub/src/GrubConf.py
tools/pygrub/src/pygrub