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
- ;;
--- 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 */etc) path="$ (findmnt -n -o TARGET -T "${etc_dir}")" */etc) path="$ (findmnt -n -o TARGET -T "${etc_dir}")"
# 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/
- snapshot_
- 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/
+ snapshot_
+ umount "${snapshot_path}" || true
+ ;;
+ esac
+ fi
}
# Scan available boot options and returns in a formatted list LINUX_ZFS_ TEST}" in
grub_ menu="$ (generate_ grub_menu "${menu_ metadata} ")"
@@ -1128,7 +1132,3 @@ case "${GRUB_
if [ -n "${grub_menu}" ]; then
# We want the trailing newline as a marker will be added
- echo "${grub_menu}"
- fi
- ;;