grub-common update to 2.06-2ubuntu11 broke zfs root boots

Bug #1990143 reported by satmandu
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
grub2 (Ubuntu)
Fix Released
Critical
Unassigned

Bug Description

Running update-grub after updating to grub-common (2.06-2ubuntu11) causes this issue:

sudo update-grub
Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/init-select.cfg'
Generating grub configuration file ...
/etc/grub.d/10_linux_zfs: 1135: Syntax error: end of file unexpected (expecting "fi")
Memtest86+ needs a 16-bit boot, that is not available on EFI, exiting
Warning: os-prober will be executed to detect other bootable partitions.
Its output will be used to detect bootable binaries on them and create new boot entries.

This leads to a grub prompt at boot.

Reverting to grub-common (2.06-2ubuntu7) fixes the issue:

sudo update-grub
Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/init-select.cfg'
Generating grub configuration file ...
Found linux image: vmlinuz-6.0.0-rc6 in rpool/ROOT/ubuntu_s2a3h5
Found initrd image: initrd.img-6.0.0-rc6 in rpool/ROOT/ubuntu_s2a3h5
Found linux image: vmlinuz-6.0.0-rc5 in rpool/ROOT/ubuntu_s2a3h5
Found initrd image: initrd.img-6.0.0-rc5 in rpool/ROOT/ubuntu_s2a3h5
Found linux image: vmlinuz-5.19.1 in rpool/ROOT/ubuntu_s2a3h5
Found initrd image: initrd.img-5.19.1 in rpool/ROOT/ubuntu_s2a3h5
Found linux image: vmlinuz-5.19.0-17-generic in rpool/ROOT/ubuntu_s2a3h5
Found initrd image: initrd.img-5.19.0-17-generic in rpool/ROOT/ubuntu_s2a3h5
Found linux image: vmlinuz-5.19.0-16-generic in rpool/ROOT/ubuntu_s2a3h5
Found initrd image: initrd.img-5.19.0-16-generic in rpool/ROOT/ubuntu_s2a3h5
Found linux image: vmlinuz-5.15.0-18-generic in rpool/ROOT/ubuntu_s2a3h5@autozsys_1yhf2b
Found initrd image: initrd.img-5.15.0-18-generic in rpool/ROOT/ubuntu_s2a3h5@autozsys_1yhf2b
Found linux image: vmlinuz-5.15.0-18-generic in rpool/ROOT/ubuntu_s2a3h5@autozsys_0no5ee
Found initrd image: initrd.img-5.15.0-18-generic in rpool/ROOT/ubuntu_s2a3h5@autozsys_0no5ee
Memtest86+ needs a 16-bit boot, that is not available on EFI, exiting
Warning: os-prober will be executed to detect other bootable partitions.
Its output will be used to detect bootable binaries on them and create new boot entries.

ProblemType: Bug
DistroRelease: Ubuntu 22.10
Package: grub-common 2.06-2ubuntu11
Uname: Linux 6.0.0-rc6 x86_64
NonfreeKernelModules: wl zfs zunicode zavl icp zcommon znvpair
ApportVersion: 2.23.0-0ubuntu2
Architecture: amd64
CasperMD5CheckResult: unknown
CurrentDesktop: ubuntu:GNOME
Date: Mon Sep 19 09:22:41 2022
ProcEnviron:
 TERM=xterm-256color
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: grub2
UpgradeStatus: No upgrade log present (probably fresh install)
mtime.conffile..etc.grub.d.40_custom: 2022-03-01T21:57:38.749768

Related branches

Revision history for this message
satmandu (satadru-umich) wrote :
Revision history for this message
satmandu (satadru-umich) wrote :

--- 10_linux_zfs.working 2022-09-19 09:28:36.280002568 -0400
+++ 10_linux_zfs.broken 2022-09-19 09:28:14.093006608 -0400
@@ -529,11 +529,15 @@ get_dataset_info() {

     umount "${mntdir}" || true
     # We needed to look in / for snapshots on root dataset, umount the snapshot for etc before zfs lazily unmount it
- case "${etc_dir}" in /.zfs/snapshot/*/etc)
- snapshot_path="$(findmnt -n -o TARGET -T "${etc_dir}")"
- umount "${snapshot_path}" || true
- ;;
- esac
+ # This process only needs to run if the snapshot contains an .../etc path,
+ # otherwise the build process may silently fail and produce no kernel lines in grub.cfg
+ if [ -e "${etc_dir}" ]; then
+ case "${etc_dir}" in /.zfs/snapshot/*/etc)
+ snapshot_path="$(findmnt -n -o TARGET -T "${etc_dir}")"
+ umount "${snapshot_path}" || true
+ ;;
+ esac
+ fi
 }

 # Scan available boot options and returns in a formatted list
