[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH] failing to set value to 0 in Grub2ConfigFile

I've had a tinker with the patch - I don't have a Fedora build system atm - so I just edited the file on the Dom0 and removed the pyc/pyo files. Same issue:

   pyGRUB  version 0.6

│ Fedora (5.2.6-200.fc30.x86_64) 30 (Thirty) │ Fedora (0-rescue-ee4b18b1898e4bf2b36ff71077b23b5e) 30 (Thirty)

    Use the ^ and v keys to select which entry is highlighted.
    Press enter to boot the selected OS, 'e' to edit the
    commands before booting, 'a' to modify the kernel arguments
    before booting, or 'c' for a command line.

The rescue entry is selected in the above example.

My crappy hack has been to edit /usr/libexec/xen/bin/pygrub and add sel=0 as follows:

   def image_index(self):
       if isinstance(self.cf.default, int):
           sel = self.cf.default
       elif self.cf.default.isdigit():
           sel = int(self.cf.default)
           sel = 0

I know this is horrible!

I'm still disabling BLSCFG in /etc/default/grub - otherwise the pygrub menu is completely empty.

I don't know what the solution is right now - but I do somewhat agree with ignoring anything inside an if statement in grub.cfg - as the logic is ignored anyway. Do you still need to read the grubenv in doing this?

I assume the read for grubenv is to get the 'saved_entry' value?

Steven Haigh

📧 netwiz@xxxxxxxxx     💻 https://www.crc.id.au
📞 +613 9001 6090       📱 +614 1293 5897

On Wed, Aug 14, 2019 at 7:51 AM, "YOUNG, MICHAEL A." <m.a.young@xxxxxxxxxxxx> wrote:
On Tue, 13 Aug 2019, Andrew Cooper wrote:

 On 13/08/2019 22:02, YOUNG, MICHAEL A. wrote:
I have been looking at the pygrub code to see if it is possible to cope with grub files with BLSCFG and spotted this minor issue in GrubConf.py where the code intends to replace ${saved_entry} and ${next_entry} with 0
 but doesn't succeed.

 Signed-off-by: Michael Young <m.a.young@xxxxxxxxxxxx>

Ah - this looks suspiciously like it might be the bugfix for an issue
 reported by Steven.

Steven - do you mind giving this patch a try for your "Fedora 30 DomU -
 pygrub always boots the second menu option" problem?

Sadly I don't think it is that simple and to it properly would require
parsing if clauses in the grub file and also reading variables from the
grubenv file.

I do however have an idea which might work which is to ignore anything in if clauses, read the grubenv file (which I now have a hacky way of doing)
and treating the value of next_entry or saved_entry as the setting for
the default kernel to pick. If I finish a patch that does this I will post it on the list, but I very much doubt it will be of commitable quality.

        Michael Young

Xen-devel mailing list

Xen-devel mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.