From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: Re: [PATCH] xen/pygrub: grub2/grub.cfg from RHEL 7 has new commands in menuentry. Date: Thu, 30 Jan 2014 11:45:43 +0000 Message-ID: <52EA3B67.2070707@citrix.com> References: <20140130113126.GA3326@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20140130113126.GA3326@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Joby Poriyath Cc: Ian Campbell , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org 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 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 > --- > 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. ~Andrew