History log of /openbmc/estoraged/src/ (Results 1 – 25 of 59)
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
15b63e1216-Aug-2024 Patrick Williams <patrick@stwcx.xyz>

clang-format: re-format for clang-18

clang-format-18 isn't compatible with the clang-format-17 output, so we
need to reformat the code with the latest version. The way clang-18
handles lambda forma

clang-format: re-format for clang-18

clang-format-18 isn't compatible with the clang-format-17 output, so we
need to reformat the code with the latest version. The way clang-18
handles lambda formatting also changed, so we have made changes to the
organization default style format to better handle lambda formatting.

See I5e08687e696dd240402a2780158664b7113def0e for updated style.
See Iea0776aaa7edd483fa395e23de25ebf5a6288f71 for clang-18 enablement.

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

show more ...

d4554f2a17-Jun-2024 Manojkiran Eda <manojkiran.eda@gmail.com>

Fix spelling mistakes using codespell

This commit corrects various spelling mistakes throughout the
repository. The corrections were made automatically using `codespell`[1]
tool.

[1]: https://githu

Fix spelling mistakes using codespell

This commit corrects various spelling mistakes throughout the
repository. The corrections were made automatically using `codespell`[1]
tool.

[1]: https://github.com/codespell-project/codespell

Change-Id: I153217f4ae8454e3546a59da9fcfe3f83fd04b39
Signed-off-by: Manojkiran Eda <manojkiran.eda@gmail.com>

show more ...

3cf9e80630-Apr-2024 John Wedig <johnwedig@google.com>

Add retries when getting dbus properties

We have found that the dbus requests to Entity Manager sometimes time
out at startup, when getting the dbus properties from the Entity Manager
config object.

Add retries when getting dbus properties

We have found that the dbus requests to Entity Manager sometimes time
out at startup, when getting the dbus properties from the Entity Manager
config object. This commit adds retries, similar to how dbus-sensors
will retry these requests, if needed.

Tested:
Observed the dbus request to Entity Manager get retried on a machine,
and then it succeeded on the second attempt.

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

show more ...

620d1a5129-Mar-2024 Konstantin Aladyshev <aladyshev22@gmail.com>

build: Fix boost dependency

Currently local build fails with a message:
"""
src/meson.build:16:14: ERROR: Include dir subprojects/boost_1_78_0/
does not exist
"""
The error is happening because the

build: Fix boost dependency

Currently local build fails with a message:
"""
src/meson.build:16:14: ERROR: Include dir subprojects/boost_1_78_0/
does not exist
"""
The error is happening because the correct path for the includes should
not be "subprojects/boost_1_79_0/" but "../subprojects/boost_1_79_0/".
But such relative links are deprecated, therefore rewrite boost
dependency with its own packagefile.
Also boost library is required for the project build, therefore drop
"required: false" statement for the dependency.
And since boost is required for the libeStoragedErase, add boost_dep to
its dependencies.

Tested:
"meson setup build && cd build && meson compile" now works without any
issues.

Change-Id: Id0afda7563c944f3afc88cd1f59099794611525e
Signed-off-by: Konstantin Aladyshev <aladyshev22@gmail.com>

show more ...

0cec428612-Mar-2024 Hao Zhou <haoooamazing@google.com>

Return Unencrypted if header is not found

Previously when drive is not in Encrypted status, bmcweb will simply
omit encryptionStatus property with Unknown returned here.
That's to say we can never r

Return Unencrypted if header is not found

Previously when drive is not in Encrypted status, bmcweb will simply
omit encryptionStatus property with Unknown returned here.
That's to say we can never reach a case where Unencrypted is populated.

We should change it to Unencrypted so when the drive is not encrypted,
Unencrypted state can be observed on BMCweb

Tested: BMCWeb have EncryptionStatus populated when drive unencrypted

Change-Id: Ie3df1df77bff40527d684f5c5b495fb2f36463e0
Signed-off-by: Hao Zhou <haoooamazing@google.com>

show more ...

c0d66eb726-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 ...

d7be42bd19-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 ...

043af59f23-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 ...

ff1b64f020-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 ...

b650879b07-Aug-2023 George Liu <liuxiwei@inspur.com>

build-tests: The allowed method is used by default

