Hello,


Am 19.10.2021 um 08:47 schrieb Glenn Washburn:

Note, only the first occurance of the conditional is searched for to
determine if the conditional is enabled. So simply appending ",-conditional"
to the $debug variable may not disable that conditional, if, for example,
the conditional is already present. To illustrate, the command
"set debug=all,btrfs,-scripting,-btrfs" will not disable btrfs.

A sligtly bigger problem of the implementation is that


set debug=all,-cryptodisk,-crypt,-disk

will only exclude cryptodisk, as the other two are found as substrings
first. Same for e.g. fs,xfs or ata,pata.

But it is probably the best compromise (both performance- and code-size
wise) when considering grub's built-in string functions, when parsing
this exact command syntax.

As there is no real advantage of both including and excluding
conditionals (with the exception of "all"), a pragmatic approach may be
to change the syntax, so that instead of

set debug=all,-scripting,-btrfs

one has to specify

set debug=-scripting,btrfs

(i.e. if the first character of the variable is a -, the rest is a list
of excluded debug conditionals). So after comparing the first character,
you can skip it and use grub_strword on the rest.

But probably I'm missing something simple. :)


Regards,


Michael

_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel

Reply via email to