zfsbootmenu icon indicating copy to clipboard operation
zfsbootmenu copied to clipboard

zfsbootmenu: extend zbm.prefer to set bootfs

Open zdykstra opened this issue 9 months ago • 1 comments

Other bootloaders, such as rEFInd, can now be used to drive the boot process by specifying a dataset from which to boot. zbm.prefer now accepts a full dataset path, with the previous ! and !! modifiers still applying to the pool portion of the dataset.

This closes https://github.com/zbm-dev/zfsbootmenu/discussions/738

zdykstra avatar Apr 16 '25 02:04 zdykstra

I wonder if it makes sense to extend the zbm.prefer syntax to accommodate this capability without an additional option. The argument to zbm.prefer could be the desired filesystem, with the pool and bootfs extracted directly. The only drawback is ambiguity when the user might wish to specify a bootfs pointing to the top-level filesystem. I think this would be an unlikely edge case; most sources don't recommend putting any content on the root-level filesystem. A trailing slash on a top-level filesystem could be used to disambiguate in this corner case (e.g., zbm.prefer=pool/.

Extending zbm.prefer to also accept a dataset is an interesting idea.

  • zbm.prefer=zroot - look to this pool for the bootfs value

  • zbm.prefer=zroot/ROOT/void - explicitly use that as the bootfs value

  • zbm.prefer=zroot! - make sure this pool is imported before proceeding, use the bootfs value set on the pool

  • zbm.prefer=zroot/ROOT/void! - make sure this pool is imported before proceeding, explicitly use that as the bootfs value

  • zbm.prefer=zroot!! - import only that pool, use the bootfs value set on the pool

  • zbm.prefer=zroot/ROOT/void!! - import only that pool, explicitly use that value as the bootfs value

That seems like it could work, and wouldn't change any existing behavior of the zbm.prefer KCL option.

zdykstra avatar Apr 16 '25 13:04 zdykstra