]> xenbits.xensource.com Git - people/dwmw2/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 Campbell <ian.campbell@citrix.com>
Thu, 3 Jul 2014 10:11:05 +0000 (11:11 +0100)
commitd1b93ea2615bd789ee28901f1f1c05ffb319cb61
tree961386fa94f9745c944e5aedc0c6c84a1d4caef3
parent155751b7e369fa0f9c71c26d9932c888bbde634f
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>
tools/pygrub/src/GrubConf.py
tools/pygrub/src/pygrub