Support for the "BIOS boot type" option in the 'phosphor-host-ipmid'

Konstantin Aladyshev aladyshev22 at gmail.com
Tue Feb 9 06:38:18 AEDT 2021


What was the point of splitting IPMI boot source interface to BootMode
and BootSource?
https://github.com/openbmc/phosphor-dbus-interfaces/blob/master/xyz/openbmc_project/Control/Boot/Mode.interface.yaml
https://github.com/openbmc/phosphor-dbus-interfaces/blob/master/xyz/openbmc_project/Control/Boot/Source.interface.yaml

In the IPMI specification all possible boot options are represented by
"Boot Device Selector" field in the "Get System Boot Options" сommand:

```
[5:2] - Boot device selector
0000b = No override
0001b = Force PXE
0010b = Force boot from default Hard-drive
0011b = Force boot from default Hard-drive, request Safe Mode
0100b = Force boot from default Diagnostic Partition
0101b = Force boot from default CD/DVD
0110b = Force boot into BIOS Setup
0111b = Force boot from remotely connected (redirected) Floppy/primary
removable media
1001b = Force boot from primary remote media
1000b = Force boot from remotely connected (redirected) CD/DVD
1010b = reserved
1011b = Force boot from remotely connected (redirected) Hard Drive
1100-1110b = Reserved
1111b = Force boot from Floppy/primary removable media
```

With this in mind, splitting Boot device selector to `BootMode` and
`BootSource` seems to be redundant:


https://github.com/openbmc/phosphor-host-ipmid/blob/master/chassishandler.cpp
```
std::map<IpmiValue, Source::Sources> sourceIpmiToDbus = {
    {0x01, Source::Sources::Network},
    {0x02, Source::Sources::Disk},
    {0x05, Source::Sources::ExternalMedia},
    {0x0f, Source::Sources::RemovableMedia},
    {ipmiDefault, Source::Sources::Default}};

std::map<IpmiValue, Mode::Modes> modeIpmiToDbus = {
#ifdef ENABLE_BOOT_FLAG_SAFE_MODE_SUPPORT
    {0x03, Mode::Modes::Safe},
#endif // ENABLE_BOOT_SAFE_MODE_SUPPORT
    {0x06, Mode::Modes::Setup},
    {ipmiDefault, Mode::Modes::Regular}};
```

And the main question is, what is the best way to add `BIOS boot type`
option functionality to the current design?
Currently `phosphor-host-ipmid` lacks support for the IPMI BIOS boot type field:

```
[5] - BIOS boot type (for BIOS that support both legacy and EFI boots)
0b = “PC compatible” boot (legacy)
1b = Extensible Firmware Interface Boot (EFI)
```

Because of this it is not possible to select EFI or Legacy boot with
the ipmitool. `phosphor-host-ipmid` always reports BIOS boot type flag
as "Legacy". And this could lead to problems in the HOST firmware that
expects this feature to be working in the BMC.

```
~$ ipmitool -U root -P 0penBmc -H 192.168.101.221 -I lanplus -C 17
chassis bootdev none options=efiboot
Set Boot Device to none
~$ ipmitool -U root -P 0penBmc -H 192.168.101.221 -I lanplus -C 17
chassis bootparam get 5
Boot parameter version: 1
Boot parameter 5 is valid/unlocked
Boot parameter data: 8000000000
 Boot Flags :
   - Boot Flag Valid
   - Options apply to only next boot
   - BIOS PC Compatible (legacy) boot
   - Boot Device Selector : No override
   - Console Redirection control : System Default
   - BIOS verbosity : Console redirection occurs per BIOS
configuration setting (default)
   - BIOS Mux Control Override : BIOS uses recommended setting of the
mux at the end of POST
```

What is the best way to add support for this kind of functionality?
Should I add another phosphor-dbus-interface, something like
`/xyz/openbmc_project/Control/Boot/Type.interface.yaml`?
I guess I just want to know OpenBMC community opinion regarding this
problem before I start working on the solution.

Best regards,
Konstantin Aladyshev


More information about the openbmc mailing list