add bios update support
The BIOS would be updated using multipart-form update as HTTP Push URI
is being default used for BMC updates.
Tested:
```
> curl -k -H "X-Auth-Token: $token" -X GET https://${bmc}/redfish/v1/UpdateService/FirmwareInventory/bios_active
{
"@odata.id": "/redfish/v1/UpdateService/FirmwareInventory/bios_active",
"@odata.type": "#SoftwareInventory.v1_1_0.SoftwareInventory",
"Description": "Host image",
"Id": "bios_active",
"Name": "Software Inventory",
"RelatedItem": [
{
"@odata.id": "/redfish/v1/Systems/system/Bios"
}
],
"RelatedItem@odata.count": 1,
"Status": {
"Health": "OK",
"HealthRollup": "OK",
"State": "Enabled"
},
"Updateable": true,
"Version": "null"
}
> curl -k -H "X-Auth-Token: $token" -H "Content-Type:multipart/form-data" -X POST -F UpdateParameters="{\"Targets\":[\"/redfish/v1/UpdateService/FirmwareInventory/bios_active\"],\"@Redfish.OperationApplyTime\":\"OnReset\"};type=appli
cation/json" -F "UpdateFile=@bios_image.tar;type=application/octet-stream" https://${bmc}/redfish/v1/UpdateService/update
{
"@odata.id": "/redfish/v1/TaskService/Tasks/0",
"@odata.type": "#Task.v1_4_3.Task",
"Id": "0",
"TaskState": "Running",
"TaskStatus": "OK"
}
> curl -k -H "X-Auth-Token: $token" -X GET https://${bmc}/redfish/v1/UpdateService/FirmwareInventory/bios_active
{
"@odata.id": "/redfish/v1/UpdateService/FirmwareInventory/bios_active",
"@odata.type": "#SoftwareInventory.v1_1_0.SoftwareInventory",
"Description": "Host image",
"Id": "bios_active",
"Name": "Software Inventory",
"RelatedItem": [
{
"@odata.id": "/redfish/v1/Systems/system/Bios"
}
],
"RelatedItem@odata.count": 1,
"Status": {
"Health": "OK",
"HealthRollup": "OK",
"State": "Enabled"
},
"Updateable": true,
"Version": "2.17.0-dev-703-g61fd99b720-TestBios"
}
```
Change-Id: I213e28d7d1a00aa15f695ab855a96961113548ae
Signed-off-by: Jagpal Singh Gill <paligill@gmail.com>
diff --git a/item_updater_main.cpp b/item_updater_main.cpp
index 3d725b7..7709ec9 100644
--- a/item_updater_main.cpp
+++ b/item_updater_main.cpp
@@ -7,6 +7,8 @@
#include <sdbusplus/bus.hpp>
#include <sdbusplus/server/manager.hpp>
+using ItemUpdaterIntf = phosphor::software::updater::ItemUpdater;
+
int main()
{
sdbusplus::async::context ctx;
@@ -14,8 +16,8 @@
// Add sdbusplus ObjectManager.
sdbusplus::server::manager_t objManager(ctx, SOFTWARE_OBJPATH);
- phosphor::software::updater::ItemUpdater updater(ctx, SOFTWARE_OBJPATH,
- false);
+ ItemUpdaterIntf updater(ctx, SOFTWARE_OBJPATH,
+ ItemUpdaterIntf::UpdaterType::ALL, false);
ctx.request_name(BUSNAME_UPDATER);