[SLOF] [PATCH 2/4] bootmenu: Gather devices and print the menu

Nikunj A Dadhania nikunj at linux.vnet.ibm.com
Mon Jun 5 16:17:32 AEST 2017


Thomas Huth <thuth at redhat.com> writes:

> On 05.06.2017 07:58, Nikunj A Dadhania wrote:
>> Thomas Huth <thuth at redhat.com> writes:
>>
>>> +#define MAX_DEVS 36        /* Enough for 10 digits + 26 letters */
>>> +#define MAX_ALIAS_LEN 8    /* Maximum length of alias names */
>>> +
>>> +struct bootdev {
>>> +	char alias[MAX_ALIAS_LEN];
>>> +	char *path;
>>> +};
>>> +

>>> +
>>> +static void bootmenu_populate_devs(void)
>>> +{
>>> +	char *aliases[] = { "cdrom", "disk", "net", NULL };
>>> +	int ai, idx;
>>> +
>>> +	for (ai = 0; aliases[ai] != NULL; ai++) {
>>> +		for (idx = 0; idx <= 9; idx++) {
>> 
>> Here we would have cdrom - cdrom9, disk - disk9, and net - net9. That is
>> total 30 devices with cap on 10 devices of one type. I guess this is
>> intentional.
>
> Yes, the Forth code currently even limits the number of aliases per
> class to 8, see MAX-ALIAS in node.fs. So we currently never have aliases
> with more than one digit at the end.
> So I think limiting the boot menu code here to one digit is OK here,
> too. But maybe we should increase MAX-ALIAS to 10 instead of 8 ?

Yes, that will be in line with new boot menu.

Regards
Nikunj



More information about the SLOF mailing list