From: git Date: Fri, 17 Jul 2026 06:47:06 +0000 (-0400) Subject: initial commit - migrate dracut-zfs-mount to gentoo-patches X-Git-Url: https://git.datadissipation.net/gentoo-patches/commitdiff_plain/fe7acb28bea94e087426d4096483e7fa62359a34?ds=sidebyside initial commit - migrate dracut-zfs-mount to gentoo-patches --- fe7acb28bea94e087426d4096483e7fa62359a34 diff --git a/README.md b/README.md new file mode 100644 index 0000000..703facf --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +* `dracut-zfs-mount` - mount all ZFS datasets from the imported pools before switching to the new root, helpful if crucial system binaries/libraries are on a separate dataset. Note that the mountpoints will technically change from `$PATH` to `/sysroot/$PATH`. This is mostly harmless, but remounting a dataset will mount it at the actual `/sysroot/$PATH`, so be careful. diff --git a/dracut-zfs-mount.patch b/dracut-zfs-mount.patch new file mode 100644 index 0000000..c762606 --- /dev/null +++ b/dracut-zfs-mount.patch @@ -0,0 +1,21 @@ +--- a/contrib/dracut/90zfs/mount-zfs.sh.in 2026-06-11 21:00:38.614793958 -0400 ++++ b/contrib/dracut/90zfs/mount-zfs.sh.in 2026-06-11 21:02:55.365106238 -0400 +@@ -85,7 +85,7 @@ + if ! zpool get -Ho value name "${ZFS_POOL}" > /dev/null 2>&1; then + info "ZFS: Importing pool ${ZFS_POOL}..." + # shellcheck disable=SC2086 +- if ! zpool import -N ${ZPOOL_IMPORT_OPTS} "${ZFS_POOL}"; then ++ if ! zpool import -NR /sysroot ${ZPOOL_IMPORT_OPTS} "${ZFS_POOL}"; then + warn "ZFS: Unable to import pool ${ZFS_POOL}" + rootok=0 + return 1 +@@ -118,3 +118,9 @@ + rootok=0 + return 1 + fi ++ ++info "ZFS: Mounting all datasets..." ++if ! zfs mount -a; then ++ rootok=0 ++ return 1 ++fi