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

Re: [Xen-devel] [PATCH] xen/pygrub: grub2/grub.cfg from RHEL 7 has new commands in menuentry.



On Thu, Jan 30, 2014 at 11:45:43AM +0000, Andrew Cooper wrote:
> On 30/01/14 11:31, Joby Poriyath wrote:
> > menuentry in grub2/grub.cfg uses linux16 and initrd16 commands
> > instead of linux and initrd. Due to this RHEL 7 (beta) guest failed to
> > boot after the installation.
> >
> > In addition to this, menuentry has some options as well
> > (--class red, --class gnu, etc).
> >
> > Signed-off-by: Joby Poriyath <joby.poriyath@xxxxxxxxxx>
> 
> It is typical to put an example in tools/pygrub/examples
> 
> Also, you will need to CC George Dunlap and specify why this change
> might want a freeze exception to be included in 4.4
> 
Alright. I'll CC George.

> > ---
> >  tools/pygrub/src/GrubConf.py |    4 +++-
> >  1 file changed, 3 insertions(+), 1 deletion(-)
> >
> > diff --git a/tools/pygrub/src/GrubConf.py b/tools/pygrub/src/GrubConf.py
> > index cb853c9..974cded 100644
> > --- a/tools/pygrub/src/GrubConf.py
> > +++ b/tools/pygrub/src/GrubConf.py
> > @@ -348,7 +348,9 @@ class Grub2Image(_GrubImage):
> >                  
> >      commands = {'set:root': 'root',
> >                  'linux': 'kernel',
> > +                'linux16': 'kernel',
> >                  'initrd': 'initrd',
> > +                'initrd16': 'initrd',
> >                  'echo': None,
> >                  'insmod': None,
> >                  'search': None}
> > @@ -394,7 +396,7 @@ class Grub2ConfigFile(_GrubConfigFile):
> >                  continue
> >  
> >              # new image
> > -            title_match = re.match('^menuentry ["\'](.*)["\'] (.*){', l)
> > +            title_match = re.match('^menuentry ["\'](.*?)["\'] (.*){', l)
> 
> Why is this necessary? fedora-19 also have the aformentioned "--class
> red, --class gnu" yet is parsed happily.

A menuentry from RHEL 7 looks like this...

menuentry 'Red Hat Enterprise Linux Everything, with Linux 
0-rescue-af34f0b8cf364cdbbe6d093f8228a37f' --class red --class gnu-linux 
--class gnu --class os $menuentry_id_option 
'gnulinux-0-rescue-af34f0b8cf364cdbbe6d093f8228a37f-advanced-d23b8b49-4cfe-4900-8ef1-ec80bc633163'
 

So we need 'lazy' match with '.*?'.

-Joby



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

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