History log of /openbmc/phosphor-bmc-code-mgmt/common/include/software_manager.hpp (Results 1 – 5 of 5)
Revision Date Author Comments
# e2cd6759 15-Aug-2025 Alexander Hansen <alexander.hansen@9elements.com>

common: Add getBusName function

Add this function as 'protected' to be able to call it from test code.

The alternative would be to reconstruct the bus name in test code based
on the unique suffix,

common: Add getBusName function

Add this function as 'protected' to be able to call it from test code.

The alternative would be to reconstruct the bus name in test code based
on the unique suffix, duplicating the code.

Tested: Inspection only.

Change-Id: Iafed55b5869850f8e1d547e580bdaffd5cfbb6eb
Signed-off-by: Alexander Hansen <alexander.hansen@9elements.com>

show more ...


# cec14752 08-May-2025 Alexander Hansen <alexander.hansen@9elements.com>

common: handle match for config intf added/removed

When the configuration interface for any device is added or removed as
part of dynamic configuration (via EM) the software manager has to
handle th

common: handle match for config intf added/removed

When the configuration interface for any device is added or removed as
part of dynamic configuration (via EM) the software manager has to
handle the dbus match and add or remove devices as necessary.

When an update is in progress, the device is not removed,
even if the configuration was removed.

Tested: On Tyan S8030 with bios software updater

For testing add/remove of configuration interfaces, the configuration
was probed on the powersupply FRU.

In case of InterfacesAdded:

```
May 26 14:54:00 s8030-bmc-30303035c0c1 phosphor-bios-software-update[9530]: [config] found configuration interface at xyz.openbmc_project.EntityManager, /xyz/openbmc_project/inventory/system/board/HostSPIFlash/HostSPIFlash
May 26 14:54:09 s8030-bmc-30303035c0c1 phosphor-bios-software-update[9530]: Missing property Name on path /xyz/openbmc_project/inventory/system/board/HostSPIFlash/HostSPIFlash, interface xyz.openbmc_project.Configuration.SPIFlash.MuxOutputs1
May 26 14:54:09 s8030-bmc-30303035c0c1 phosphor-bios-software-update[9530]: Missing property Polarity on path /xyz/openbmc_project/inventory/system/board/HostSPIFlash/HostSPIFlash, interface xyz.openbmc_project.Configuration.SPIFlash.MuxOutputs1
May 26 14:54:09 s8030-bmc-30303035c0c1 phosphor-bios-software-update[9530]: SPI device: 1:0
May 26 14:54:09 s8030-bmc-30303035c0c1 phosphor-bios-software-update[9530]: Found SPI Address 1e630000.spi
May 26 14:54:09 s8030-bmc-30303035c0c1 phosphor-bios-software-update[9530]: SPI Device HostSPIFlash at 1:0 initialized successfully
May 26 14:54:09 s8030-bmc-30303035c0c1 phosphor-bios-software-update[9530]: HostSPIFlash_5930: created dbus interfaces on path /xyz/openbmc_project/software/HostSPIFlash_5930
May 26 14:54:09 s8030-bmc-30303035c0c1 phosphor-bios-software-update[9530]: [Software] enabling update of /xyz/openbmc_project/software/HostSPIFlash_5930 (adding the update interface)
```

```
busctl tree xyz.openbmc_project.Software.BIOS
`- /xyz
`- /xyz/openbmc_project
`- /xyz/openbmc_project/software
`- /xyz/openbmc_project/software/HostSPIFlash_5930
```

In case of InterfacesRemoved:

```
May 26 14:58:23 s8030-bmc-30303035c0c1 phosphor-bios-software-update[9530]: detected interface xyz.openbmc_project.Configuration.SPIFlash removed on /xyz/openbmc_project/inventory/system/board/HostSPIFlash/HostSPIFlash
May 26 14:58:23 s8030-bmc-30303035c0c1 phosphor-bios-software-update[9530]: removing device at /xyz/openbmc_project/inventory/system/board/HostSPIFlash/HostSPIFlash
```

