Bug 1484261 - Grub lens does not parse menu.lst with boot key
Summary: Grub lens does not parse menu.lst with boot key
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: augeas
Version: 7.4
Hardware: Unspecified
OS: Unspecified
Target Milestone: rc
: ---
Assignee: Pino Toscano
QA Contact: Virtualization Bugs
Depends On:
Blocks: TRACKER-bugs-affecting-libguestfs
TreeView+ depends on / blocked
Reported: 2017-08-23 07:03 UTC by Jaroslav Spanko
Modified: 2020-12-14 09:39 UTC (History)
3 users (show)

Fixed In Version: augeas-1.4.0-5.el7
Doc Type: Bug Fix
Doc Text:
Prior to this update, Augeas was not able to parse the boot key in in the GRUB 1 configuration (/boot/grub/menu.lst). The grub lens of Augeas has been fixed to parse also the boot key. As a result, Augeas now reads /boot/grub/menu.lst also with boot keys.
Clone Of:
Last Closed: 2018-04-10 09:55:26 UTC
Target Upstream Version:

Attachments (Terms of Use)
v2v debug (deleted)
2017-08-23 07:03 UTC, Jaroslav Spanko
no flags Details
v2v debug (4.66 MB, text/plain)
2017-08-23 07:04 UTC, Jaroslav Spanko
no flags Details
grub.conf (1.75 KB, text/plain)
2017-08-23 07:04 UTC, Jaroslav Spanko
no flags Details

System ID Private Priority Status Summary Last Updated
Github hercules-team augeas pull 494 0 None closed Grub: handle top-level "boot" directive 2021-02-10 11:10:53 UTC
Red Hat Product Errata RHBA-2018:0684 0 None None None 2018-04-10 09:56:37 UTC

Description Jaroslav Spanko 2017-08-23 07:03:09 UTC
Description of problem:
augeas is not able to parse the boot line in menu.lst/grub.conf which cause that v2v is not able to convert guest

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. prepare the RHEL 6.x or Centos 6.x with enable boot line 
2. v2v fails 

Actual results:
libguestfs: trace: v2v: aug_get "/files/boot/grub/menu.lst/default"
guestfsd: main_loop: proc 24 (aug_match) took 0.00 seconds
guestfsd: main_loop: new request, len 0x50
guestfsd: error: no matching node
libguestfs: trace: v2v: aug_get = NULL (error)
kernels offered by the bootloader in this guest (first in list is default):
virt-v2v: error: no kernels were found in the bootloader configuration.

Expected results:
augeas should ignore the line which cannot parse or handle the boot line

Additional info:
In the attachment the grub config and the v2v debug log

Comment 2 Jaroslav Spanko 2017-08-23 07:04:05 UTC
Created attachment 1316963 [details]
v2v debug

Comment 3 Jaroslav Spanko 2017-08-23 07:04:44 UTC
Created attachment 1316964 [details]

Comment 4 YongkuiGuo 2017-08-25 10:15:31 UTC
I can reproduce this bug with packages:


1.Enable boot line in /boot/grub/menu.lst file on rhel6.9 host.

augtool> print /files/boot/grub/menu.lst
augtool> print /augeas//error
/augeas/files/boot/grub/menu.lst/error = "parse_failed"
/augeas/files/boot/grub/menu.lst/error/pos = "379"
/augeas/files/boot/grub/menu.lst/error/line = "9"
/augeas/files/boot/grub/menu.lst/error/char = "0"
/augeas/files/boot/grub/menu.lst/error/lens = "/usr/share/augeas/lenses/dist/grub.aug:285.14-286.43:"
/augeas/files/boot/grub/menu.lst/error/message = "Get did not match entire input"

Comment 5 Pino Toscano 2017-08-25 11:02:31 UTC
Just one note: "boot" is not a recognized key in the menu.lst file (only in the grub1 CLI).  Most probably grub1 ignores unknown directives in the configuration file.

Comment 6 Pino Toscano 2017-09-11 19:03:46 UTC
Other than the unrecognized boot=device entry, apparently the Grub lens does not seem to handle the empty line (line 18 in attachment 1316964 [details]), still giving a parse error because of it.

Comment 7 Pino Toscano 2017-09-21 16:32:10 UTC
Actually, the problem looks like the provided grub.lst has DOS-style end of line (so \r\n).  Jaroslav, is this the original file from the guest, or was it manually copied&pasted from somewhere (e.g. a screen output)?

Comment 8 Pino Toscano 2017-10-04 11:24:06 UTC
OK, with Jaroslav we checked the grub configuration should be properly saved in the guest, so only the boot key is the issue.

Comment 10 YongkuiGuo 2017-10-09 03:30:35 UTC
Verified with package:


1.Enable boot line in /boot/grub/menu.lst file on rhel6.9 host.

2.#augtool print /files/boot/grub/menu.lst
/files/boot/grub/menu.lst/#comment[1] = "grub.conf generated by anaconda"
/files/boot/grub/menu.lst/#comment[2] = "Note that you do not have to rerun grub after making changes to this file"
/files/boot/grub/menu.lst/#comment[3] = "NOTICE:  You have a /boot partition.  This means that"
/files/boot/grub/menu.lst/#comment[4] = "all kernel and initrd paths are relative to /boot/, eg."
/files/boot/grub/menu.lst/#comment[5] = "root (hd0,0)"
/files/boot/grub/menu.lst/#comment[6] = "kernel /vmlinuz-version ro root=/dev/mapper/VolGroup-lv_root"
/files/boot/grub/menu.lst/#comment[7] = "initrd /initrd-[generic-]version.img"
/files/boot/grub/menu.lst/boot = "/dev/xvda"


Grub lens can parse menu.lst normally. So verified this bug.

Comment 13 errata-xmlrpc 2018-04-10 09:55:26 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.


Note You need to log in before you can comment on or make changes to this bug.