update-grub fails because 10_linux_zfs puts a spare closed brace

Bug #1852611 reported by Luca Citi
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
grub2 (Ubuntu)
New
Undecided
Unassigned

Bug Description

I have installed 19.10 on a zfs filesystem using the installer.
I have also installed zfs-auto-snapshot. Zsys is not installed.
When I run "update-grub", I get the error:

Adding boot menu entry for EFI firmware configuration
error: syntax error.
error: Incorrect command.
error: syntax error.
Syntax error at line 178

At that line the file contains an unmatched closed brace "}".

Looking at the code for /etc/grub.d/10_linux_zfs I think that the error is caused by the line "at_least_one_entry=1" at row 864. Since the "main" entry does not open an extra brace (unlike, "advanced" or "history"), I don't think it should set the flag to trigger the addition of the extra closed brace at line 942.

Commenting line 864 fixes the problem in my case.

=== Environment ===

$ lsb_release -rd
Description: Ubuntu 19.10
Release: 19.10

$ apt-cache policy grub-common
grub-common:
  Installed: 2.04-1ubuntu12
  Candidate: 2.04-1ubuntu12
  Version table:
 *** 2.04-1ubuntu12 500
        500 http://gb.archive.ubuntu.com/ubuntu eoan/main amd64 Packages
        100 /var/lib/dpkg/status

Tags: zfs
Revision history for this message
Vadim (vadim-ktnkv) wrote :

Same issue for me, grub update cannot create config file.
Problem was into "10_linux_zfs" and 10_linux. These scripts cant detect my pool with OS, maybe becouse of chroot env.
I did add my pool to:
GRUB_CMDLINE_LINUX="root=ZFS=OS/ROOT/ubuntu"
And it isn't working, but it worked on ubuntu 19.04

tags: added: zfs
Revision history for this message
Luca Citi (knulp79) wrote :

Dear Jean-Baptiste and Didier

I fail to see how this is a duplicate of bug #1848399. Could you please explain? My pool imports just fine and if I comment the line 864 everything works like a charm.

Thanks,
Luca

Revision history for this message
Didier Roche-Tolomelli (didrocks) wrote :

The extra } is a consequence of multiple things, like no good recover found, or invalid linux entry data. I guess your bug should rather be a duplicate of bug #1848856.

In any case, both of them are fixed in this ppa (https://launchpad.net/~ubuntu-desktop/+archive/ubuntu/zsys) before we release an SRU for eoan. Do you mind giving it a try and report it fixes your issues?
Thanks!

Revision history for this message
Luca Citi (knulp79) wrote :

Hi Didier

You are right, this is rather a duplicate of bug #1848856. Both bpool and rpool are mirrored in my case.

$ grub-probe --target=device /boot/
/dev/sdb98
/dev/sda98
$ grub-probe --target=device /boot/ | head -1
/dev/sdb98

The new release fixes this problem.

Many thanks,
Luca

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.