Fix redfish cheat sheet firmware update
Hardcoding redfish paths is contrary to the Redfish standard. While the
redfish cheat sheet hardcodes a number of paths, the firmware update
path is particularly hairy, as it's preventing us from effecting a
change that is correct per the standard, but because clients have copied
the incorrect cheat-sheet, requires openbmc to do code gymnastics to
keep some semblance of backward compatibility.
This commit fixes the documentation to call UpdateService, and pull out
the appropriate fields to then make a subsequent call to upload the
payload.
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I5b822ec9f4495f1dcacd9973f31787ed23163870
diff --git a/REDFISH-cheatsheet.md b/REDFISH-cheatsheet.md
index 189a1b9..21ede1f 100644
--- a/REDFISH-cheatsheet.md
+++ b/REDFISH-cheatsheet.md
@@ -123,8 +123,11 @@
Note the `<image file path>` must be a tarball.
```
-curl -k -H "X-Auth-Token: $token" -H "Content-Type: application/octet-stream" -X POST -T <image file path> https://${bmc}/redfish/v1/UpdateService
+uri=$(curl -k -H "X-Auth-Token: $token" https://${bmc}/redfish/v1/UpdateService | jq -r ' .HttpPushUri')
+
+curl -k -H "X-Auth-Token: $token" -H "Content-Type: application/octet-stream" -X POST -T <image file path> https://${bmc}${uri}
```
+
TFTP Firmware update using TransferProtocol:
Note: The `<image file path>` contains the address of the TFTP service: `xx.xx.xx.xx/obmc-phosphor-xxxxx-xxxxxxxxx.static.mtd.tar`