The allowed method returns true when the feature is set to `enabled`
or `auto`.
The allowed method returns false when the feature is set to
`disabl

build-tests: The allowed method is used by default

The allowed method returns true when the feature is set to `enabled`
or `auto`.
The allowed method returns false when the feature is set to
`disabled`.
So we prefer to use the `allowed` method instead of `enabled`.

Change-Id: I1f1bb8bf40c1312d6943e67a81abc58dabfd94cd
Signed-off-by: George Liu <liuxiwei@inspur.com>

show more ...

1982505726-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 ...

ba000b9510-May-2023 Patrick Williams <patrick@stwcx.xyz>

clang-tidy: resolve 'readability-redundant-string-cstr'

Eliminate needless `c_str()` call.

```
../src/test/erase/crypto_test.cpp:67:20: error: redundant call to 'c_str' [readability-redundant-strin

clang-tidy: resolve 'readability-redundant-string-cstr'

Eliminate needless `c_str()` call.

```
../src/test/erase/crypto_test.cpp:67:20: error: redundant call to 'c_str' [readability-redundant-string-cstr,-warnings-as-errors]
CryptErase(testFileName.c_str(), std::move(mockCryptIface));
```

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

show more ...

04c28fad10-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 ...

0e2a46f510-May-2023 Patrick Williams <patrick@stwcx.xyz>

sdbusplus: use new namespace format

As mentioned in [1], the namespace preferred by the sdbus++ tool has
changed. Update this repository accordingly.

[1]: https://lore.kernel.org/openbmc/ZFLepbxKK

sdbusplus: use new namespace format

As mentioned in [1], the namespace preferred by the sdbus++ tool has
changed. Update this repository accordingly.

[1]: https://lore.kernel.org/openbmc/ZFLepbxKKXVGAwRB@heinlein.vulture-banana.ts.net/

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

show more ...

9be2f0fc11-Apr-2023 John Edward Broadbent <jebr@google.com>

Add type "SD" to allow eStoraged on sd devices

This change will allow eMMC to work with SD devices.

Change-Id: I686ef42d946f4c97f8fc04bf1280277b12f69333
Signed-off-by: John Edward Broadbent <jebr@g

Add type "SD" to allow eStoraged on sd devices

This change will allow eMMC to work with SD devices.

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

show more ...

2443a02117-Mar-2023 John Wedig <johnwedig@google.com>

Improve accuracy of 'Locked' property

The 'Locked' property in the volume interface is supposed to indicate
whether the LUKS volume is currently activated, but this property is
often inaccurate beca

Improve accuracy of 'Locked' property

The 'Locked' property in the volume interface is supposed to indicate
whether the LUKS volume is currently activated, but this property is
often inaccurate because it always defaults to false upon startup
(i.e. unlocked). However, the LUKS volume is usually locked at startup.
So, client daemons can get confused when looking at the Locked
property.

This commit reworks the functionality for the 'Locked' property, so that
it checks whether the mapped virtual crypt device exists, e.g. whether
/dev/mapper/<luks_device> exists. This way, the Locked property should
better reflect the actual state.

The one caveat to keep in mind is that 'Locked' will be True even if the
device isn't formatted as a LUKS volume. If client daemons need to know
whether it's already formatted, we may want to add another property to
the Volume interface for that purpose. But in the meantime, eStoraged
already exports an EncryptionStatus property as part of the Drive
interface. So, the information is already available, if needed.

Tested:
Checked 'Locked' property at startup
$ busctl get-property xyz.openbmc_project.eStoraged \
/xyz/openbmc_project/inventory/storage/mmcblk0 \
xyz.openbmc_project.Inventory.Item.Volume Locked
b true
Formatted the LUKS volume, then checked 'Locked' property again
$ 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 get-property xyz.openbmc_project.eStoraged \
/xyz/openbmc_project/inventory/storage/mmcblk0 \
xyz.openbmc_project.Inventory.Item.Volume Locked
b false
Restarted eStoraged and checked 'Locked' again.
$ systemctl restart xyz.openbmc_project.eStoraged
$ busctl get-property xyz.openbmc_project.eStoraged \
/xyz/openbmc_project/inventory/storage/mmcblk0 \
xyz.openbmc_project.Inventory.Item.Volume Locked
b false
Locked the LUKS volume, and checked 'Locked' again.
$ busctl call xyz.openbmc_project.eStoraged \
/xyz/openbmc_project/inventory/storage/mmcblk0 \
xyz.openbmc_project.Inventory.Item.Volume Lock
$ busctl get-property xyz.openbmc_project.eStoraged \
/xyz/openbmc_project/inventory/storage/mmcblk0 \
xyz.openbmc_project.Inventory.Item.Volume Locked
b true
Restarted eStoraged, and checked 'Locked' again.
$ systemctl restart xyz.openbmc_project.eStoraged
$ busctl get-property xyz.openbmc_project.eStoraged \
/xyz/openbmc_project/inventory/storage/mmcblk0 \
xyz.openbmc_project.Inventory.Item.Volume Locked
b true

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

show more ...

61cf426017-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 ...

47cd799605-Oct-2022 John Wedig <johnwedig@google.com>

Fix logic error for SecuredLocked EraseMethod

The handling for the SecuredLocked EraseMethod is missing a '!'
operator. We want to lock the LUKS volume if it is NOT already locked.

Tested:
Loaded e

Fix logic error for SecuredLocked EraseMethod

The handling for the SecuredLocked EraseMethod is missing a '!'
operator. We want to lock the LUKS volume if it is NOT already locked.

Tested:
Loaded eStoraged on a machine and exercised the SecuredLocked code path
to confirm the expected behavior, i.e. lock if it's not already lock.

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

show more ...

8d5a3a0729-Sep-2022 John Wedig <johnwedig@google.com>

Implement the changePassword method

With this commit, it is now possible to change the password for the
LUKS-encrypted volume, using the changePassword D-Bus method for
eStoraged.

Tested:
$ busctl

Implement the changePassword method

With this commit, it is now possible to change the password for the
LUKS-encrypted volume, using the changePassword D-Bus method for
eStoraged.

Tested:
$ 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 ChangePassword \
ayay 3 1 2 3 3 4 5 6
$ busctl call xyz.openbmc_project.eStoraged \
/xyz/openbmc_project/inventory/storage/mmcblk0 \
xyz.openbmc_project.Inventory.Item.Volume Lock
Attempted to unlock using the old password. It failed as expected.
$ busctl call xyz.openbmc_project.eStoraged \
/xyz/openbmc_project/inventory/storage/mmcblk0 \
xyz.openbmc_project.Inventory.Item.Volume Unlock ay 3 1 2 3
Unlocked with the new password
$ busctl call xyz.openbmc_project.eStoraged \
/xyz/openbmc_project/inventory/storage/mmcblk0 \
xyz.openbmc_project.Inventory.Item.Volume Unlock ay 3 4 5 6

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

show more ...

be47c8fe30-Sep-2022 John Wedig <johnwedig@google.com>

Fix zero_test and pattern_test

The zero_test and pattern_test are failing to compile because some mocks
are returning vectors instead of spans.

Signed-off-by: John Wedig <johnwedig@google.com>
Chan

Fix zero_test and pattern_test

The zero_test and pattern_test are failing to compile because some mocks
are returning vectors instead of spans.

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

show more ...

b483830822-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 ...

e3ef765d22-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 ...

4979641522-Jun-2022 John Edward Broadbent <jebr@google.com>

Update location interface

Before LocationCode was being set, but the bmcweb code used
LocationType. This change makes eStorageD use LocationType,
and not LocationCode.

Tested:

$ busctl introspect

Update location interface

Before LocationCode was being set, but the bmcweb code used
LocationType. This change makes eStorageD use LocationType,
and not LocationCode.

Tested:

$ busctl introspect xyz.openbmc_project.eStoraged /xyz/openbmc_project/inventory/storage/mmcblk0
NAME TYPE
...
xyz.openbmc_project.Inventory.Connector.Embedded interface
...

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

show more ...

6771c69122-Jun-2022 John Edward Broadbent <jebr@google.com>

Update initial values for new CI

Tested: code builds, and passes unit test

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

740e94bd10-Jun-2022 John Edward Broadbent <jebr@google.com>

Add location interface

Tested:
$busctl introspect xyz.openbmc_project.eStoraged \
/xyz/openbmc_project/inventory/storage/mmcblk0
...
xyz.openbmc_project.Inventory.Decorator.LocationCode interface
.

Add location interface

Tested:
$busctl introspect xyz.openbmc_project.eStoraged \
/xyz/openbmc_project/inventory/storage/mmcblk0
...
xyz.openbmc_project.Inventory.Decorator.LocationCode interface
.LocationCode property s "Embedded" emits-change
...

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

show more ...

123