[SLOF] [PATCH] Fix ugly boot menu if devices have been specified with bootindex

Alexey Kardashevskiy aik at ozlabs.ru
Mon Apr 10 17:34:58 AEST 2017

On 05/04/17 21:21, Thomas Huth wrote:
> On 05.04.2017 10:55, Nikunj A Dadhania wrote:
>> Thomas Huth <thuth at redhat.com> writes:
>>> On 05.04.2017 10:26, Nikunj A Dadhania wrote:
>>>> Nikunj A Dadhania <nikunj at linux.vnet.ibm.com> writes:
>>>>> Thomas Huth <thuth at redhat.com> writes:
>>>>>> If the user has started with some devices that have the bootindex
>>>>>> parameter set, these devices show up in a very ugly way in the boot
>>>>>> menu of SLOF. For example, if you start QEMU with:
>>>>>>  qemu-system-ppc64 ... -boot menu=on -device spapr-vscsi,id=scsi0 \
>>>>>>   -drive file=distro.iso,if=none,media=cdrom,readonly=on,id=img0 \
>>>>>>   -device scsi-cd,drive=img0,bootindex=1
>>>>> From distant memory, I understand that "-boot" and bootindex are
>>>>> mutually exclusive. bootindex was introduced to qemu to get rid of
>>>>> restrictive -boot option.
>>>> For example, with "-boot order=cd" if we have 2disks, there is no way to specify
>>>> which one to boot from. SLOF will boot from the first disk alias.
>>>> If a selection is needed: menu=on is added, and we can then press F12 to
>>>> get to menu and select the second disk.
>>>> While for bootindex, I can use qemu command-line(bootindex=1) or libvirt
>>>> xml tag "<boot order='1'/>" for the second disk. So with bootindex,
>>>> there is no need for "-boot menu=on,order=cd"
>>> Agreed, but it is still possible to enable the boot menu if you're also
>>> using "bootindex" ...
>> True, unfortunately :(
>>> so please ignore my original patch, but I think
>>> the boot menu code should also not take the devices in $bootdev into
>>> account that have been specified with bootindex.
>>> So likely the right solution is to simply skip all entries there that
>>> are not aliases (i.e. skip the entries that start with a slash).
>> Yes, that should be fine.

If I personally wanted to use "-boot menu=on", I would expect SLOF to list
all bootable devices, each menu item would be just a single long
device-tree path without any alias. I do not see any use for bootindex with
"menu=on" so I'd just ignore (or menu could run timeout and show what it
will pick if the user does not make a choice).

And the only case when I would want this would be having many devices
(actually even 2 devices of the same type is enough for example) so the
only way to tell what corresponds to what in the QEMU command line would be
seeing 1) device type (virtio, e1000,...) 2) pci or vio address - and
aliases hide this information.

imho aliases only make some sense when the user got just few devices,
preferably one of each type.

> Actually, the boot menu is also broken in another case: If you store
> something in the "boot-device" environment variable, it only shows that
> value. For example with
>  qemu-system-ppc64 ... -boot menu=on -cdrom some.iso  \
>    -prom-env boot-device=disk
> the boot menu only shows "disk", and ignores the CD-ROM. Fortunately,
> hardly anybody uses these environment variables with QEMU nowadays.

Hacking directly on promenv calls for problems and whoever does this should
understand the consequences well :)

> But
> still, the behavior of the boot menu looks pretty wrong here to me.

imho the option itself is quite useless today.


More information about the SLOF mailing list