History log of /openbmc/estoraged/src/main.cpp (Results 1 – 20 of 20)
Revision Date Author Comments
# c0d66eb7 26-Feb-2024 John Wedig <johnwedig@google.com>

Populate Protocol property in Item.Drive interface

By populating this property, bmcweb can populate the "Protocol"
property in the Drive schema.

Tested:
$ busctl get-property xyz.openbmc_project.eS

Populate Protocol property in Item.Drive interface

By populating this property, bmcweb can populate the "Protocol"
property in the Drive schema.

Tested:
$ busctl get-property xyz.openbmc_project.eStoraged \
/xyz/openbmc_project/inventory/storage/mmcblk0 \
xyz.openbmc_project.Inventory.Item.Drive Protocol
s "xyz.openbmc_project.Inventory.Item.Drive.DriveProtocol.eMMC"

Signed-off-by: John Wedig <johnwedig@google.com>
Change-Id: I2bd19190c445ce57f3d867ffbb437c1a4a370b51

show more ...


# d7be42bd 19-Jan-2024 John Wedig <johnwedig@google.com>

Populate the Type property in Item.Drive interface

By populating this property, bmcweb can populate the "MediaType"
property in the Drive schema.

Tested:
$ busctl get-property xyz.openbmc_project.e

Populate the Type property in Item.Drive interface

By populating this property, bmcweb can populate the "MediaType"
property in the Drive schema.

Tested:
$ busctl get-property xyz.openbmc_project.eStoraged \
/xyz/openbmc_project/inventory/storage/mmcblk0 \
xyz.openbmc_project.Inventory.Item.Drive Type
s "xyz.openbmc_project.Inventory.Item.Drive.DriveType.SSD"

$ curl http://localhost:80/redfish/v1/Chassis/DCSCM/Drives/mmcblk0
{
...
"MediaType": "SSD",
...
}

Signed-off-by: John Wedig <johnwedig@google.com>
Change-Id: I2cb6c7d3ec3b49e8d666da940d873f1117a0aa85

show more ...


# 043af59f 23-Nov-2023 Tom Tung <shes050117@gmail.com>

Get eraseMaxGeometry and eraseMinGeometry from dbus

Also, make findDevice return output parameters based on RVO.

