[Pkg-xen-devel] Bug#643953: Bug#643953: xen-utils-4.0: pygrub can not parse empty "root" statement in menu.lst

Phillip Frost indigo at bitglue.com
Mon Oct 3 02:17:55 UTC 2011

On Oct 2, 2011, at 9:13 PM, Thomas Goirand wrote:

> On 10/01/2011 11:41 AM, Phil Frost wrote:
>> Package: xen-utils-4.0
>> Version: 4.0.1-2
>> Severity: normal
>> pygrub's parser seems to expect that "root" will be followed by a disk
>> specification.
> How is this a problem with pygrub? If the configuration file is wrong,
> then it's normal not to boot, right? Or are you saying that it wrote a
> wrong configuration file? If so, how this happened?

I guess it depends on what you mean by "wrong". Grub grub parses that config file just fine. The problematic entry is just there as a visual separator, to separate the entries that boot the OS that made it from other OSs the grub installer found (other Linux installs, Windows, etc).

I suspect if I were to select that menu entry, grub would complain that the entry isn't bootable. However, pygrub chokes on reading menu.lst and terminates with an exception before giving me the opportunity to select anything.

I can't tell you exactly how that menu.lst was generated, other than it's part of an Ubuntu install that I've upgraded several times. Regardless, it's been working like that for years and grub thinks it's fine. That's why I say it's a problem with pygrub.

I don't think it would be such a problem if there was some better error reporting. I remember Xen gave me some unhelpful error like "bootloader returned no information!" even though pygrub was printing a traceback. I invoked pygrub directly before I got to see it. Then, the traceback didn't contain anything telling me it was a syntax problem or on what line. I eventually found it by trapping the excepting with pdb and going up a few stack frames until I found the line being parsed. Once I saw just "root" it was pretty obvious what was going on.

More information about the Pkg-xen-devel mailing list