```
busctl tree xyz.openbmc_project.Software.BIOS
`- /xyz
`- /xyz/openbmc_project
`- /xyz/openbmc_project/software
```

Change-Id: I4faeb8e0144408b57767783ba2c5c4f3561f4021
Signed-off-by: Alexander Hansen <alexander.hansen@9elements.com>

show more ...


# 90174799 08-May-2025 Alexander Hansen <alexander.hansen@9elements.com>

common: extract handleInterfaceAdded

The function is extracted from initDevices to decouple it from iterating
over the object mapper response.

Code is only moved and not changed.

Tested: Unit Test

common: extract handleInterfaceAdded

The function is extracted from initDevices to decouple it from iterating
over the object mapper response.

Code is only moved and not changed.

Tested: Unit Tests Pass

Change-Id: I5d776818ca1bd7fb335bc540b07ff12993c1125e
Signed-off-by: Alexander Hansen <alexander.hansen@9elements.com>

show more ...


# de5e76fa 20-Feb-2025 Alexander Hansen <alexander.hansen@9elements.com>

fix object manager path and emit interfaces added

- move object manager to the correct path
- setup the bus name in constructor
- emit 'InterfacesAdded' signal for object manager to find our
softw

fix object manager path and emit interfaces added

- move object manager to the correct path
- setup the bus name in constructor
- emit 'InterfacesAdded' signal for object manager to find our
software version

Since properties can be uninitialized in the generated bindings,
we have to initialize each property like version and version purpose.

Since object mapper relies on 'InterfacesAdded' signal, emit that
signal such that our version is found in the firmware inventory.

Tested: on Tyan S8030 board with bios code updater

Using dbus-monitor, verify that the signal was emitted for initial
version.

```
dbus-monitor --system "sender='xyz.openbmc_project.Software.BIOS',member='InterfacesAdded'"

