From mboxrd@z Thu Jan 1 00:00:00 1970 From: Joby Poriyath Subject: [PATCH] xen/pygrub: grub2/grub.cfg from RHEL 7 has new commands in menuentry. Date: Thu, 30 Jan 2014 11:31:40 +0000 Message-ID: <20140130113126.GA3326@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xen.org Cc: Andrew Cooper , Ian Campbell List-Id: xen-devel@lists.xenproject.org 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 --- 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) if title_match: if img is not None: raise RuntimeError, "syntax error: cannot nest menuentry (%d %s)" % (len(img),img) -- 1.7.10.4