Skip to content

Conversation

@zdykstra
Copy link
Member

@zdykstra zdykstra commented Feb 6, 2021

On systems with a large number of boot environments or snapshots, sorting by name can be less than optimal. This PR adds the following:

  • Allow zbm.sort_key to be set on the KCL, with name, creation, used considered valid sort keys
  • Add a hook for mod-o on the BE and snapshot list screens, allowing the sorting method to be changed. Changing the sorting method on one screen changes it on the other, as well. This change persists until zfsbootmenu.sh is exited, at which point the selected method reverts to the default (name) or the method defined on the KCL.

Packing the sort methods into the global zbm_sort variable allows easy expansion of sort keys in the future. Simply add the list of valid keys to the array in parse-commandline.sh and it will be accepted and rotated through the list.

The shortcut key combinations have been documented in the online help and the man page, but not in the footer text. I'm open to persuasion on this.

Closes #137

@zdykstra zdykstra requested a review from ahesford February 6, 2021 17:29
@vozhyk-
Copy link
Contributor

vozhyk- commented Feb 6, 2021

I have tried this on my system, and it appears to work correctly:

  • Adding zbm.sort_key=creation to the zfsbootmenu kernel command line does make it sort the BEs by creation time (with the active BE on top).
  • Pressing Control-o in the boot menu does cycle between sorting by creation, name, and used.

@zdykstra
Copy link
Member Author

zdykstra commented Feb 7, 2021

I have tried this on my system, and it appears to work correctly:

* Adding `zbm.sort_key=creation` to the zfsbootmenu kernel command line does make it sort the BEs by creation time (with the active BE on top).

* Pressing `Control-o` in the boot menu does cycle between sorting by `creation`, `name`, and `used`.

Thank you for testing this! Pending a merge and official release, does this otherwise meet your needs?

@zdykstra zdykstra merged commit 44ed892 into master Feb 8, 2021
@zdykstra zdykstra deleted the be-sort branch February 8, 2021 23:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Sort the BEs by creation time in the boot menu

4 participants