diff options
author | Jia, chunhui <chunhui.jia@linux.intel.com> | 2019-05-06 11:29:54 +0800 |
---|---|---|
committer | Tom Joseph <tomjoseph@in.ibm.com> | 2019-05-23 16:33:04 +0000 |
commit | 67c5e5d60e78b4e9b3b27abf380a681c7522813f (patch) | |
tree | 29d16793153fc3ffd6c3b073e7b06e88bdd24dc1 /chassishandler.cpp | |
parent | fdb8389df74f9f0d6428252a75c33f6abf6d8481 (diff) | |
download | phosphor-host-ipmid-67c5e5d60e78b4e9b3b27abf380a681c7522813f.tar.gz phosphor-host-ipmid-67c5e5d60e78b4e9b3b27abf380a681c7522813f.zip |
Add support for removable media/Floppy
1. fix issue for handling unsupported parameter
2. add support for floppy/USB boot
There is dbus interface change in:
https://gerrit.openbmc-project.xyz/c/openbmc/phosphor-dbus-interfaces/+/21177
Test:
$ ipmitool -H <ip> -P 0penBmc -I lanplus raw
0x0 0x8 0x5 0x80 0x14 0x00 0x00 0x00
$ ipmitool -H <ip> -P 0penBmc -I lanplus chassis bootparam get 5
...
- Boot Device Selector : Force Boot from CD/DVD
...
$ipmitool -H <ip> -P 0penBmc -I lanplus raw
0x0 0x8 0x5 0x80 0x3c 0x00 0x00 0x00
$ipmitool -H <ip> -P 0penBmc -I lanplus chassis bootparam get 5
...
- Boot Device Selector : Force Boot from Floppy/primary removable media
...
Change-Id: I915aaa3f684d02d0dfc4b65afb3c1db139c41781
Signed-off-by: Jia, chunhui <chunhui.jia@linux.intel.com>
Diffstat (limited to 'chassishandler.cpp')
-rw-r--r-- | chassishandler.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/chassishandler.cpp b/chassishandler.cpp index c9b39c0..f17fa9d 100644 --- a/chassishandler.cpp +++ b/chassishandler.cpp @@ -1288,6 +1288,7 @@ 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 = { @@ -1299,6 +1300,7 @@ std::map<Source::Sources, IpmiValue> sourceDbusToIpmi = { {Source::Sources::Network, 0x01}, {Source::Sources::Disk, 0x02}, {Source::Sources::ExternalMedia, 0x05}, + {Source::Sources::RemovableMedia, 0x0f}, {Source::Sources::Default, ipmiDefault}}; std::map<Mode::Modes, IpmiValue> modeDbusToIpmi = { @@ -1592,6 +1594,13 @@ ipmi_ret_t ipmi_chassis_set_sys_boot_options(ipmi_netfn_t netfn, ipmi_cmd_t cmd, setBootSource(Source::Sources::Default); } } + if ((modeIpmiToDbus.end() == modeItr) && + (sourceIpmiToDbus.end() == sourceItr)) + { + // return error if boot option is not supported + *data_len = 0; + return IPMI_CC_INVALID_FIELD_REQUEST; + } } catch (InternalFailure& e) { |