Contribution
A message that is not in the archive (sent off-list or not yet received): [email protected]
I have written two small, simple modules to address limitations I found in in Grub.
1. does simple arithmetic - nothing fancy. It's invoked by using something like this:
insmod arithmetic
arithmetic --set fred --min 2 -- max 10 "1" "+" "2"
the operators supported are unary -,!; binary +,-,/,*,%,<,<=,<.<=,!=,==
--set works in the usual way. If the result is greater than --max, the --min value is returned and vice versa; this useful for cycling round a group of partitions in a round-robin fashion
2. diskinfo.mod introduces two commands: disklabel, diskuuid which return the label and uuid of the specified disk partition. This is useful where, having decided which partition, amongst several, to boot, you can fill in the appropriate value in the "root=UUID=" or "root=label=" Linux kernel parameter.
I looked for details on how to submit new modules, but failed to find anything. How do I go about this?
Nicole
Quoted 6 lines · On Wed, Apr 12, 2017, 20:37 Nicole <[email protected]> wrote:
I have written two small, simple modules to address limitations I found in in Grub.
1. does simple arithmetic - nothing fancy. It's invoked by using something like this:
Quoted 8 lines
insmod arithmetic
arithmetic --set fred --min 2 -- max 10 "1" "+" "2"the operators supported are unary -,!; binary +,-,/,*,%,<,<=,<.<=,!=,== --set works in the usual way. If the result is greater than --max, the --min value is returned and vice versa; this useful for cycling round a group of partitions in a round-robin fashion
Can you have a look if we can have bash syntax $((...)) and $[...] instead? It's more compact and nicer.
Quoted 7 lines
2. diskinfo.mod introduces two commands: disklabel, diskuuid which return the label and uuid of the specified disk partition. This is useful where, having decided which partition, amongst several, to boot, you can fill in the appropriate value in the "root=UUID=" or "root=label=" Linux kernel parameter.
Have a look at probe command. Does it cover your usecase?
Quoted 4 lines
I looked for details on how to submit new modules, but failed to find anything. How do I go about this?
Just send patches here.
Quoted 9 lines
Nicole
_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel