XPost: linux.debian.devel.release   
   From: shankerwangmiao@gmail.com   
      
   Package: release.debian.org   
   Severity: normal   
   Tags: trixie   
   User: release.debian.org@packages.debian.org   
   Usertags: pu   
   Control: affects -1 + src:grub2   
   X-Debbugs-Cc: GRUB Maintainers , Harry   
   Chen    
      
   [ Reason ]   
   grub2 in trixie is affected by #848945, where during the running of   
   grub-mkconfig, if the rootfs is on ZFS, it tries to read the name of   
   the zpool using grub-probe, which refuses to handle zpool with features   
   unsupported by grub2 enabled, even if grub2 itself (and /boot) is not   
   installed on the same ZFS filesystem. The bug thus prevents from ZFS on root   
   installs from normal booting because the command line passed to the kernel   
   in the generated grub configuration lacks the name of the zpool containing   
   rootfs.   
      
   [ Tests ]   
   I've tested the patches personally on arm64 and can confirm the introduced   
   patches can fix the issue in question.   
      
   [ Risks ]   
   Risks are minimal. The introduced patch only changes the configuration   
   generation scripts, without changing the C code.   
      
   [ Checklist ]   
   [x] *all* changes are documented in the d/changelog   
   [x] I reviewed all changes and I approve them   
   [x] attach debdiff against the package in (old)stable   
   [x] the issue is verified as fixed in unstable   
      
   [ Changes ]   
   * Non-maintainer upload.   
   * Apply patch from upstream to fix zfs root identification when generating   
    configure files (Closes: #848945)   
      
   [ Other info ]   
   n/a   
      
   Miao Wang   
      
   diff -Nru grub2-2.12/debian/changelog grub2-2.12/debian/changelog   
   --- grub2-2.12/debian/changelog 2025-07-03 16:35:51.000000000 +0000   
   +++ grub2-2.12/debian/changelog 2026-02-15 13:50:20.000000000 +0000   
   @@ -1,3 +1,11 @@   
   +grub2 (2.12-9+deb13u1) trixie; urgency=medium   
   +   
   + * Non-maintainer upload.   
   + * Apply patch from upstream to fix zfs root identification when generating   
   + configure files (Closes: #848945)   
   +   
   + -- Miao Wang Sun, 15 Feb 2026 13:50:20 +0000   
   +   
    grub2 (2.12-9) unstable; urgency=medium   
      
    * Apply patch by Ben Hutchings to not strip .exec or .image files   
   diff -Nru grub2-2.12/debian/patches/series grub2-2.12/debian/patches/series   
   --- grub2-2.12/debian/patches/series 2025-07-03 16:35:51.000000000 +0000   
   +++ grub2-2.12/debian/patches/series 2026-02-15 13:50:20.000000000 +0000   
   @@ -70,6 +70,7 @@   
    fdt-device-tree-fixup-protocol.patch   
    extra_deps_lst.patch   
    upstream/acpi-Fix-out-of-bounds-access-in-grub_acpi_xsdt_find_tabl.patch   
   +upstream/zfs-fix-LINUX_ROOT_DEVICE-when-grub-probe-fails.patch   
    install-signed.patch   
    grub-install-extra-removable.patch   
    grub-install-removable-shim.patch   
   diff -Nru grub2-2.12/debian/patches/upstream/zfs-fix-LINUX_ROOT_   
   EVICE-when-grub-probe-fails.patch grub2-2.12/debian/patches/upst   
   eam/zfs-fix-LINUX_ROOT_DEVICE-when-grub-probe-fails.patch   
   --- grub2-2.12/debian/patches/upstream/zfs-fix-LINUX_ROOT_DEVICE   
   when-grub-probe-fails.patch 1970-01-01 00:00:00.000000000 +0000   
   +++ grub2-2.12/debian/patches/upstream/zfs-fix-LINUX_ROOT_DEVICE   
   when-grub-probe-fails.patch 2026-02-15 13:50:20.000000000 +0000   
   @@ -0,0 +1,44 @@   
   +From: Doug Goldstein    
   +Date: Thu, 17 Dec 2020 20:27:14 -0600   
   +Subject: zfs: fix LINUX_ROOT_DEVICE when grub-probe fails   
   +   
   +When grub-probe fails, the current code is to just stuff an empty result   
   +in which causes the user to not knowingly have a system that no longer   
   +boots. grub-probe can fail because the ZFS pool that contains the root   
   +filesystem might have features that grub does not yet support which is a   
   +common configuration for people with a rpool and a bpool. This behavior   
   +uses the zdb utility to dump the same value as the filesystem label   
   +would print.   
   +   
   +Signed-off-by: Doug Goldstein    
   +---   
   + util/grub.d/10_linux.in | 2 +-   
   + util/grub.d/20_linux_xen.in | 2 +-   
   + 2 files changed, 2 insertions(+), 2 deletions(-)   
   +   
   +Index: grub2-2.12/util/grub.d/10_linux.in   
   +===================================================================   
   +--- grub2-2.12.orig/util/grub.d/10_linux.in   
   ++++ grub2-2.12/util/grub.d/10_linux.in   
   +@@ -94,7 +94,7 @@ case x"$GRUB_FS" in   
   + GRUB_CMDLINE_LINUX="rootflags=subvol=${rootsubvol} ${GRUB   
   CMDLINE_LINUX}"   
   + fi;;   
   + xzfs)   
   +- rpool=`${grub_probe} --device ${GRUB_DEVICE} --target=fs_label 2>/dev/null   
   || true`   
   ++ rpool=`${grub_probe} --device ${GRUB_DEVICE} --target=fs_label 2>/dev/null   
   || zdb -l ${GRUB_DEVICE} | awk -F \' '/ name/ { print $2 }'`   
   + bootfs="`make_system_path_relative_to_its_root / | sed -e "s,@$,,"`"   
   + LINUX_ROOT_DEVICE="ZFS=${rpool}${bootfs%/}"   
   + ;;   
   +Index: grub2-2.12/util/grub.d/20_linux_xen.in   
   +===================================================================   
   +--- grub2-2.12.orig/util/grub.d/20_linux_xen.in   
   ++++ grub2-2.12/util/grub.d/20_linux_xen.in   
   +@@ -86,7 +86,7 @@ case x"$GRUB_FS" in   
   + GRUB_CMDLINE_LINUX="rootflags=subvol=${rootsubvol} ${GRUB   
   CMDLINE_LINUX}"   
   + fi;;   
   + xzfs)   
      
   [continued in next message]   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|