The help command in grub command line lists commands, and shows a number after the command. Numbers like (0+), (1+), (0-). What do these numbers and sign mean?
Example -
cat (0-) some description
...
sleep (1+) other description
...
I am running Fedora 39, with grub 2.06, up-to date.
I tried checking in the grub source code - path grub2-2.06-118.fc39.src/grub-2.06/grub-core/commands/help.c from this page.
But the source code does not seem to show that. Moreover, it does not match the actual behaviour of commands.
In the code, as well as the grub manual, if given an argument, the help command should only display the commands starting with the argument, but on my system, it always shows all commands, ignoring any arguments.
How can I get the source code of grub running on my system, which matches the actual behavior?
but this does not explain me what this info exactly means. Apparently, for “cat” there is an active version and a non-active version???
The “help.c” source file shows a two-column layout as shown in the BIOS version without those numbers.
In grub-core/kern/command.c, I see this code in function grub_register_command_prio. It seems like when registering a command, it checks if there is an existing command registered with same name, and if one is found, compares their priority and marks that command as inactive.
for (p = &grub_command_list, q = *p; q; p = &(q->next), q = q->next)
{
int r;
r = grub_strcmp (cmd->name, q->name);
if (r < 0)
break;
if (r > 0)
continue;
if (cmd->prio >= (q->prio & GRUB_COMMAND_PRIO_MASK))
{
q->prio &= ~GRUB_COMMAND_FLAG_ACTIVE;
break;
}
inactive = 1;
}
*p = cmd;
cmd->next = q;
if (q)
q->prev = &cmd->next;
cmd->prev = p;
if (! inactive)
cmd->prio |= GRUB_COMMAND_FLAG_ACTIVE;
So it looks like those numbers are only for “internal use” and have no value for the user.
Just wondering why “cat” is listed two times with one inactive version.