With the change like in EntityManager JSON:
```
{
"Name": "example_emmc",
"T

Get eraseMaxGeometry and eraseMinGeometry from dbus

Also, make findDevice return output parameters based on RVO.

With the change like in EntityManager JSON:
```
{
"Name": "example_emmc",
"Type": "EmmcDevice",
"LocationCode": "location"
"EraseMaxGeometry": 10000000000,
"EraseMinGeometry": 5000000000,
}
```
and geometry values will be set to estoraged.

Tested:
- unit test pass:
```
5/7 util_test OK 0.05s
```

Change-Id: Ia8499af2168c7e740558978273fc80456eb29282
Signed-off-by: Tom Tung <shes050117@gmail.com>

show more ...


# ff1b64f0 20-Oct-2023 Patrick Williams <patrick@stwcx.xyz>

clang-format: copy latest and re-format

clang-format-17 has some backwards incompatible changes that require
additional settings for best compatibility and re-running the formatter.
Copy the latest

clang-format: copy latest and re-format

clang-format-17 has some backwards incompatible changes that require
additional settings for best compatibility and re-running the formatter.
Copy the latest .clang-format from the docs repository and reformat the
repository.

Change-Id: Idc09d9211b70f7afc008f32e8cb66485ebe0510c
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>

show more ...


# 19825057 26-May-2023 Rahul Kapoor <rahulkpr@google.com>

Add support for LocationCode

LocationCode is needed to populate ServiceLabel by BMCWeb for Redfish
resource associated with eStorage.
LocationCode is derived from config object exported by Entity Ma

Add support for LocationCode

LocationCode is needed to populate ServiceLabel by BMCWeb for Redfish
resource associated with eStorage.
LocationCode is derived from config object exported by Entity Manager
in the the following interface:
"xyz.openbmc_project.Configuration.EmmcDevice

To surface LocationCode, the "Exposes" entry in board's Entity Manager
config can add "LocationCode" property as follows:
{
"Name": "example_emmc",
"Type": "EmmcDevice",
"LocationCode": "U1000"
}

Here the LocationCode is the silk screen label.

Tested:

busctl introspect xyz.openbmc_project.eStoraged \
/xyz/openbmc_project/inventory/storage/mmcblk0 \
xyz.openbmc_project.Inventory.Decorator.LocationCode

NAME TYPE SIGNATURE RESULT/VALUE FLAGS
.LocationCode property s "U1000" emits-change

wget -qO- localhost:80/redfish/v1/Chassis/DCSCM/Drives/mmcblk0
{
"@odata.id": "/redfish/v1/Chassis/DCSCM/Drives/mmcblk0",
"@odata.type": "#Drive.v1_7_0.Drive",
"Id": "mmcblk0",
"Links": {
"Chassis": {
"@odata.id": "/redfish/v1/Chassis/DCSCM"
}
},
"Name": "mmcblk0",
"PhysicalLocation": {
"PartLocation": {
"LocationType": "Embedded",
"ServiceLabel": "U1000"
},
"PartLocationContext": "DC_SCM"
},
"PredictedMediaLifeLeftPercent": 100,
"Status": {
"State": "Enabled"
}
}

Change-Id: Ibf53ede5ee65787f9cef53d4bad4cb8fccba3606
Signed-off-by: Rahul Kapoor <rahulkpr@google.com>

show more ...


# 04c28fad 10-May-2023 Patrick Williams <patrick@stwcx.xyz>

clang-format: copy latest and re-format

clang-format-16 has some backwards incompatible changes that require
additional settings for best compatibility and re-running the formatter.
Copy the latest

clang-format: copy latest and re-format

clang-format-16 has some backwards incompatible changes that require
additional settings for best compatibility and re-running the formatter.
Copy the latest .clang-format from the docs repository and reformat the
repository.

Change-Id: Ia968a74764d3bda33160a8a9890629ed3cc94d0e
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>

show more ...


# 61cf4260 17-Mar-2023 John Wedig <johnwedig@google.com>

Fix build warnings

This commit fixes some build warnings in CI caused by unused variables
and an invalid move assignment operator, since a member variable is of
reference type.

Signed-off-by: John

Fix build warnings

This commit fixes some build warnings in CI caused by unused variables
and an invalid move assignment operator, since a member variable is of
reference type.

Signed-off-by: John Wedig <johnwedig@google.com>
Change-Id: I2b813ef017e47f2d35666063435a52638b74d156

show more ...


# b4838308 22-Jul-2022 John Wedig <johnwedig@google.com>

Export the part number and serial number

This commit exposes the eMMC's part name and serial number over the
appropriate D-Bus interface, so that it can be exposed over Redfish in
bmcweb.

Tested:
$

Export the part number and serial number

This commit exposes the eMMC's part name and serial number over the
appropriate D-Bus interface, so that it can be exposed over Redfish in
bmcweb.

Tested:
$ busctl introspect xyz.openbmc_project.eStoraged \
/xyz/openbmc_project/inventory/storage/mmcblk0
...
xyz.openbmc_project.Inventory.Decorator.Asset interface - - -
.PartNumber property s "ABCDEF" emits-change
.SerialNumber property s "123456abcd" emits-change
...
$ wget -qO- http://localhost:80/redfish/v1/Chassis/DC_SCM/Drives/mmcblk0
{
"@odata.id": "/redfish/v1/Chassis/DC_SCM/Drives/mmcblk0",
"@odata.type": "#Drive.v1_7_0.Drive",
"CapacityBytes": 15634268160,
"Id": "mmcblk0",
"Links": {
"Chassis": {
"@odata.id": "/redfish/v1/Chassis/DC_SCM"
}
},
"Name": "Name",
"PartNumber": "ABCDEF",
"PhysicalLocation": {
"PartLocation": {
"LocationType": "Embedded"
}
},
"SerialNumber": "123456abcd",
"Status": {
"State": "Enabled"
}
}

Signed-off-by: John Wedig <johnwedig@google.com>
Change-Id: I1d17f08b99907620b5f2c73fdaeacc84950ce64e

show more ...


# e3ef765d 22-Jul-2022 Patrick Williams <patrick@stwcx.xyz>

sdbusplus: use shorter type aliases

The sdbusplus headers provide shortened aliases for many types.
Switch to using them to provide better code clarity and shorter
lines. Possible replacements are

sdbusplus: use shorter type aliases

The sdbusplus headers provide shortened aliases for many types.
Switch to using them to provide better code clarity and shorter
lines. Possible replacements are for:
* bus_t
* exception_t
* manager_t
* match_t
* message_t
* object_t
* slot_t

Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I3e9d6194f8cc1399acb8afb4348409f4d9781fef

show more ...


# 6c0d8ce1 22-Apr-2022 John Wedig <johnwedig@google.com>

Add association between chassis and drive

This commit adds an association between the storage device ("drive") and
the associated chassis. Specifically, the new association is the
following:
["cha

Add association between chassis and drive

This commit adds an association between the storage device ("drive") and
the associated chassis. Specifically, the new association is the
following:
["chassis", "drive", <chassis_path>]

This association will be used in bmcweb to add Redfish links between
drive and chassis.

Tested:
$ busctl get-property xyz.openbmc_project.eStoraged \
/xyz/openbmc_project/inventory/storage/mmcblk0 \
xyz.openbmc_project.Association.Definitions Associations
$ busctl get-property xyz.openbmc_project.ObjectMapper \
/xyz/openbmc_project/inventory/system/board/dcscm/drive \
xyz.openbmc_project.Association endpoints
$ busctl get-property xyz.openbmc_project.ObjectMapper \
/xyz/openbmc_project/inventory/storage/mmcblk0/chassis \
xyz.openbmc_project.Association endpoints

Signed-off-by: John Wedig <johnwedig@google.com>
Change-Id: Ie21725e9ceb5134ac94854dcb06f3b86a48eeabd

show more ...


# d32b9667 13-Apr-2022 John Wedig <johnwedig@google.com>

Initial integration with Entity Manager

This commit changes eStoraged so that it doesn't take a specific device
as an argument. Instead, it looks for a config object from Entity
Manager and creates

Initial integration with Entity Manager

This commit changes eStoraged so that it doesn't take a specific device
as an argument. Instead, it looks for a config object from Entity
Manager and creates a D-Bus object corresponding to the config object.

The config objects need to expose the following interface:
"xyz.openbmc_project.Configuration.EmmcDevice"

To support more types of storage devices in the future, we can introduce
a new interface for each one.

In addition, eStoraged currently only supports 1 eMMC device. If we want
to support more than one in the future, we will need to add more
information to the Entity Manager config, to distinguish between them.

Assuming the eMMC is located on a FRU-detectable board, an "Exposes"
entry can be added to that board's Entity Manager config, for example:
{
"Name": "example_emmc",
"Type": "EmmcDevice"
}

Doing so will tell Entity Manager to create a config object with the
EmmcDevice interface mentioned above. Then, eStoraged will find the
config object with that interface and create its own D-Bus object that
can be used to manage the eMMC.

Tested:
Updated the Entity Manager config (as described above), started
eStoraged, then tested most of its methods and properties using busctl.
$ busctl call xyz.openbmc_project.eStoraged \
/xyz/openbmc_project/inventory/storage/mmcblk0 \
xyz.openbmc_project.Inventory.Item.Volume FormatLuks ays 3 1 2 3 \
xyz.openbmc_project.Inventory.Item.Volume.FilesystemType.ext4 \
--timeout=60
$ busctl call xyz.openbmc_project.eStoraged \
/xyz/openbmc_project/inventory/storage/mmcblk0 \
xyz.openbmc_project.Inventory.Item.Volume Lock
$ busctl call xyz.openbmc_project.eStoraged \
/xyz/openbmc_project/inventory/storage/mmcblk0 \
xyz.openbmc_project.Inventory.Item.Volume Unlock ay 3 1 2 3
$ busctl get-property xyz.openbmc_project.eStoraged \
/xyz/openbmc_project/inventory/storage/mmcblk0 \
xyz.openbmc_project.Inventory.Item.Volume Locked
$ busctl get-property xyz.openbmc_project.eStoraged \
/xyz/openbmc_project/inventory/storage/mmcblk0 \
xyz.openbmc_project.Inventory.Item.Drive Capacity
$ busctl call xyz.openbmc_project.eStoraged \
/xyz/openbmc_project/inventory/storage/mmcblk0 \
xyz.openbmc_project.Inventory.Item.Volume Erase s \
xyz.openbmc_project.Inventory.Item.Volume.EraseMethod.VerifyGeometry
$ busctl call xyz.openbmc_project.eStoraged \
/xyz/openbmc_project/inventory/storage/mmcblk0 \
xyz.openbmc_project.Inventory.Item.Volume Erase s \
xyz.openbmc_project.Inventory.Item.Volume.EraseMethod.LogicalOverWrite \
--timeout=1200
$ busctl call xyz.openbmc_project.eStoraged \
/xyz/openbmc_project/inventory/storage/mmcblk0 \
xyz.openbmc_project.Inventory.Item.Volume Erase s \
xyz.openbmc_project.Inventory.Item.Volume.EraseMethod.LogicalVerify \
--timeout=1200

Signed-off-by: John Wedig <johnwedig@google.com>
Change-Id: If137d02e185c366f4a1437076512b4883ba6d595

show more ...


# fa5cb6f7 12-Apr-2022 John Wedig <johnwedig@google.com>

Remove device name from D-Bus service name

When eStoraged gets integrated with entity manager, eStoraged could
potentially be used to manage multiple storage devices. And we will want
the different

Remove device name from D-Bus service name

When eStoraged gets integrated with entity manager, eStoraged could
potentially be used to manage multiple storage devices. And we will want
the different D-Bus objects to be under the same service name.

This commit removes the device name from the D-Bus service name, so that
it can ultimately start managing multiple storage devices. This change
has its own commit, since it breaks compatibility with existing client
software.

Tested:
$ busctl introspect xyz.openbmc_project.eStoraged \
/xyz/openbmc_project/inventory/storage/mmcblk0

Signed-off-by: John Wedig <johnwedig@google.com>
Change-Id: I4a1606cbbe20fa97cee0fde81c8cf5731d71f8ee

show more ...


# 5d799bb9 22-Mar-2022 John Edward Broadbent <jebr@google.com>

Add lifetime property for drives interface

This will set the lifetime property when the eStoraged object is
created. This change does not expect the lifetime to change.

Tested:
busctl introspect x

Add lifetime property for drives interface

This will set the lifetime property when the eStoraged object is
created. This change does not expect the lifetime to change.

Tested:
busctl introspect xyz.openbmc_project.eStoraged.mmcblk0 /xyz/openbmc_project/inventory/storage/mmcblk0
NAME TYPE SIGNATURE RESULT/VALUE FLAGS
org.freedesktop.DBus.Introspectable interface - - -
.Introspect method - s -
org.freedesktop.DBus.Peer interface - - -
.GetMachineId method - s -
.Ping method - - -
org.freedesktop.DBus.Properties interface - - -
.Get method ss v -
.GetAll method s a{sv} -
.Set method ssv - -
.PropertiesChanged signal sa{sv}as - -
xyz.openbmc_project.Inventory.Item.Drive interface - - -
.Capacity property t (top secret) emits-change
.PredictedMediaLifeLeftPercent property y 100 emits-change
xyz.openbmc_project.Inventory.Item.Volume interface - - -
.ChangePassword method ayay - -
.Erase method s - -
.FormatLuks method ays - -
.Lock method - - -
.Unlock method ay - -

Signed-off-by: John Edward Broadbent <jebr@google.com>
Change-Id: Ifbbed7d81c55e3edbe519c2b1048b5d1731fbb0e

show more ...


# 67a47446 05-Apr-2022 John Wedig <johnwedig@google.com>

Switch eStoraged to asio interface

Switching the D-Bus interface to asio makes it easier to integrate with
EntityManager. In addition, this switch to asio makes sense since some
of the erase operati

Switch eStoraged to asio interface

Switching the D-Bus interface to asio makes it easier to integrate with
EntityManager. In addition, this switch to asio makes sense since some
of the erase operations take a long time, about 6 minutes.

This commit also removes one of the clang-tidy checks because clang was
flagging an error in one of the boost asio files, inside the constructor
for sdbusplus::asio::connection.

Tested:
Tested most of the methods and properties using busctl.
$ busctl call xyz.openbmc_project.eStoraged.mmcblk0 \
/xyz/openbmc_project/inventory/storage/mmcblk0 \
xyz.openbmc_project.Inventory.Item.Volume FormatLuks ays 3 1 2 3 \
xyz.openbmc_project.Inventory.Item.Volume.FilesystemType.ext4 \
--timeout=60
$ busctl call xyz.openbmc_project.eStoraged.mmcblk0 \
/xyz/openbmc_project/inventory/storage/mmcblk0 \
xyz.openbmc_project.Inventory.Item.Volume Lock
$ busctl call xyz.openbmc_project.eStoraged.mmcblk0 \
/xyz/openbmc_project/inventory/storage/mmcblk0 \
xyz.openbmc_project.Inventory.Item.Volume Unlock ay 3 1 2 3
$ busctl get-property xyz.openbmc_project.eStoraged.mmcblk0 \
/xyz/openbmc_project/inventory/storage/mmcblk0 \
xyz.openbmc_project.Inventory.Item.Volume Locked
$ busctl get-property xyz.openbmc_project.eStoraged.mmcblk0 \
/xyz/openbmc_project/inventory/storage/mmcblk0 \
xyz.openbmc_project.Inventory.Item.Drive Capacity
$ busctl call xyz.openbmc_project.eStoraged.mmcblk0 \
/xyz/openbmc_project/inventory/storage/mmcblk0 \
xyz.openbmc_project.Inventory.Item.Volume Erase s \
xyz.openbmc_project.Inventory.Item.Volume.EraseMethod.VerifyGeometry
$ busctl call xyz.openbmc_project.eStoraged.mmcblk0 \
/xyz/openbmc_project/inventory/storage/mmcblk0 \
xyz.openbmc_project.Inventory.Item.Volume Erase s \
xyz.openbmc_project.Inventory.Item.Volume.EraseMethod.LogicalOverWrite \
--timeout=1200
$ busctl call xyz.openbmc_project.eStoraged.mmcblk0 \
/xyz/openbmc_project/inventory/storage/mmcblk0 \
xyz.openbmc_project.Inventory.Item.Volume Erase s \
xyz.openbmc_project.Inventory.Item.Volume.EraseMethod.LogicalVerify \
--timeout=1200

Signed-off-by: John Wedig <johnwedig@google.com>
Change-Id: I99cb371871bfa68eb0193f614f899221afd9013a

show more ...


# e35e7361 22-Mar-2022 John Edward Broadbent <jebr@google.com>

Add implementation capacity for drive interface

This will set the capacity property when the eStoraged object is
created. This change does not expect the drive size to change.

Change-Id: I72cd68c50

Add implementation capacity for drive interface

This will set the capacity property when the eStoraged object is
created. This change does not expect the drive size to change.

Change-Id: I72cd68c5045e9ef49939f4655a223a02234c7434
Signed-off-by: John Edward Broadbent <jebr@google.com>

show more ...


# a1e0eb03 15-Mar-2022 John Edward Broadbent <jebr@google.com>

Change DBus path from storage to inventory

bmcweb only searches for drive in the inventory. If we want bmcweb to
find and treat the eMMC like drive, we must change this path.

It would be possible t

Change DBus path from storage to inventory

bmcweb only searches for drive in the inventory. If we want bmcweb to
find and treat the eMMC like drive, we must change this path.

It would be possible to change how bmcweb find drives. See below:
https://github.com/openbmc/bmcweb/blob/master/redfish-core/lib/storage.hpp#L561

Tested: Ran on real machine and verified the path was correct.
Change-Id: Ibba9d144f4d141fdad358da1e43db6d871d6d013
Signed-off-by: John Edward Broadbent <jebr@google.com>

show more ...


# 82897c35 21-Feb-2022 Ed Tanous <edtanous@google.com>

Check in a clang-tidy

This should've been done when we first created the repo, but better late
than never.

Signed-off-by: Ed Tanous <edtanous@google.com>
Signed-off-by: John Edward Broadbent <jebr@

Check in a clang-tidy

This should've been done when we first created the repo, but better late
than never.

Signed-off-by: Ed Tanous <edtanous@google.com>
Signed-off-by: John Edward Broadbent <jebr@google.com>
Change-Id: I68da1d13167ec94f9d008dea307c9f23a991d42c

show more ...


# e6ffe704 14-Oct-2021 John Edward Broadbent <jebr@google.com>

Add Erase verifyGeometry

This confirms specified amount of the drive is accessible. The min and
max expected drive size are set as a build configuration, and compared
against the drive size (found b

Add Erase verifyGeometry

This confirms specified amount of the drive is accessible. The min and
max expected drive size are set as a build configuration, and compared
against the drive size (found by using the linux ioctl). Also adds
testing build files, testing options, and verifyGeometry test.

Tested: Ran eStoraged on a machine with an eMMC, using the following
$ ./eStoraged -b /dev/mmcblk0 &
$ busctl call xyz.openbmc_project.eStoraged.mmcblk0 \
/xyz/openbmc_project/storage/mmcblk0 \
xyz.openbmc_project.eStoraged Erase ays 1 1 \
xyz.openbmc_project.eStoraged.EraseMethod.VerifyGeometry

Signed-off-by: John Edward Broadbent <jebr@google.com>
Change-Id: Ie47f8666996a6085a115d1b86f2643bc278638c5

show more ...


# 4e13b0a1 15-Nov-2021 John Edward Broadbent <jebr@google.com>

Add phosphor-logging

This commit adds phosphor-logging (lg2) to eStorageD. It also adds
several logging statements.

Signed-off-by: John Edward Broadbent <jebr@google.com>
Change-Id: Ideb4f6033b94dd

Add phosphor-logging

This commit adds phosphor-logging (lg2) to eStorageD. It also adds
several logging statements.

Signed-off-by: John Edward Broadbent <jebr@google.com>
Change-Id: Ideb4f6033b94dd8b1384c79cd3a26ce89e7b2c4c

show more ...


# 2098dabe 14-Sep-2021 John Wedig <johnwedig@google.com>

Initial D-Bus interface

This sets up an initial D-Bus interface without any real functionality.
It doesn't interact with any storage hardware yet.

The yaml files are included temporarily until the

Initial D-Bus interface

This sets up an initial D-Bus interface without any real functionality.
It doesn't interact with any storage hardware yet.

The yaml files are included temporarily until the
phosphor-dbus-interfaces review is complete:
https://gerrit.openbmc-project.xyz/c/openbmc/phosphor-dbus-interfaces/+/48636

The .clang-tidy file has been removed because clang-tidy can't filter
out the generated files. It should be re-enabled when we no longer need
to generate the D-Bus sources in this repo.

Signed-off-by: John Edward Broadbent <jebr@google.com>
Change-Id: If704e69ef7225257efc7c865424df4421999f62d
Signed-off-by: John Wedig <johnwedig@google.com>

show more ...