[Bug 1876331] [NEW] update-grub fails to add ZFS menu entries

Jim Hunziker 1876331 at bugs.launchpad.net
Fri May 1 15:42:00 UTC 2020


Public bug reported:

This is for:

Ubuntu 20.04 LTS
grub-common 2.04-1ubuntu26

I don't know how I got into this mess (maybe by removing ZFS @install
snapshots?), but update-grub stopped adding any Ubuntu entries to my
menu.cfg.

The culprit is the use of \t as a field separator in
/etc/grub.d/10_linux_zfs.

There's a line that says:
        echo "${dataset}\t${is_zsys}\t${machine_id}\t${pretty_name}\t${last_used}\t${initrd_device}\t${initrd_list}\t${kernel_list}\t${last_booted_kernel}"


Instead, it should say:
        echo -e "${dataset}\t${is_zsys}\t${machine_id}\t${pretty_name}\t${last_used}\t${initrd_device}\t${initrd_list}\t${kernel_list}\t${last_booted_kernel}"

By default, echo does not interpret the escaped tab sequence, \t. So all
of the awk lines that use it as a field separator elsewhere in the
script fail.

Adding the above -e flag fixed my problem.

** Affects: grub2 (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to grub2 in Ubuntu.
https://bugs.launchpad.net/bugs/1876331

Title:
  update-grub fails to add ZFS menu entries

Status in grub2 package in Ubuntu:
  New

Bug description:
  This is for:

  Ubuntu 20.04 LTS
  grub-common 2.04-1ubuntu26

  I don't know how I got into this mess (maybe by removing ZFS @install
  snapshots?), but update-grub stopped adding any Ubuntu entries to my
  menu.cfg.

  The culprit is the use of \t as a field separator in
  /etc/grub.d/10_linux_zfs.

  There's a line that says:
          echo "${dataset}\t${is_zsys}\t${machine_id}\t${pretty_name}\t${last_used}\t${initrd_device}\t${initrd_list}\t${kernel_list}\t${last_booted_kernel}"

  
  Instead, it should say:
          echo -e "${dataset}\t${is_zsys}\t${machine_id}\t${pretty_name}\t${last_used}\t${initrd_device}\t${initrd_list}\t${kernel_list}\t${last_booted_kernel}"

  By default, echo does not interpret the escaped tab sequence, \t. So
  all of the awk lines that use it as a field separator elsewhere in the
  script fail.

  Adding the above -e flag fixed my problem.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/1876331/+subscriptions



More information about the foundations-bugs mailing list