autotest/autotest — Issue #199: boottool/grubby: parsing error with grub2
Author: clebergnu
Created: 2012-02-24 15:56:22+00:00
State: open
Labels: boottool

On a (debian) system with grub2, grubby finds a 3rd entry, when only 2 `menuentry` lines exist.

```
root@debian:~/src/grubby# grubby --grub2 -c /boot/grub/grub.cfg --info=ALL
index=0
kernel=/boot/vmlinuz-2.6.32-5-amd64
args="ro quiet"
root=UUID=2ca745ff-2256-446e-a1ce-d40bd7b929d2
initrd=/boot/initrd.img-2.6.32-5-amd64
title=Debian GNU/Linux, with Linux 2.6.32-5-amd64
index=1
kernel=/boot/vmlinuz-2.6.32-5-amd64
args="ro single"
root=UUID=2ca745ff-2256-446e-a1ce-d40bd7b929d2
initrd=/boot/initrd.img-2.6.32-5-amd64
title=Debian GNU/Linux, with Linux 2.6.32-5-amd64 (recovery mode)
index=2
non linux entry
```

Notice the second entry (`index=2`), but only 2 `menuentry` lines exist in the configuration:

```
root@debian:~/src/grubby# grep ^menuentry /boot/grub/grub.cfg
menuentry 'Debian GNU/Linux, with Linux 2.6.32-5-amd64' --class debian --class gnu-linux --class gnu --class os {
menuentry 'Debian GNU/Linux, with Linux 2.6.32-5-amd64 (recovery mode)' --class debian --class gnu-linux --class gnu --class os {
```