ZFS snapshots without etc directory causes grub.cfg build failure

Bug #1965983 reported by Adam Bell
14
This bug affects 1 person
Affects Status Importance Assigned to Milestone
grub2 (Ubuntu)
Triaged
Undecided
Mate Kukri
Focal
Triaged
Wishlist
Mate Kukri
Jammy
Triaged
Wishlist
Mate Kukri

Bug Description

In /etc/grub.d/10_linux_zfs (built during install from util/grub.d/10_linux_zfs.in), get_dataset_info() tries to unmount mount locations starting with the logic
```
case "${etc_dir}" in /.zfs/snapshot/*/etc)
```

This process occasionally and silently fails while building /boot/grub/grub.cfg when running in FIPS mode (with FIPS kernels), which leaves the generated /boot/grub/grub.cfg without any kernel (linux ...) lines.
It appears that not all ZFS snapsshots that match the switch statement actually have an .../etc directory.

As ZFS is only an option in the Focal Desktop installer, this issue was only tested with Focal running Canonical's FIPS packages.

In order to reproduce this issue in FIPS mode, the ubuntu-fips and fips-initramfs-generic packages both need to implement a couple of patches that haven't released yet. Without these two patches and without manual intervention, the FIPS kernel will be unable to boot with a ZFS /boot device. I can provide these additional patches -- please feel free to reach out to me!

Related branches

Revision history for this message
Adam Bell (arbell) wrote :
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "Patch built for the grub2=2.04-1ubuntu26.13 package" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
tags: added: rls-ff-incoming rls-jj-incoming
tags: added: fr-2137
Revision history for this message
Julian Andres Klode (juliank) wrote :

@didrocks Does this look about right?

tags: removed: rls-jj-incoming
tags: removed: rls-ff-incoming
Changed in grub2 (Ubuntu):
status: New → Fix Committed
no longer affects: grub2 (Ubuntu Impish)
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
Revision history for this message
Simon Chopin (schopin) wrote :

Julian, are you working on backports of this fix for Focal and Jammy?

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

Yes and no. Lots of patches to cherry pick when SRU development opens again, but I'll likely not check the bug list but backport the changes in one larger upload.

Graham Inggs (ginggs)
Changed in grub2 (Ubuntu Focal):
status: New → Triaged
Changed in grub2 (Ubuntu Jammy):
status: New → Triaged
tags: added: foundations-todo
removed: fr-2137
Mate Kukri (mkukri)
Changed in grub2 (Ubuntu):
assignee: nobody → Mate Kukri (mkukri)
Mate Kukri (mkukri)
Changed in grub2 (Ubuntu Focal):
assignee: nobody → Mate Kukri (mkukri)
Changed in grub2 (Ubuntu Jammy):
assignee: nobody → Mate Kukri (mkukri)
Mate Kukri (mkukri)
information type: Public → Public Security
information type: Public Security → Private Security
information type: Private Security → Public Security
information type: Public Security → Public
information type: Public → Public Security
information type: Public Security → Public
Revision history for this message
Mate Kukri (mkukri) wrote :

The fix for this apparently doesn't fix the issue at all, and more investigation needs to be done.

Revision history for this message
Julian Andres Klode (juliank) wrote :

Resetting the fix released to triaged then

Changed in grub2 (Ubuntu):
status: Fix Released → Triaged
Mate Kukri (mkukri)
Changed in grub2 (Ubuntu Focal):
importance: High → Wishlist
Changed in grub2 (Ubuntu Jammy):
importance: High → Wishlist
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.