signal time=1740740306.586571 sender=:1.266 -> destination=(null destination) serial=21 path=/xyz/openbmc_project/software; interface=org.freedesktop.DBus.ObjectManager; member=InterfacesAdded
object path "/xyz/openbmc_project/software/HostSPIFlash_1520"
array [
dict entry(
string "xyz.openbmc_project.Software.Version"
array [
dict entry(
string "Version"
variant string "v1.03"
)
dict entry(
string "Purpose"
variant string "xyz.openbmc_project.Software.Version.VersionPurpose.Other"
)
]
)
]
```

Using object mapper, verify that it has picked up our initial version:

```
busctl call xyz.openbmc_project.ObjectMapper /xyz/openbmc_project/object_mapper xyz.openbmc_project.ObjectMapper GetSubTree sias /xyz/openbmc_project/ 0 1 xyz.openbmc_project.Software.Version
```

Not showing output here since it gets verbose.

Checking the firmware inventory, the version also shows up:
```
{
"@odata.id": "/redfish/v1/UpdateService/FirmwareInventory",
"@odata.type": "#SoftwareInventoryCollection.SoftwareInventoryCollection",
"Members": [
{
"@odata.id": "/redfish/v1/UpdateService/FirmwareInventory/5e6297dd"
},
{
"@odata.id": "/redfish/v1/UpdateService/FirmwareInventory/HostSPIFlash_1520"
},
{
"@odata.id": "/redfish/v1/UpdateService/FirmwareInventory/bios_active"
}
],
"Members@odata.count": 3,
"Name": "Software Inventory Collection"
}
```

Checking the specific entry:
```
curl $creds https://$bmc/redfish/v1/UpdateService/FirmwareInventory/HostSPIFlash_1520
{
"@odata.id": "/redfish/v1/UpdateService/FirmwareInventory/HostSPIFlash_1520",
"@odata.type": "#SoftwareInventory.v1_1_0.SoftwareInventory",
"Description": "Other image",
"Id": "HostSPIFlash_1520",
"Name": "Software Inventory",
"Status": {
"Health": "Warning",
"HealthRollup": "OK",
"State": "Disabled"
},
"Updateable": false,
"Version": "v1.03"
}
```

Now, running an update:

```
curl -k --insecure --user root:root -H Content-Type:multipart/form-data -X POST -F 'UpdateParameters={"Targets":["/redfish/v1/UpdateService/FirmwareInventory/HostSPIFlash_1520"],"@Redfish.OperationApplyTime":"Immediate"};type=application/json' -F 'UpdateFile=@pldm-package.bin;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"
}
```

Checking the task status:
```
curl --silent --insecure --user root:root https://${bmc}/redfish/v1/TaskService/Tasks/0
{
"@odata.id": "/redfish/v1/TaskService/Tasks/0",
"@odata.type": "#Task.v1_4_3.Task",
"EndTime": "2025-02-28T11:10:55+00:00",
"HidePayload": false,
"Id": "0",
"Messages": [
{
"@odata.type": "#Message.v1_1_1.Message",
"Message": "The task with Id '0' has started.",
"MessageArgs": [
"0"
],
"MessageId": "TaskEvent.1.0.TaskStarted",
"MessageSeverity": "OK",
"Resolution": "None."
},
{
"@odata.type": "#Message.v1_1_1.Message",
"Message": "The task with Id '0' has changed to progress 10 percent complete.",
"MessageArgs": [
"0",
"10"
],
"MessageId": "TaskEvent.1.0.TaskProgressChanged",
"MessageSeverity": "OK",
"Resolution": "None."
},
{
"@odata.type": "#Message.v1_1_1.Message",
"Message": "The task with Id '0' has changed to progress 20 percent complete.",
"MessageArgs": [
"0",
"20"
],
"MessageId": "TaskEvent.1.0.TaskProgressChanged",
"MessageSeverity": "OK",
"Resolution": "None."
},
{
"@odata.type": "#Message.v1_1_1.Message",
"Message": "The task with Id '0' has changed to progress 70 percent complete.",
"MessageArgs": [
"0",
"70"
],
"MessageId": "TaskEvent.1.0.TaskProgressChanged",
"MessageSeverity": "OK",
"Resolution": "None."
},
{
"@odata.type": "#Message.v1_1_1.Message",
"Message": "The task with Id '0' has changed to progress 100 percent complete.",
"MessageArgs": [
"0",
"100"
],
"MessageId": "TaskEvent.1.0.TaskProgressChanged",
"MessageSeverity": "OK",
"Resolution": "None."
},
{
"@odata.type": "#Message.v1_1_1.Message",
"Message": "The task with Id '0' has completed.",
"MessageArgs": [
"0"
],
"MessageId": "TaskEvent.1.0.TaskCompletedOK",
"MessageSeverity": "OK",
"Resolution": "None."
}
],
"Name": "Task 0",
"Payload": {
"HttpHeaders": [],
"HttpOperation": "POST",
"JsonBody": "null",
"TargetUri": "/redfish/v1/UpdateService/update"
},
"PercentComplete": 100,
"StartTime": "2025-02-28T11:10:28+00:00",
"TaskMonitor": "/redfish/v1/TaskService/TaskMonitors/0",
"TaskState": "Completed",
"TaskStatus": "OK"
}
```

Successfully applied this update and the firmware inventory is changed
as expected

```
{
"@odata.id": "/redfish/v1/UpdateService/FirmwareInventory",
"@odata.type": "#SoftwareInventoryCollection.SoftwareInventoryCollection",
"Members": [
{
"@odata.id": "/redfish/v1/UpdateService/FirmwareInventory/5e6297dd"
},
{
"@odata.id": "/redfish/v1/UpdateService/FirmwareInventory/HostSPIFlash_1149"
},
{
"@odata.id": "/redfish/v1/UpdateService/FirmwareInventory/bios_active"
}
],
"Members@odata.count": 3,
"Name": "Software Inventory Collection"
}
```

Checking the object mapper, it is also aware of the new version.

Change-Id: If45158be3ae486e94ae2feb37ce8163b5f795054
Signed-off-by: Alexander Hansen <alexander.hansen@9elements.com>

show more ...


# cc372355 14-Jan-2025 Alexander Hansen <alexander.hansen@9elements.com>

fw update: common code

new daemons to implement the flow as described in
https://github.com/openbmc/docs/blob/master/designs/code-update.md

- common/
common code folder
- common update flow
-

fw update: common code

new daemons to implement the flow as described in
https://github.com/openbmc/docs/blob/master/designs/code-update.md

- common/
common code folder
- common update flow
- base class for the device specific update daemons

The new daemons are all following the generic template of Code Updater
daemon as outlined in the design.

The idea is that they are separate daemons (per device, as outlined in
the design) but share all the code that's not device specific.

Tested: next patch in series

Change-Id: If2438b8506aceb8c5313ec13a0bf7cb68f3cc279
Signed-off-by: Alexander Hansen <alexander.hansen@9elements.com>

show more ...