commit | 0554c984827c1593663257a842d0cd943ce4f508 | [log] [tgz] |
---|---|---|
author | Andrew Geissler <geissonator@yahoo.com> | Tue Apr 23 14:40:12 2019 -0500 |
committer | Ed Tanous <ed.tanous@intel.com> | Wed Jun 26 18:20:31 2019 +0000 |
tree | ea0369802a2b813710a9ea2a4c4c6d18d9614c95 | |
parent | e4a4b9a95622b8e1c1bae93718699ad19f4882ac [diff] |
simpleupdate: Basic support of SimpleUpdate This is TFTP only since that is all the OpenBMC back end currently supports Design Doc Ref: https://gerrit.openbmc-project.xyz/c/openbmc/docs/+/20700 Tested: 1) Verified BMC image update via new SimpleUpdate interface worked curl -k -H "X-Auth-Token: $TOKEN" -d '{"ImageURI":"XXX.XX.X.X/obmc-phosphor-image-witherspoon.ubi.mtd.tar","TransferProtocol":"TFTP"}' -X POST https://${BMC_IP}/redfish/v1/UpdateService/Actions/UpdateService.SimpleUpdate { "@Message.ExtendedInfo": [ { "@odata.type": "/redfish/v1/$metadata#Message.v1_0_0.Message", "Message": "Successfully Completed Request", "MessageArgs": [], "MessageId": "Base.1.4.0.Success", "Resolution": "None", "Severity": "OK" } ] } 2) Verified encoding the protocol in ImageURI worked curl -k -H "X-Auth-Token: $TOKEN" -X POST https://${BMC_IP}/redfish/v1/UpdateService/Actions/UpdateService.SimpleUpdate -d '{"ImageURI":"tftp://${TFTP_IP}/obmc-phosphor-image-witherspoon.ubi.mtd.tar"}' { "@Message.ExtendedInfo": [ { "@odata.type": "/redfish/v1/$metadata#Message.v1_0_0.Message", "Message": "Successfully Completed Request", "MessageArgs": [], "MessageId": "Base.1.4.0.Success", "Resolution": "None", "Severity": "OK" } ] } Jun 12 20:52:20 witherspoon bmcweb[2470]: (2019-06-12 20:52:20) [DEBUG ] Enter UpdateService.SimpleUpdate doPost Jun 12 20:52:20 witherspoon bmcweb[2470]: (2019-06-12 20:52:20) [DEBUG ] Encoded transfer protocol tftp Jun 12 20:52:20 witherspoon bmcweb[2470]: (2019-06-12 20:52:20) [DEBUG ] Adjusted imageUri ${BMC_IP}/obmc-phosphor-image-witherspoon.ubi.mtd.tar Jun 12 20:52:20 witherspoon bmcweb[2470]: (2019-06-12 20:52:20) [DEBUG ] Server: ${TFTP_IP} File: obmc-phosphor-image-witherspoon.ubi.mtd.tar Jun 12 20:52:20 witherspoon bmcweb[2470]: (2019-06-12 20:52:20) [DEBUG ] Exit UpdateService.SimpleUpdate doPost 3) Verified if no transfer protocol, error returned curl -k -H "X-Auth-Token: $TOKEN" -X POST https://${BMC_IP}/redfish/v1/UpdateService/Actions/UpdateService.SimpleUpdate -d '{"ImageURI":”${TFTP_IP}/obmc-phosphor-image-witherspoon.ubi.mtd.tar"}' { "error": { "@Message.ExtendedInfo": [ { "@odata.type": "/redfish/v1/$metadata#Message.v1_0_0.Message", "Message": "The value ${TFTP_IP}/obmc-phosphor-image-witherspoon.ubi.mtd.tar for the parameter ImageURI in the action UpdateService.SimpleUpdate is of a different type than the parameter can accept.", "MessageArgs": [ “${TFTP_IP}/obmc-phosphor-image-witherspoon.ubi.mtd.tar", "ImageURI", "UpdateService.SimpleUpdate" ], "MessageId": "Base.1.4.0.ActionParameterValueTypeError", "Resolution": "Correct the value for the parameter in the request body and resubmit the request if the operation failed.", "Severity": "Warning" } ], "code": "Base.1.4.0.ActionParameterValueTypeError", "message": "The value ${TFTP_IP}/obmc-phosphor-image-witherspoon.ubi.mtd.tar for the parameter ImageURI in the action UpdateService.SimpleUpdate is of a different type than the parameter can accept." } } 4) Verified no new error in Redfish Validator 5) Verified error return when parameter missing: curl -k -H "X-Auth-Token: $TOKEN" -d '{"TransferProtocol":"TFTP"}' -X POST https://${BMC_IP}/redfish/v1/UpdateService/Actions/UpdateService.SimpleUpdate { "ImageURI@Message.ExtendedInfo": [ { "@odata.type": "/redfish/v1/$metadata#Message.v1_0_0.Message", "Message": "The property ImageURI is a required property and must be included in the request.", "MessageArgs": [ "ImageURI" ], "MessageId": "Base.1.4.0.PropertyMissing", "Resolution": "Ensure that the property is in the request body and has a valid value and resubmit the request if the operation failed.", "Severity": "Warning" } ] } 6) Verified that by default, the new Action is not available Change-Id: I67ea91e181380e6da7ff63a37f02408a318602b7 Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
This component attempts to be a "do everything" embedded webserver for openbmc.
At this time, the webserver implements a few interfaces:
BMCWeb is configured by setting -D
flags that correspond to options in bmcweb/CMakeLists.txt
and then compiling. For example, cmake -DBMCWEB_ENABLE_KVM=NO ...
followed by make
. The option names become C++ preprocessor symbols that control which code is compiled into the program.
When BMCWeb starts running, it reads persistent configuration data (such as UUID and session data) from a local file. If this is not usable, it generates a new configuration.
When BMCWeb SSL support is enabled and a usable certificate is not found, it will generate a self-sign a certificate before launching the server. The keys are generated by the prime256v1
algorithm. The certificate
C=US, O=OpenBMC, CN=testhost
,SHA-256
algorithm.The crow project has had a number of additions to make it more useful for use in the OpenBmc Project. A non-exhaustive list is below. At the time of this writing, the crow project is not accepting patches, so for the time being crow will simply be checked in as is.