diff --git a/debian/patches/0012-initramfs-Fix-legacy-mountpoint-rootfs.patch b/debian/patches/0012-initramfs-Fix-legacy-mountpoint-rootfs.patch new file mode 100644 index 0000000..e26941d --- /dev/null +++ b/debian/patches/0012-initramfs-Fix-legacy-mountpoint-rootfs.patch @@ -0,0 +1,58 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Ryan Moeller +Date: Mon, 12 Dec 2022 13:23:06 -0500 +Subject: [PATCH] initramfs: Fix legacy mountpoint rootfs + +Legacy mountpoint datasets should not pass `-o zfsutil` to `mount.zfs`. +Fix the logic in `mount_fs()` to not forget we have a legacy mountpoint +when checking for an `org.zol:mountpoint` userprop. + +Reviewed-by: Richard Yao +Reviewed-by: Brian Behlendorf +Signed-off-by: Ryan Moeller +Closes #14274 +(cherry picked from commit 786ff6a6cb33226b4f4292c7569b9093286f74d9) +(cherry picked from commit f28c7302cb77a8cb6112690d0eed0bf4adeeae15) +Signed-off-by: Stoiko Ivanov +--- + contrib/initramfs/scripts/zfs | 20 ++++++++------------ + 1 file changed, 8 insertions(+), 12 deletions(-) + +diff --git a/contrib/initramfs/scripts/zfs b/contrib/initramfs/scripts/zfs +index 9169adf5f..c7548fa07 100644 +--- a/contrib/initramfs/scripts/zfs ++++ b/contrib/initramfs/scripts/zfs +@@ -331,25 +331,21 @@ mount_fs() + # Can't use the mountpoint property. Might be one of our + # clones. Check the 'org.zol:mountpoint' property set in + # clone_snap() if that's usable. +- mountpoint=$(get_fs_value "$fs" org.zol:mountpoint) +- if [ "$mountpoint" = "legacy" ] || +- [ "$mountpoint" = "none" ] || +- [ "$mountpoint" = "-" ] ++ mountpoint1=$(get_fs_value "$fs" org.zol:mountpoint) ++ if [ "$mountpoint1" = "legacy" ] || ++ [ "$mountpoint1" = "none" ] || ++ [ "$mountpoint1" = "-" ] + then + if [ "$fs" != "${ZFS_BOOTFS}" ]; then + # We don't have a proper mountpoint and this + # isn't the root fs. + return 0 +- else +- # Last hail-mary: Hope 'rootmnt' is set! +- mountpoint="" + fi +- fi +- +- # If it's not a legacy filesystem, it can only be a +- # native one... +- if [ "$mountpoint" = "legacy" ]; then + ZFS_CMD="mount.zfs" ++ # Last hail-mary: Hope 'rootmnt' is set! ++ mountpoint="" ++ else ++ mountpoint="$mountpoint1" + fi + fi + diff --git a/debian/patches/series b/debian/patches/series index d2770d3..50ec4e7 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -9,3 +9,4 @@ 0009-Patch-move-manpage-arcstat-1-to-arcstat-8.patch 0010-arcstat-Fix-integer-division-with-python3.patch 0011-arc-stat-summary-guard-access-to-l2arc-MFU-MRU-stats.patch +0012-initramfs-Fix-legacy-mountpoint-rootfs.patch