@@ -1128,7 +1132,3 @@ case "${GRUB_LINUX_ZFS_TEST}" in
         grub_menu="$(generate_grub_menu "${menu_metadata}")"
         if [ -n "${grub_menu}" ]; then
             # We want the trailing newline as a marker will be added
- echo "${grub_menu}"
- fi
- ;;

Revision history for this message
satmandu (satadru-umich) wrote :

sudo cp 10_linux_zfs.working /etc/grub.d/10_linux_zfs
satadru@mbp113 /tmp$ sudo update-grub
Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/init-select.cfg'
Generating grub configuration file ...
Found linux image: vmlinuz-6.0.0-rc6 in rpool/ROOT/ubuntu_s2a3h5
Found initrd image: initrd.img-6.0.0-rc6 in rpool/ROOT/ubuntu_s2a3h5
Found linux image: vmlinuz-6.0.0-rc5 in rpool/ROOT/ubuntu_s2a3h5
Found initrd image: initrd.img-6.0.0-rc5 in rpool/ROOT/ubuntu_s2a3h5
Found linux image: vmlinuz-5.19.1 in rpool/ROOT/ubuntu_s2a3h5
Found initrd image: initrd.img-5.19.1 in rpool/ROOT/ubuntu_s2a3h5
Found linux image: vmlinuz-5.19.0-17-generic in rpool/ROOT/ubuntu_s2a3h5
Found initrd image: initrd.img-5.19.0-17-generic in rpool/ROOT/ubuntu_s2a3h5
Found linux image: vmlinuz-5.19.0-16-generic in rpool/ROOT/ubuntu_s2a3h5
Found initrd image: initrd.img-5.19.0-16-generic in rpool/ROOT/ubuntu_s2a3h5
Found linux image: vmlinuz-5.15.0-18-generic in rpool/ROOT/ubuntu_s2a3h5@autozsys_1yhf2b
Found initrd image: initrd.img-5.15.0-18-generic in rpool/ROOT/ubuntu_s2a3h5@autozsys_1yhf2b
Found linux image: vmlinuz-5.15.0-18-generic in rpool/ROOT/ubuntu_s2a3h5@autozsys_0no5ee
Found initrd image: initrd.img-5.15.0-18-generic in rpool/ROOT/ubuntu_s2a3h5@autozsys_0no5ee
Memtest86+ needs a 16-bit boot, that is not available on EFI, exiting
Warning: os-prober will be executed to detect other bootable partitions.
Its output will be used to detect bootable binaries on them and create new boot entries.
done

summary: - grub-common update broke zfs root boots
+ grub-common update to 2.06-2ubuntu11 broke zfs root boots
description: updated
tags: added: block-proposed regression-proposed
Revision history for this message
Julian Andres Klode (juliank) wrote :

There seems to be a bug in when the patch series was cleaned up by importing it into the gbp pq and re-exporting it, it dropped the last two lines from the patch. It's unclear what is happening there.

However, the patch seems to be invalid: Even quilt pushing the original patch does not produce those lines even though they are in the pach.

Changed in grub2 (Ubuntu):
importance: Undecided → Critical
Revision history for this message
Julian Andres Klode (juliank) wrote :

Fixed in 2.06-2ubuntu12

Changed in grub2 (Ubuntu):
status: New → Fix Committed
tags: removed: block-proposed regression-proposed
Revision history for this message
satmandu (satadru-umich) wrote :

Thanks! This fixes the issue for me.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package grub2 - 2.06-2ubuntu12

---------------
grub2 (2.06-2ubuntu12) kinetic; urgency=medium

  * ubuntu-zfs-enhance-support.patch: Fix missing lines (LP: #1990143)

 -- Julian Andres Klode <email address hidden> Mon, 19 Sep 2022 16:00:47 +0200

Changed in grub2 (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers