Allow glob or regex kernel matching rather than substring #759
colmbuckley
started this conversation in
Feature Requests
Replies: 1 comment 7 replies
-
LOL; I just looked at the code... the comparison is already done using |
Beta Was this translation helpful? Give feedback.
7 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
TL;DR: maybe allow
org.zfsbootmenu:kernel
to be a glob or regex pattern.My situation; I have a number of systems which perform tasks like building modules for other systems. In order to achieve this, the kernel sources for the target systems need to be installed and, on some distributions (eg: recent Debian), this also brings in the kernel images for the target systems. However, obviously these might not be bootable on the current system.
I can set the desired kernel in
org.zfsbootmenu:kernel
of course, but there's a bit of a potential race condition here; if the system reboots before I have the opportunity to correctly set the kernel, there's a chance that an unbootable kernel will be chosen by ZBM's algorithm, necessitating tedious recovery.If
org.zfsbootmenu:kernel
were interpreted as a glob or regular expression which filtered the available kernels in the relevant dataset and then chose the last one (ordered by version string), I think that would still be compatible with current usage, but also allow for richer automatic kernel selection.Suppose for example we had the following kernels installed in /boot:
If I never wanted the current machine to boot any experimental kernels, and also exclude the
-cloud-
variants, I could setorg.zfsbootmenu:kernel
to something like*+[bd]*[o0-9]-amd64
and from the list above it would only match the first and thirs, and would pickvmlinuz-6.12.33+deb12-cloud-amd64
as the last in that list.This might end up a bit inelegant with globs, so regular expressions might be better - maybe if
org.zfsbootmenu:kernel
begins and ends with/
it would be interpreted as a regular expression, so we could set it to/(bpo|deb[0-9]+)-amd64$/
which would be clearer? This would not break any existing usage, as we would never expect to see/
in an existing version string.Beta Was this translation helpful? Give feedback.
All reactions